Value :: Value - Constructor
The value (handle) constructor creates and opens a value handle for a persistent or transient property instance. Usually, a value handles an elementary instance or instance array. In some cases, a value handle may also handle complex instances. Since value handle do not have got iteration functions, they cannot handle collections, except arrays. A data source contains the data for a property of a specific object. Except for the dummy constructor (no parameter), value handles are opened when being constructed successfully. In order to check the success one may use the isValid() or isAccessible() function.
When constructing a subsequent value handle (passing the parent property handle and the property name to the constructor), the parent must be opened. The data source provided in the subsequent property handle depends on the parents property handle current selection and will be provided automatically whenever the parent property handle changes its current selection.
You can create static value handles for constants or other elementary data sources as well as for structured instances using the appropriate constructor function. This also provides implicit data conversion, i.e. one may use standard data types in value operations as long as the left operand is a value handle.
// fragment: Property person;
Value name(person,"name");
Value income(person,"income");
name += " *";
income += 200;
Implementation overview
- Create value handle for a 64-bit integer value
Value :: Value ( i64Value ) - Create value handle for a boolean value
Value :: Value ( bValue ) - Open value handle for a date value
Value :: Value ( cDate ) - Open value handle for a date/time value
Value :: Value ( cDateTime ) - Open value handle for a double value
Value :: Value ( vDouble ) - Create an unbound property handle with type name
Value :: Value ( cObjectSpace, sTypeName ) - Open value handle for a 32-bit integer value
Value :: Value ( iValue ) - Open value handle for fixed string value
Value :: Value ( sString, iLength ) - Open value handle for a string value
Value :: Value ( sString ) - Open value handle for a time value
Value :: Value ( cTime ) - Open cursor copy for a property handle
Value :: Value ( cValue ) - Open an undefined value handle
Value :: Value (  ) - Create value for parent property handle
Value :: Value ( cProperty, vAccessPath ) - Create value for subattribute
Value :: Value ( cValue, vAccessPath )
Implementation details
- to list
- to list
-
Open value handle for a date value
Value  :: Value ( odaba::Date &cDate )
The function opens an application transient value handle for a date value (DATE).
- cDate
- Date
The date contains day, month and year, but not the time.
to list
- cDate
- Date
-
Open value handle for a date/time value
Value  :: Value ( odaba::DateTime &cDateTime )
The function opens an application transient value handle for a timestamp value (DateTime).
- cDateTime
- Time stamp
A time stamp combines date and time
to list
- cDateTime
- Time stamp
- to list
-
Create an unbound property handle with type name
Value  :: Value ( odaba::ObjectSpace &cObjectSpace, odaba::String &sTypeName )
The constructor opens an application transient value handle for the complex data type passed in sTypeName. An instance is allocated and initialized.
- cObjectSpace
- Object space reference
The reference refers to an opened or not opened object space handle.
- sTypeName
- Type name
The type name is the name of a data type (usually) defined in the database. The type name might be passed as simple identifier or as scoped name with preceding namespace names separated by double colon '::'.
In order to pass no type name, an empty string ( String() ) may be passed.
to list
- cObjectSpace
- Object space reference
-
Open value handle for a 32-bit integer value
Value  :: Value ( int32 iValue )
The function opens an application transient value handle for a platform independent 32-bit integer value (int32, INT(10)).
- iValue
- Integer value
The value is passed as platform independent 32-bit integer value.
to list
- iValue
- Integer value
-
Open value handle for fixed string value
Value  :: Value ( odaba::String &sString, int32 iLength )
The function opens an application transient value handle for a string value (STRING). The string area is allocated with the size passed in iLength. The string is copied into the instance area owned by the value handle.
In order to create variable size text values, open(sString) should be used, instead.
- sString - String value
- iLength
- Length
The length is the size allocated for an instance or area.
to list
-
Open value handle for a string value
Value  :: Value ( odaba::String &sString )
The function opens an application transient value handle for a string value (STRING). The string area is allocated with the current size of the string passed in sString. The string is copied into the instance area owned by the value handle.
In order to create fixed size text values, open(sString,iLength) should be used.
- sString - String value
to list
-
Open value handle for a time value
Value  :: Value ( odaba::Time &cTime )
The function opens an application transient value handle for a time value (TIME).
- 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
-
Open cursor copy for a property handle
Value  :: Value ( odaba::Value &cValue )
The function creates a copy of the value handle passed in cValue. Both, the copy and the origin, share the the value instance, i.e. changing the value in one of the value handles will automatically change the value in the other.
- cValue
- Value handle
A value handle refers to a (usually) opened value. Invalid value handles may cause an exception.
to list
- cValue
- Value handle
-
Open an undefined value handle
Value  :: Value (  )
The function opens an invalid value handle. Before using the handle handle definition and instance area has to be set (open(...))..
to list
-
Create value for parent property handle
Value  :: Value ( odaba::Property &cProperty, odaba::String &vAccessPath )
The function has been provided for convenience in order to create a value handle by means of a parent property handle. Usually, value handles are created by appropriate property handle functions.
// fragment: Property person;
Value name(person,"name");
// same as
Value name;
name.use(person.value("name");
- cProperty
- Property reference
A property handle refers to a (usually) opened property. Invalid properties may cause an exception.
- vAccessPath
- Access path
An access path may simply refer to an extent or property, but also to a calculated result. Thus, an access path may contain just a name, but also a sequence of path elements separated by '.' in order to refer to far properties or complex operations.
The access path may start with two dots (.), which indicates, that the path starts in an upper property handle. One dot indicates, that the path starts in the current property handle. This distinction becomes necessary, when a property has the same name as an extent. To access a property in this case, one dot must precede the property name. The first dot can be omitted, when the property name is not an extent name.
Forcing to a path to start in a parent property handle requires two dots (..), the parents parent three and so on.
In order to pass no access path, an empty string ( String() ) has to be passed.
address.street // property path
.address.street // property path
..address.street // address in parent property instance
children(0).Age() // operation path
Person().children() // path property
children('Anton') // path property
to list
- cProperty
- Property reference
-
Create value for subattribute
Value  :: Value ( odaba::Value &cValue, odaba::String &vAccessPath )
The function creates a value for a sub attribute in a complex attribute.
- cValue
- Value handle
A value handle refers to a (usually) opened value. Invalid value handles may cause an exception.
- vAccessPath
- Access path
An access path may simply refer to an extent or property, but also to a calculated result. Thus, an access path may contain just a name, but also a sequence of path elements separated by '.' in order to refer to far properties or complex operations.
The access path may start with two dots (.), which indicates, that the path starts in an upper property handle. One dot indicates, that the path starts in the current property handle. This distinction becomes necessary, when a property has the same name as an extent. To access a property in this case, one dot must precede the property name. The first dot can be omitted, when the property name is not an extent name.
Forcing to a path to start in a parent property handle requires two dots (..), the parents parent three and so on.
In order to pass no access path, an empty string ( String() ) has to be passed.
address.street // property path
.address.street // property path
..address.street // address in parent property instance
children(0).Age() // operation path
Person().children() // path property
children('Anton') // path property
to list
- cValue
- Value handle