DB Link
API Reference Guide
Product Documentation:

Visualization DB Link
Documentation Home
List of all members | Public Member Functions
IldADTValue Class Reference

Instances of this class represent the values of objects or collections of ORDBMSs. More...

#include <ildblink/ildadtval.h>

Public Member Functions

 IldADTValue (const IldADTDescriptor *type, const char *table=0)
 This constructor builds an ADT value skeleton and stores the type descriptor. More...
 
virtual ~IldADTValue ()
 This destructor deletes all the registered values but does not delete the abstract data type descriptor.
 
IldADTType getADTType () const
 Get the type. More...
 
IldADTValuegetADTValue (IlUInt index) const
 Get the abstract data type value. More...
 
IldBytes getBytesValue (IlUInt index) const
 Get a binary value. More...
 
IlUChar getByteValue (IlUInt index) const
 Get the byte value. More...
 
IlUInt getCount () const
 Get the number of values set. More...
 
IldDateTime getDateTimeValue (IlUInt index) const
 Get a date value as object. More...
 
const char * getDateValue (IlUInt index) const
 Get a date value as string. More...
 
const IldADTDescriptorgetDescriptor () const
 Get the type descriptor. More...
 
IlInt getIntegerValue (IlUInt index) const
 Get the integer value. More...
 
double getMoneyValue (IlUInt index) const
 Get the money value. More...
 
IlNumeric getNumericValue (IlUInt index) const
 Get a numeric value as object. More...
 
const char * getPurgedStringValue (IlUInt index) const
 Get the trimmed string value. More...
 
double getRealValue (IlUInt index) const
 Get the floating point value. More...
 
IldBytes getRefValue (IlUInt index) const
 Get a reference value. More...
 
const char * getRTrimedStringValue (IlUInt index) const
 Get the trimmed string value. More...
 
const char * getStringValue (IlUInt index) const
 Get the string value. More...
 
const char * getTableName () const
 Get the table name. More...
 
IldColumnType getType (IlUInt index) const
 Get the type of the value. More...
 
const char * getTypeName () const
 Get the type name. More...
 
IlBoolean isNull (IlUInt index) const
 Tell if a value is null. More...
 
IlBoolean setNull (IlBoolean flag, IlUInt index)
 Set the null indicator of a value. More...
 
IlBoolean setValue (const char *val, IlUInt index)
 Set the value as string. More...
 
IlBoolean setValue (const IldDateTime *val, IlUInt index)
 Set the value as an IldDateTime object. More...
 
IlBoolean setValue (const IlNumeric *val, IlUInt index)
 Set the value as an IlNumeric object. More...
 
IlBoolean setValue (double val, IlUInt index)
 Set the value as double. More...
 
IlBoolean setValue (IldADTValue *val, IlUInt index)
 Set the value as an IldADTValue object. More...
 
IlBoolean setValue (IldBytes val, IlUInt index)
 Set the value as a IldBytes structure. More...
 
IlBoolean setValue (IlInt val, IlUInt index)
 Set the value as integer. More...
 
IlBoolean setValue (IlUChar val, IlUInt index)
 Set the value as byte. More...
 

Detailed Description

Instances of this class represent the values of objects or collections of ORDBMSs.

Library: dbkernel

Note
For the member functions that add values to the object (set functions), if the object is a collection and the given position is greater than the number of values set, then the new value is added at the end of the list.

The resulting position may differ from the one passed as an argument. Thus, if the order of the values is relevant, they must be set in that order.

See also
IldColumnType, IldDateTime, IlNumeric, IlUChar.

Constructor & Destructor Documentation

◆ IldADTValue()

IldADTValue::IldADTValue ( const IldADTDescriptor type,
const char *  table = 0 
)

This constructor builds an ADT value skeleton and stores the type descriptor.

Parameters
typeThe descriptor for the user defined type.
tableThe name of the table using the type.

The second argument is optional for Oracle, but mandatory for Informix. It is used to get the Informix type descriptor when the value is to be sent to the server.

Member Function Documentation

◆ getADTType()

IldADTType IldADTValue::getADTType ( ) const

Get the type.

Returns
The ADT category of the attached type descriptor.

◆ getADTValue()

IldADTValue* IldADTValue::getADTValue ( IlUInt  index) const

Get the abstract data type value.

Parameters
indexThe index of value in object.
Returns
The value at position index as an IldADTValue pointer.

If the value is null, if index is greater than the number of values set, or if the actual type of the value is not IldObjectType or IldCollectionType, then it returns a null pointer.

◆ getBytesValue()

IldBytes IldADTValue::getBytesValue ( IlUInt  index) const

Get a binary value.

Parameters
indexThe index of value in object.
Returns
The value at position index as an IldBytes structure.

