-
EbRecord is a class that allows one to retrieve and modify field
data in a record. It is also used to create a new record.
[
ebase_lib |
Source |
Keywords |
Summary | Ancestors | All Members | Descendants ]
- DESCRIPTION
Class Summary
class EbRecord
{
public:
- ~EbRecord();
- void * GetField(const char * fieldName);
- void * GetFieldAlloc(const char * fieldName);
- void * GetField(EbUint32 fieldId);
- void * GetFieldAlloc(EbUint32 fieldId);
- EbInt32 GetFieldInt32(const char *fieldName);
- EbInt32 GetFieldInt32(EbUint32 fieldId);
- const char * GetFieldString(const char *fieldName);
- void GetFieldStringCopy(const char * fieldName, char * buffer);
- char * GetFieldStringAlloc(const char *fieldName);
- const char * GetFieldString(EbUint32 fieldId);
- void GetFieldStringCopy(EbUint32, char * buffer);
- char * GetFieldStringAlloc(EbUint32 fieldId);
- EbUint32 FieldSize(const char *fieldName, EbUint32 option );
- EbUint32 FieldSize(EbUint32 fieldId, EbUint32 option );
- EbUint32 StringFieldSize(const char *fieldName);
- EbUint32 StringFieldSize(EbUint32 fieldId);
- void PutField(const char * fieldName, void * ptr);
- void PutFieldAlloc(const char * fieldName, void * ptr);
- void PutField(EbUint32 fieldId, void * ptr);
- void PutFieldAlloc(EbUint32 fieldId, void * ptr);
- void PutFieldInt32(const char *fieldName, EbInt32 number);
- void PutFieldInt32(EbUint32 fieldId, EbInt32 number);
- void PutFieldString(const char *fieldName, const char *string);
- void PutFieldStringAlloc(const char *fieldName, const char *string);
- void PutFieldString(EbUint32 fieldId, const char *string);
- void PutFieldStringAlloc(EbUint32 fieldId, const char *string);
- EbUint32 NumberOfFields();
- Ebase * GetEbase();
protected:
}; // EbRecord
Back to the top of EbRecord
DESCRIPTION
EbRecord class provides a bunch of "get field data" functions.
The caller must make sure the field data type matches
the appropriate function call. Otherwise exceptions will be
generated.
EbRecord class provides two flavors of GetField functions :
- The standard GetFeildxxx() will get a pointer to the data
inside the record (the caller does not own the data). The
will remina valid as long as the records are not freed.
- The GetFieldxxxAlloc() version wll allocate a new memory space
and make a copy of the data. The caller owns the copy.
For some specific data types, a thrid version of get field is provided,
GetFieldxxxCopy(). This version of get field fucntion will copy the data
into a pre-allocated buffer. One of such examples is the string data type.
Similarly, EbRecord class also provides two styles of PutField functions :
- The standard PutFieldxxx() version will let ebase take over the
ownership of the argument data. In other words, the caller will loose
the ownership of the data, and it should not try to free the data anymore.
This also implies the argument data must be allocated from heap.
- The PutFieldxxxAlloc() version will let ebase make a (deep) copy of
the data. The caller remains to be the owner of the argument data.
Both GetField and PutField functions can be classified into categories :
- The untyped GetField and PutField functions can be applied to
a field with any data type. The argument data type is a geneic void *
pointer.
- The typed GetField and PutField functions can only be applied to
the fields with matching data types. The data type which such a function
can be applied to is suggested in the function name. Mismatch in
data types will generate EBE_FIELD_TYPE_MISMATCH exception.
In each individual GetField and PutField function, the field can be
identified by either the field name or the field index.
In addition to GetField and PutField, EbRecord provides functions to
query about field size. For simple data which is represented by
a byte stream, the field size reflects the number of bytes used
to store the byte stream.
For complex data, an option flag is used when querying the field
size, which has a type-specific meaning.
Field size query functions can be classified into two categories :
typed and untyped. In both cases, the field can be identified by
either a field name or a field index.
Back to the top of EbRecord
~EbRecord();
Destructor.
Notice that there is no public constructor
for EbRecord becase application is not allowed to create a
new EbRecord object. Application can only obtain a pointer
to the EbRecord object through ebase.
~EbRecord();
Back to the top of EbRecord
void * GetField(const char * fieldName);
Generic (untyped) getfield by field name
void * GetField(const char * fieldName);
Back to the top of EbRecord
void * GetFieldAlloc(const char * fieldName);
Generic (untypeed) getfield by field name (alloc version)
void * GetFieldAlloc(const char * fieldName);
Back to the top of EbRecord
void * GetField(EbUint32 fieldId);
Generic (untyped) getfield by field index
void * GetField(EbUint32 fieldId);
Back to the top of EbRecord
void * GetFieldAlloc(EbUint32 fieldId);
Generic (untyped) getfield by field index (alloc version)
void * GetFieldAlloc(EbUint32 fieldId);
Back to the top of EbRecord
EbInt32 GetFieldInt32(const char *fieldName);
EbInt32 GetFieldInt32(const char *fieldName);
Back to the top of EbRecord
EbInt32 GetFieldInt32(EbUint32 fieldId);
EbInt32 GetFieldInt32(EbUint32 fieldId);
Back to the top of EbRecord
const char * GetFieldString(const char *fieldName);
const char * GetFieldString(const char *fieldName);
Back to the top of EbRecord
void GetFieldStringCopy(const char * fieldName, char * buffer);
void GetFieldStringCopy(const char * fieldName, char * buffer);
Back to the top of EbRecord
char * GetFieldStringAlloc(const char *fieldName);
char * GetFieldStringAlloc(const char *fieldName);
Back to the top of EbRecord
const char * GetFieldString(EbUint32 fieldId);
const char * GetFieldString(EbUint32 fieldId);
Back to the top of EbRecord
void GetFieldStringCopy(EbUint32, char * buffer);
void GetFieldStringCopy(EbUint32, char * buffer);
Back to the top of EbRecord
char * GetFieldStringAlloc(EbUint32 fieldId);
char * GetFieldStringAlloc(EbUint32 fieldId);
Back to the top of EbRecord
EbUint32 FieldSize(const char *fieldName, EbUint32 option );
Generic version of querying field size (by field name).
EbUint32 FieldSize(const char *fieldName, EbUint32 option=0);
Back to the top of EbRecord
EbUint32 FieldSize(EbUint32 fieldId, EbUint32 option );
Generic version of querying field size (by field index).
EbUint32 FieldSize(EbUint32 fieldId, EbUint32 option=0);
Back to the top of EbRecord
EbUint32 StringFieldSize(const char *fieldName);
EbUint32 StringFieldSize(const char *fieldName);
Back to the top of EbRecord
EbUint32 StringFieldSize(EbUint32 fieldId);
EbUint32 StringFieldSize(EbUint32 fieldId);
Back to the top of EbRecord
void PutField(const char * fieldName, void * ptr);
Generic PutField by field name.
void PutField(const char * fieldName, void * ptr);
Back to the top of EbRecord
void PutFieldAlloc(const char * fieldName, void * ptr);
Generic PutField by field name (alloc version).
void PutFieldAlloc(const char * fieldName, void * ptr);
Back to the top of EbRecord
void PutField(EbUint32 fieldId, void * ptr);
Generic PutField by field index.
void PutField(EbUint32 fieldId, void * ptr);
Back to the top of EbRecord
void PutFieldAlloc(EbUint32 fieldId, void * ptr);
Generic PutField by field index (alloc version).
void PutFieldAlloc(EbUint32 fieldId, void * ptr);
Back to the top of EbRecord
void PutFieldInt32(const char *fieldName, EbInt32 number);
void PutFieldInt32(const char *fieldName, EbInt32 number);
Back to the top of EbRecord
void PutFieldInt32(EbUint32 fieldId, EbInt32 number);
void PutFieldInt32(EbUint32 fieldId, EbInt32 number);
Back to the top of EbRecord
void PutFieldString(const char *fieldName, const char *string);
void PutFieldString(const char *fieldName, const char *string);
Back to the top of EbRecord
void PutFieldStringAlloc(const char *fieldName, const char *string);
void PutFieldStringAlloc(const char *fieldName, const char *string);
Back to the top of EbRecord
void PutFieldString(EbUint32 fieldId, const char *string);
void PutFieldString(EbUint32 fieldId, const char *string);
Back to the top of EbRecord
void PutFieldStringAlloc(EbUint32 fieldId, const char *string);
void PutFieldStringAlloc(EbUint32 fieldId, const char *string);
Back to the top of EbRecord
EbUint32 NumberOfFields();
Return the number of fields in the database.
EbUint32 NumberOfFields();
Back to the top of EbRecord
Ebase * GetEbase();
Return the pointer the database. Each record, no matter which state
it is in, must belong to some database.
Ebase * GetEbase();
Back to the top of EbRecord
All Members
- public:
- void * GetField(const char * fieldName);
- void * GetFieldAlloc(const char * fieldName);
- void * GetField(EbUint32 fieldId);
- void * GetFieldAlloc(EbUint32 fieldId);
- EbInt32 GetFieldInt32(const char *fieldName);
- EbInt32 GetFieldInt32(EbUint32 fieldId);
- const char * GetFieldString(const char *fieldName);
- void GetFieldStringCopy(const char * fieldName, char * buffer);
- char * GetFieldStringAlloc(const char *fieldName);
- const char * GetFieldString(EbUint32 fieldId);
- void GetFieldStringCopy(EbUint32, char * buffer);
- char * GetFieldStringAlloc(EbUint32 fieldId);
- EbUint32 FieldSize(const char *fieldName, EbUint32 option );
- EbUint32 FieldSize(EbUint32 fieldId, EbUint32 option );
- EbUint32 StringFieldSize(const char *fieldName);
- EbUint32 StringFieldSize(EbUint32 fieldId);
- void PutField(const char * fieldName, void * ptr);
- void PutFieldAlloc(const char * fieldName, void * ptr);
- void PutField(EbUint32 fieldId, void * ptr);
- void PutFieldAlloc(EbUint32 fieldId, void * ptr);
- void PutFieldInt32(const char *fieldName, EbInt32 number);
- void PutFieldInt32(EbUint32 fieldId, EbInt32 number);
- void PutFieldString(const char *fieldName, const char *string);
- void PutFieldStringAlloc(const char *fieldName, const char *string);
- void PutFieldString(EbUint32 fieldId, const char *string);
- void PutFieldStringAlloc(EbUint32 fieldId, const char *string);
- EbUint32 NumberOfFields();
- Ebase * GetEbase();
- protected:
Back to the top of EbRecord
Ancestors
Class does not inherit from any other class.
Back to the top of EbRecord
Descendants
Class is not inherited by any others.
Back to the top of EbRecord
Generated from source by the Cocoon utilities on Tue Aug 14 12:00:07 2001
.
Report problems to jkotula@vitalimages.com