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.
A value handle refers to a (usually) opened value. Invalid value handles may cause an exception.
Implementation overview
- Assign big integer value
Value :: operator= ( i64Value ) - - internal feature (not documented)
Value :: operator= ( cBinary ) - Assign Boolean value
Value :: operator= ( bValue ) - Assign date value
Value :: operator= ( cDate ) - Assign timestamp value
Value :: operator= ( cDateTime ) - Assign double value
Value :: operator= ( vDouble ) - Assign integer value to property
Value :: operator= ( iValue ) - Assign string value
Value :: operator= ( sString ) - Assign time value
Value :: operator= ( cTime ) - Assign instance to value
Value :: operator= ( cInstance ) - Assign key to value
Value :: operator= ( cKey ) - Store value passed in property
Value :: operator= ( cValue )
Implementation details
-
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.
to list
- i64Value
- Big integer value
-
- internal feature (not documented)
odaba::Value & Value  :: operator= ( odaba::Binary &cBinary )
- cBinary
- Binary data block handle
Constant reference to a binary data block handle, which may contain binary data up to 2 GB.
to list
- cBinary
- Binary data block handle
-
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.
to list
- bValue
- Boolean value
-
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.
to list
- cDate
- Date
-
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
to list
- cDateTime
- Time stamp
-
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
to list
-
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.
to list
- iValue
- Integer value
-
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
to list
-
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.
to list
- cTime
- Time value
-
Assign instance to value
odaba::Value & Value  :: operator= ( odaba::Instance &cInstance )
The function assigns instance data to the value. The function expects a complex data type in the value.
When type definitions for instance and value are different, attributes of the complex data type are copied by name, i.e. only those attributes are copied, which are member of both type definitions.
Notes:The function does not check, whether all attributes have been assigned, i.e. assignments might be incomplete.
- cInstance
- Instance
The instance is passed as String, which is structured as ESDF data (object interchange format).
to list
- cInstance
- Instance
-
Assign key to value
odaba::Value & Value  :: operator= ( odaba::Key &cKey )
The function assigns key data to the value. The function expects a complex data type in the value.
When type definitions for key and value are different, attributes of the complex data type are copied by name, i.e. only those attributes are copied, which are member of both type definitions.
Notes:The function does not check, whether all attributes have been assigned, i.e. assignments might be incomplete.
- cKey
- Key value
A key value is the key definition and a value for the key. The key value is typically provided in ESDF format. Other formats might be set (OIF, XML)
to list
- cKey
- Key value
-
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.
to list
- cValue
- Value handle