Public Types | |
enum | ValueType { TYPE_NULL, TYPE_BOOLEAN, TYPE_BOOLEAN_ARRAY, TYPE_BYTE, TYPE_BYTE_ARRAY, TYPE_SHORT, TYPE_SHORT_ARRAY, TYPE_INT, TYPE_INT_ARRAY, TYPE_LONG, TYPE_LONG_ARRAY, TYPE_FLOAT, TYPE_FLOAT_ARRAY, TYPE_DOUBLE, TYPE_DOUBLE_ARRAY, TYPE_STRING, TYPE_STRING_ARRAY } |
Type codes for supported value types. More... | |
Public Member Functions | |
rdaDataEntry & | operator= (const rdaDataEntry &de) |
Inserts a value contained in the specified data entry into this entry. | |
const char * | tag () const |
Returns the tag that is assigned to this data entry in the rdaData object in which it is contained. | |
void | asciiDump (unsigned long maxElements=5) const |
Prints contents of this data entry to the standard output. | |
ValueType | getValueType () const |
Returns the type code for the value contained in this DataEntry object. | |
Print methods | |
These methods send a text representation of the data entry to the standard output or a file.
The printout includes the entry tag, data type, and value. | |
void | print (FILE *fp, unsigned long maxElements) const |
Prints contents of this data entry to the specified file. | |
void | print (unsigned long maxElements) const |
Prints contents of this data entry to the standard output. | |
void | print () const |
Prints contents of this data entry to the standard output. | |
Comparison operators | |
Two data entries considered to be equal if they contain equal values of the same type. | |
bool | operator== (const rdaDataEntry &) const |
Compares two data entries for equality. | |
bool | operator!= (const rdaDataEntry &) const |
Compares two data entries for inequality. | |
Extraction methods | |
bool | extractBoolean () const |
Returns the boolean value stored in this rdaDataEntry object. | |
bool * | extractBooleanArray (unsigned long &size) const |
Returns a copy of the boolean array stored in this rdaDataEntry object. | |
const bool * | getBooleanArray (unsigned long &size) const |
Returns a pointer to the boolean array stored in this rdaDataEntry object. | |
signed char | extractByte () const |
Returns the byte value stored in this rdaDataEntry object. | |
signed char * | extractByteArray (unsigned long &size) const |
Returns a copy of the byte array stored in this rdaDataEntry object. | |
const signed char * | getByteArray (unsigned long &size) const |
Returns a pointer to the byte array stored in this rdaDataEntry object. | |
short | extractShort () const |
Returns the short value stored in this rdaDataEntry object. | |
short * | extractShortArray (unsigned long &size) const |
Returns a copy of the short array stored in this rdaDataEntry object. | |
const short * | getShortArray (unsigned long &size) const |
Returns a pointer to the short array stored in this rdaDataEntry object. | |
long | extractInt () const |
Returns the integer value stored in this rdaDataEntry object. | |
long * | extractIntArray (unsigned long &size) const |
Returns a copy of the integer array stored in this rdaDataEntry object. | |
const long * | getIntArray (unsigned long &size) const |
Returns a pointer to the integer array stored in this rdaDataEntry object. | |
longlong | extractLong () const |
Returns the longlong value stored in this rdaDataEntry object. | |
longlong * | extractLongArray (unsigned long &size) const |
Returns a copy of the longlong array stored in this rdaDataEntry object. | |
const longlong * | getLongArray (unsigned long &size) const |
Returns a pointer to the longlong array stored in this rdaDataEntry object. | |
float | extractFloat () const |
Returns the float value stored in this rdaDataEntry object. | |
float * | extractFloatArray (unsigned long &size) const |
Returns a copy of the float array stored in this rdaDataEntry object. | |
const float * | getFloatArray (unsigned long &size) const |
Returns a pointer to the float array stored in this rdaDataEntry object. | |
double | extractDouble () const |
Returns the double value stored in this rdaDataEntry object. | |
double * | extractDoubleArray (unsigned long &size) const |
Returns a copy of the double array stored in this rdaDataEntry object. | |
const double * | getDoubleArray (unsigned long &size) const |
Returns a pointer to the double array stored in this rdaDataEntry object. | |
char * | extractString () const |
Returns a copy of the string stored in this rdaDataEntry object. | |
const char * | getString () const |
Returns a pointer to the string stored in this rdaDataEntry object. | |
char ** | extractStringArray (unsigned long &size) const |
Returns a deep copy of the string array stored in this rdaDataEntry object. | |
const char ** | getStringArray (unsigned long &size) const |
Returns a pointer to the string array stored in this rdaDataEntry object. | |
Insertion methods | |
void | insert (bool value) |
Inserts the speciifed boolean value into this rdaDataEntry object. | |
void | insert (const bool *value, unsigned long size) |
Inserts a boolean array value into this rdaDataEntry object. | |
void | put (const bool *value, unsigned long size) |
Inserts a boolean array "by pointer" into this rdaDataEntry object. | |
void | insert (signed char value) |
Inserts the speciifed byte value into this rdaDataEntry object. | |
void | insert (const signed char *value, unsigned long size) |
Inserts a byte array value into this rdaDataEntry object. | |
void | put (const signed char *value, unsigned long size) |
Inserts a byte array "by pointer" into this rdaDataEntry object. | |
void | insert (short value) |
Inserts the speciifed short value into this rdaDataEntry object. | |
void | insert (const short *value, unsigned long size) |
Inserts a short array value into this rdaDataEntry object. | |
void | put (const short *value, unsigned long size) |
Inserts a short array "by pointer" into this rdaDataEntry object. | |
void | insert (long value) |
Inserts the speciifed integer value into this rdaDataEntry object. | |
void | insert (const long *value, unsigned long size) |
Inserts an integer array value into this rdaDataEntry object. | |
void | put (const long *value, unsigned long size) |
Inserts an integer array "by pointer" into this rdaDataEntry object. | |
void | insert (longlong value) |
Inserts the speciifed long integer value into this rdaDataEntry object. | |
void | insert (const longlong *value, unsigned long size) |
Inserts an long integer array value into this rdaDataEntry object. | |
void | put (const longlong *value, unsigned long size) |
Inserts an long integer array "by pointer" into this rdaDataEntry object. | |
void | insert (float value) |
Inserts the speciifed float value into this rdaDataEntry object. | |
void | insert (const float *value, unsigned long size) |
Inserts a float array value into this rdaDataEntry object. | |
void | put (const float *value, unsigned long size) |
Inserts a float array "by pointer" into this rdaDataEntry object. | |
void | insert (double value) |
Inserts the speciifed double value into this rdaDataEntry object. | |
void | insert (const double *value, unsigned long size) |
Inserts a double array value into this rdaDataEntry object. | |
void | put (const double *value, unsigned long size) |
Inserts a double array "by pointer" into this rdaDataEntry object. | |
void | insert (const char *value) |
Inserts the speciifed string value into this rdaDataEntry object. | |
void | put (const char *value) |
Inserts the speciifed string "by pointer" into this rdaDataEntry object. | |
void | insert (const char **value, unsigned long size) |
Inserts a string array value into this rdaDataEntry object. | |
void | put (const char **value, unsigned long size) |
Inserts a string array "by pointer" into this rdaDataEntry object. | |
Static Public Member Functions | |
const char * | getTypeName (ValueType typeCode) |
Returns the data type name for the specified type code. | |
Friends | |
class | rdaData |
Related Functions | |
(Note that these are not member functions.) | |
ostream & | operator<< (ostream &os, const rdaDataEntry &dataEntry) |
Prints a string representation of the data entry to the output stream os . |
The contained values can be single instances or single-dimensional arrays of the types listed in the table below. An rdaDataEntry object stores the value type code along with the value. Since the data entry objects can be passed between C++ and Java applications, the table provides also the correspondance between C++ and Java types.
type name | C++ type | Java type |
Boolean | bool | boolean |
Byte | signed char | byte |
Short | short | short |
Int | long | int |
Long | longlong | long |
Float | float | float |
Double | double | double |
String | null-terminated char string | String |
A large part of the rdaDataEntry API consists of the methods for inserting values into and extracting values from a data entry.
For a given type X, these methods are:
NULL
value is returned. These methods throw rdaTypeMismatch if the entry contains something other than an array of type X, or nothing.
NULL
value is returned. This methods throw rdaTypeMismatch if the entry contains something other than an array of type X, or nothing. Note that strings can also be extracted by pointer, see getString().
An rdaDataEntry object is used as a component of an rdaData object. The C++ implementation of the data entry object, unlike the Java implementation, does not support "independent" data entries. The life cycle of a data entry is fully managed by the rdaData object in which it is contained. Normally, you would rarely need to use the rdaDataEntry API directly: most of the rdaDataEntry methods can (and should) be invoked through the wrapper functions of the rdaData class.
|
Type codes for supported value types.
|
|
Prints contents of this data entry to the standard output. If the entry contains an array, at most maxElements of the array will be included in the printout.
|
|
Returns the boolean value stored in this rdaDataEntry object.
|
|
Returns a copy of the boolean array stored in this rdaDataEntry object.
|
|
Returns the byte value stored in this rdaDataEntry object.
|
|
Returns a copy of the byte array stored in this rdaDataEntry object.
|
|
Returns the double value stored in this rdaDataEntry object.
|
|
Returns a copy of the double array stored in this rdaDataEntry object.
|
|
Returns the float value stored in this rdaDataEntry object.
|
|
Returns a copy of the float array stored in this rdaDataEntry object.
|
|
Returns the integer value stored in this rdaDataEntry object.
|
|
Returns a copy of the integer array stored in this rdaDataEntry object.
|
|
Returns the longlong value stored in this rdaDataEntry object.
|
|
Returns a copy of the longlong array stored in this rdaDataEntry object.
|
|
Returns the short value stored in this rdaDataEntry object.
|
|
Returns a copy of the short array stored in this rdaDataEntry object.
|
|
Returns a copy of the string stored in this rdaDataEntry object. Caller must delete the returned string when finished with it.
|
|
Returns a deep copy of the string array stored in this rdaDataEntry object.
|
|
Returns a pointer to the boolean array stored in this rdaDataEntry object.
|
|
Returns a pointer to the byte array stored in this rdaDataEntry object.
|
|
Returns a pointer to the double array stored in this rdaDataEntry object.
|
|
Returns a pointer to the float array stored in this rdaDataEntry object.
|
|
Returns a pointer to the integer array stored in this rdaDataEntry object.
|
|
Returns a pointer to the longlong array stored in this rdaDataEntry object.
|
|
Returns a pointer to the short array stored in this rdaDataEntry object.
|
|
Returns a pointer to the string stored in this rdaDataEntry object. Caller must delete the returned string when finished with it.
|
|
Returns a pointer to the string array stored in this rdaDataEntry object.
|
|
Returns the data type name for the specified type code.
For array types, the basic type name is followed by "[]", for example, "Byte[]" for TYPE_BYTE_ARRAY. |
|
Inserts a string array value into this rdaDataEntry object. The method makes a deep copy of the value array, and stores it the data entry.
|
|
Inserts the speciifed string value into this rdaDataEntry object. The method makes a copy of the value string, and stores it in the data entry.
|
|
Inserts a double array value into this rdaDataEntry object.
|
|
Inserts a float array value into this rdaDataEntry object.
|
|
Inserts an long integer array value into this rdaDataEntry object.
|
|
Inserts an integer array value into this rdaDataEntry object.
|
|
Inserts a short array value into this rdaDataEntry object.
|
|
Inserts a byte array value into this rdaDataEntry object.
|
|
Inserts a boolean array value into this rdaDataEntry object.
|
|
Prints contents of this data entry to the standard output. If the entry contains an array value, at most maxElements of the array will be included in the printout. |
|
Prints contents of this data entry to the specified file. If the entry contains an array value, at most maxElements of the array will be included in the printout. |
|
Inserts a string array "by pointer" into this rdaDataEntry object. The method makes a deep copy of the value array, and stores it the data entry.
|
|
Inserts the speciifed string "by pointer" into this rdaDataEntry object. The method makes a copy of the value string, and stores it in the data entry.
|
|
Inserts a double array "by pointer" into this rdaDataEntry object.
|
|
Inserts a float array "by pointer" into this rdaDataEntry object.
|
|
Inserts an long integer array "by pointer" into this rdaDataEntry object.
|
|
Inserts an integer array "by pointer" into this rdaDataEntry object.
|
|
Inserts a short array "by pointer" into this rdaDataEntry object.
|
|
Inserts a byte array "by pointer" into this rdaDataEntry object.
|
|
Inserts a boolean array "by pointer" into this rdaDataEntry object.
|
|
Returns the tag that is assigned to this data entry in the rdaData object in which it is contained.
|