company logo

Value :: operator= - Assign value

The function can be called in order to change an attribute value. The value passed in the right operand (parameter) is converted into the data type of the left operand.

Assigning values depends much on the value types on the left and the right side. In general, the right value (parameter) will be converted to the type of the left value before being assigned.

An instance has to be be selected in both value handles. When the target value is part of a persistent instance, the function checks, whether the value is going to be changed, i.e. whether it differs from the original value. When this is the case, the function marks the instance as modified (modified()). When the access mode for the target value is Read, setting the value is denied. In order to change values in read only instances, one may call assign().

When conversion is not supported or no instance is selected in the property handle, the function throws an exception.

Return value:  Value handle ( odaba::Value & )

A value handle refers to a (usually) opened value. Invalid value handles may cause an exception.

Implementation overview

Implementation details

  1. Assign big integer value
    odaba::Value & Value  :: operator= ( int64 i64Value )

    The function assigns an int64 value. int64 values cannot be stored into MEMO, BLOB and DateTime values. Trying to assign an integer value to one of those types will throw an exception.

    • i64Value - Big integer value

      Big integer values are 64 bit integer values.

  2. to list
  3. Assign Boolean value
    odaba::Value & Value  :: operator= ( bool bValue )

    The function stores a bool value. bool values cannot be stored into into Date, Time, MEMO, BLOB or DateTime values. Trying to assign a Boolean value to one of those types will throw an exception.

    • bValue - Boolean value

      Valid values for Boolean values are true and false.

  4. to list
  5. Assign date value
    odaba::Value & Value  :: operator= ( odaba::Date &cDate )

    The function assigns a Date value. Date values cannot be stored intoTime, MEMO, BLOB and REAL (double) values. Trying to assign a date value to one of those types will throw an exception.

    • cDate - Date

      The date contains day, month and year, but not the time.

  6. to list
  7. Assign timestamp value
    odaba::Value & Value  :: operator= ( odaba::DateTime &cDateTime )

    The function assigns a DateTime value. DateTime values cannot be stored intoINT, MEMO, BLOB and REAL (double) properties. Trying to assign a timestamp value to one of those types will throw an exception.

    • cDateTime - Time stamp

      A time stamp combines date and time

  8. to list
  9. Assign double value
    odaba::Value & Value  :: operator= ( double vDouble )

    The function assigns a double value. double values cannot be stored into MEMO, BLOB, Time, Date and DateTime values. Trying to assign a double value to one of those types will throw an exception.

    Float conversion is not supported explicitly, but float values, usually are converted into double values automatically (by compiler), before calling the assignment function.

    • vDouble - Double value
  10. to list
  11. Assign integer value to property
    odaba::Value & Value  :: operator= ( int32 iValue )

    The function assigns an int32 value. int32 values cannot be stored into MEMO, BLOB and DateTime values. Trying to assign an integer value to one of those types will throw an exception.

    • iValue - Integer value

      The value is passed as platform independent 32-bit integer value.

  12. to list
  13. Assign string value
    odaba::Value & Value  :: operator= ( odaba::String &sString )

    The function assigns a String value. String values cannot be stored into BLOB values. Trying to assign a string value into a BLOB value will throw an exception.

    In order to convert control sequences as '\n'or '\t' into control characters, true has to be passed for bConvert.

    • sString - String value
  14. to list
  15. Assign time value
    odaba::Value & Value  :: operator= ( odaba::Time &cTime )

    The function assigns a Time value. Time values cannot be stored into Date, MEMO, BLOB and REAL (double) properties. Trying to assign a time value to one of those types will throw an exception.

    • cTime - Time value

      The time value is passed in the ODABA Interface::Time format and provides time in 1/100th seconds.

  16. to list
  17. Store value passed in property
    odaba::Value & Value  :: operator= ( odaba::Value &cValue )

    The function stores the value passed in cValue. cValue must refer to a value property with an instance selected. Conversion between data types must be supported. Otherwise, an exception is thrown.

    • cValue - Value handle

      A value handle refers to a (usually) opened value. Invalid value handles may cause an exception.

  18. to list