If the value is null, if index is greater than the number of values set, or if the actual type of the value is not IldBinaryType, then it returns an empty IldBytes structure.

◆ getByteValue()

IlUChar IldADTValue::getByteValue ( IlUInt  index) const

Get the byte value.

Parameters
indexThe index of value in object.
Returns
The value at position index as an IlUChar value.

This member function returns 0 if:

  • The value is null,
  • The argument index is greater than the number of values set, or
  • The actual type of the value is not IldByteType.

◆ getCount()

IlUInt IldADTValue::getCount ( ) const

Get the number of values set.

Returns
The number of values set.

◆ getDateTimeValue()

IldDateTime IldADTValue::getDateTimeValue ( IlUInt  index) const

Get a date value as object.

Parameters
indexThe index of value in object.
Returns
The value at position index as an IldDateTime object.

If the value is null, if index is greater than the number of values set, or if the actual type of the value is not IldDateTimeType, then it returns an empty object whose slots are all set to 0.

◆ getDateValue()

const char* IldADTValue::getDateValue ( IlUInt  index) const

Get a date value as string.

Parameters
indexThe index of value in object.
Returns
A string for the date value at position index.

This member function behaves exactly like the function getStringValue().

This function returns 0 if the value is null, or the argument index is greater than the number of values set, or the actual type of the value is not IldStringType.

◆ getDescriptor()

const IldADTDescriptor* IldADTValue::getDescriptor ( ) const

Get the type descriptor.

Returns
The attached type descriptor.

◆ getIntegerValue()

IlInt IldADTValue::getIntegerValue ( IlUInt  index) const

Get the integer value.

Parameters
indexThe value index in the object.
Returns
The value at position index as an integer.
  • If the value is null, if index is greater than the number of values set, or if the actual type of the value is not IldIntegerType or IldRealType, then it returns 0.
  • If the type of the value is IldRealType, it is converted to an IlInt regardless of a possible overflow.

◆ getMoneyValue()

double IldADTValue::getMoneyValue ( IlUInt  index) const

Get the money value.

Parameters
indexThe index of value in object.
Returns
The value at position index as a double.

This member function behaves exactly like the function getRealValue().

  • When the value is null or index is greater than the number of values set, or the actual type of the value is not IldIntegerType or IldRealType, it returns 0.0.
  • If the type of the value is IldIntegerType, it is converted to double.

◆ getNumericValue()

IlNumeric IldADTValue::getNumericValue ( IlUInt  index) const

Get a numeric value as object.

Parameters
indexThe index of value in object.
Returns
The value at position index as an IlNumeric object.

If the value is null, if the argument index is greater than the number of values set, or if the actual type of the value is not IlNumericType, this function returns an empty object whose slots are all set to 0.

◆ getPurgedStringValue()

const char* IldADTValue::getPurgedStringValue ( IlUInt  index) const

Get the trimmed string value.

Parameters
indexThe value index in object.
Returns
The value at position index as a string that has been right-trimmed, that is, all spaces to the right of the string have been removed.

If the value is null, if index is greater than the number of values set, or if the actual type of the value is not IldStringType, then it returns 0.

Note
This function is deprecated; the use of getRTrimedStringValue() should be preferred.

◆ getRealValue()

double IldADTValue::getRealValue ( IlUInt  index) const

Get the floating point value.

Parameters
indexThe index of value in object.
Returns
The value at position index as a double.
  • If the value is null or index is greater than the number of values set, or the actual type of the value is not IldIntegerType or IldRealType, then it returns 0.0.
  • If the type of the value is IldIntegerType, it is converted to a double.

◆ getRefValue()

IldBytes IldADTValue::getRefValue ( IlUInt  index) const

Get a reference value.

Parameters
indexThe index of value in object.
Returns
The value at position index as an IldBytes structure.

If the value is null, or if index is greater than the number of values set, or if the actual type of the value is not IldRefType, then it returns an empty structure.

◆ getRTrimedStringValue()

const char* IldADTValue::getRTrimedStringValue ( IlUInt  index) const

Get the trimmed string value.

Parameters
indexThe value index in object.
Returns
The value at position index as a string that has been right trimmed if, and only if, the SQL type is CHAR.

If the value is null, if index is greater than the number of values set, or if the actual type of the value is not IldStringType, then it returns 0.

◆ getStringValue()

const char* IldADTValue::getStringValue ( IlUInt  index) const

Get the string value.

Parameters
indexThe value index in object.
Returns
A string for the value at position index.

If the value is null or index is greater than the number of values set or the actual type of the value is not IldStringType, it returns 0.

◆ getTableName()

const char* IldADTValue::getTableName ( ) const

Get the table name.

Returns
The name of the table given to the constructor.

