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 ) - 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 ) - 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
-
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
-
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