◆ getType()

IldColumnType IldADTValue::getType ( IlUInt  index) const

Get the type of the value.

Parameters
indexThe value index in the object
Returns
The type of the value at position index.

◆ getTypeName()

const char* IldADTValue::getTypeName ( ) const

Get the type name.

Returns
The descriptor type name.

◆ isNull()

IlBoolean IldADTValue::isNull ( IlUInt  index) const

Tell if a value is null.

Parameters
indexThe value index in the object.
Returns
IlTrue if the value at position index is null, IlFalse if not.

If index is greater than the number of values set, IlTrue is returned.

◆ setNull()

IlBoolean IldADTValue::setNull ( IlBoolean  flag,
IlUInt  index 
)

Set the null indicator of a value.

Parameters
flagThe value to set.
indexThe index of the value.
Returns
The flag value.

If there is no value at the given position, the indicator is added at the end of the values list. Otherwise, the previous value is overwritten. If the list cannot be extended, the function returns IlFalse. Otherwise, it returns IlTrue.

◆ setValue() [1/8]

IlBoolean IldADTValue::setValue ( const char *  val,
IlUInt  index 
)

Set the value as string.

Parameters
valThe string value to set.
indexThe index in object.
Returns
The status of the assigment.

If index is greater than the number of values set, the new value is added at the end of the values list. Otherwise, the previous value is overwritten. If the list cannot be extended, the function returns IlFalse. Otherwise, it returns IlTrue.

◆ setValue() [2/8]

IlBoolean IldADTValue::setValue ( const IldDateTime val,
IlUInt  index 
)

Set the value as an IldDateTime object.

Parameters
valThe date time object to set.
indexThe index in object.
Returns
The status of the assignment.

If index is greater than the number of values set, then the new value is added at the end of the list. Otherwise, the previous value is overwritten. If the list cannot be extended, the function returns IlFalse. Otherwise, it returns IlTrue.

◆ setValue() [3/8]

IlBoolean IldADTValue::setValue ( const IlNumeric val,
IlUInt  index 
)

Set the value as an IlNumeric object.

Parameters
valThe numeric to set.
indexThe index in object.
Returns
The status of the assignement.

If index is greater than the number of values set, then the new value is added at the end of the list. Otherwise, the previous value is overwritten. If the values list cannot be extended, it returns IlFalse. Otherwise, it returns IlTrue.

◆ setValue() [4/8]

IlBoolean IldADTValue::setValue ( double  val,
IlUInt  index 
)

Set the value as double.

Parameters
valThe double value to set.
indexThe index in object.
Returns
The status of the assignment.

If index is greater than the number of values set, then the new value is added at the end of the values list. Otherwise, the previous value is overwritten. If the list cannot be extended, the function returns IlFalse. Otherwise, it returns IlTrue.

◆ setValue() [5/8]

IlBoolean IldADTValue::setValue ( IldADTValue val,
IlUInt  index 
)

Set the value as an IldADTValue object.

Parameters
valThe abstract data type object to set.
indexThe index in object.
Returns
The status of the assignment.

If index is greater than the number of values set, then the new value is added at the end of the list. Otherwise, the previous value is overwritten. If the values list cannot be extended, it returns IlFalse. Otherwise, it returns IlTrue.

Warning
Unlike The two other setValue() functions (that take numeric and date argument values), this member function does not copy the value passed.

◆ setValue() [6/8]

IlBoolean IldADTValue::setValue ( IldBytes  val,
IlUInt  index 
)

Set the value as a IldBytes structure.

Parameters
valThe structure to set the value.
indexThe index in object.
Returns
The status of the assignment.

If index is greater than the number of values set, then the new value is added at the end of the list. Otherwise, the previous value is overwritten. If the list cannot be extended, the function returns IlFalse. Otherwise, it returns IlTrue.

The value is copied. It can be released after the call to setValue.

◆ setValue() [7/8]

IlBoolean IldADTValue::setValue ( IlInt  val,
IlUInt  index 
)

Set the value as integer.

Parameters
valThe value to set.
indexThe index in object.
Returns
The status of the assignment.

If index is greater than the number of values set, then the new value is added at the end of the list. Otherwise, the previous value is overwritten. If the list cannot be extended, the function returns IlFalse. Otherwise, it returns IlTrue.

◆ setValue() [8/8]

IlBoolean IldADTValue::setValue ( IlUChar  val,
IlUInt  index 
)

Set the value as byte.

Parameters
indexThe index in object.
valThe byte value to set.
Returns
The status of the assignment.

If index is greater than the number of values set, then the new value is added at the end of the values list. Otherwise, the previous value is overwritten. If the list cannot be extended, the function returns IlFalse. Otherwise, it returns IlTrue.