UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Attributes | Friends | List of all members
RecItem Class Reference
Inheritance diagram for RecItem:
RecDef SerialThis UrcProtocol UrcClient UrcServer UrcDB1Client UrcDB1Server

Public Member Functions

 RecItem (const RecDef &rdef)
 
 RecItem (const RecItem &r)
 
 RecItem (InputStream &ist)
 
 RecItem (RecDef *prdef, void *recdata)
 
void attach (void *recdata)
 
virtual ~RecItem ()
 
RecItemoperator= (const RecItem &r)
 
virtual AnyValuevalue (int dmn_i)
 
AnyValuevalue (const char *dname)
 
virtual const AnyValueget_value (int dmn_i) const
 
const AnyValueget_value (const char *dname) const
 
virtual void get_value (int dmn_i, AnyValue &av) const
 
void get_value (const char *dname, AnyValue &av) const
 
virtual void set_value (int dmn_i, const AnyValue &av)
 
void set_value (const char *dname, const AnyValue &av)
 
virtual void set_row_data (const void *row_data)
 
virtual void * get_row_data () const
 
virtual void copy_row_data (const RecDef &rdef, void *row_data) const
 
virtual void add_domain (const DomainDef &dmn)
 
Serialization facilities

Serialization/deserialization is performed with record definition in case of own memory buffer is used or without it in case of link to alien memory buffer location.

Serial format (included record definition):

  • +0 Number of domains (4 byte integer) = N
  • +4 Domain definitions (40 bytes for each domain)
  • +4+40*N Extended information size (4 byte integer) = E
  • +8+40*N Extended information
  • +8+40*N+E Record data in order of domains

Serial format (without record definition):

  • +0 Extended information size (4 byte integer) = E
  • +4 Extended information
  • +4+E Record data in order of domains
virtual void serialize (OutputStream &ost) const
 
virtual void deserialize (InputStream &ist)
 
- Public Member Functions inherited from RecDef
 RecDef (const char *rtname, const DomainAr &dmns)
 
 RecDef (const char *rtname, int dmns_n, const DomainDef *dmns)
 
 RecDef (const RecDef &rdef)
 
 RecDef (const char *rtname, const RecDef &rdef1, const RecDef &rdef2)
 
 RecDef (InputStream &ist)
 
virtual ~RecDef ()
 
const char * record_name () const
 
size_t record_size () const
 
unsigned domain_count () const
 
int n2i (const char *dname) const
 
void * offset (int dmn_i, const void *base) const
 
const DomainDefdomain_def (int dmn_i) const
 
DomainDefdomain_defs () const
 
void set_options (int dmn_i, void *options)
 
bool operator== (const RecDef &rdef) const
 
bool operator!= (const RecDef &rdef) const
 
bool check_domain (const char *dname) const
 
bool check_domain (const char *dname, AtomType atype, unsigned dim=1) const
 
- Public Member Functions inherited from SerialThis
 SerialThis ()
 
 SerialThis (InputStream &ist)
 

Protected Attributes

bool own_memory
 
void * ptr_rec
 
AnyValue ** av
 

Friends

class RecList
 

Additional Inherited Members

- Protected Member Functions inherited from RecDef
 RecDef (RecDef *rdef)
 
 RecDef ()
 
void constructor (const char *rtname, const DomainAr &dmns)
 

Constructor & Destructor Documentation

RecItem::RecItem ( const RecDef rdef)

Create new record with empty contents (see AnyValue::empty_value() for each cell initialization)

RecItem::RecItem ( const RecItem r)

Create the copy of some record item

RecItem::RecItem ( InputStream ist)

Create record item from the input stream

RecItem::RecItem ( RecDef prdef,
void *  recdata 
)

Create record object which is attached to some record definition and some data location. BE CAREFUL!!!

virtual RecItem::~RecItem ( )
virtual

Destroy the object

Member Function Documentation

virtual void RecItem::add_domain ( const DomainDef dmn)
virtual

Add one more domain to record item. New cell became empty (initialized by default).

Reimplemented from RecDef.

virtual void RecItem::copy_row_data ( const RecDef rdef,
void *  row_data 
) const
virtual

Copy to given record set structure (MT_Safe). Type cast is not supported! Only exactly matched domains will be copied.

virtual void RecItem::deserialize ( InputStream ist)
virtual

Deserialize (internalize) the record data from given input stream with (own_memory==TRUE) or without (own_memory==FALSE) record definition.

Reimplemented from RecDef.

virtual void* RecItem::get_row_data ( ) const
virtual

Get (dynamically allocated by malloc) the whole item contents for UdbData::row_data (MT_Safe).

virtual const AnyValue& RecItem::get_value ( int  dmn_i) const
virtual

Get value quickly but in multithread unsafe manner (MT_Unsafe).

const AnyValue & RecItem::get_value ( const char *  dname) const
inline

Call the get_value(n2i(dname))

virtual void RecItem::get_value ( int  dmn_i,
AnyValue av 
) const
virtual

Get value of given domain cell in multithread safe manner (MT_Safe).

void RecItem::get_value ( const char *  dname,
AnyValue av 
) const
inline

Call the get_value(n2i(dname), av)

RecItem& RecItem::operator= ( const RecItem r)

Assign new record contents to this record. Assignment is available for the same structure records only.

virtual void RecItem::serialize ( OutputStream ost) const
virtual

Serialize (externalize) the record data to given output stream with (own_memory==TRUE) or without (own_memory==FALSE) record definition.

Reimplemented from RecDef.

virtual void RecItem::set_row_data ( const void *  row_data)
virtual

Set the whole item contents from UdbData::row_data without test for record compatibility (MT_Safe).

virtual void RecItem::set_value ( int  dmn_i,
const AnyValue av 
)
virtual

Set value of given domain cell in multithread safe manner (MT_Safe).

void RecItem::set_value ( const char *  dname,
const AnyValue av 
)
inline

Call the set_value(n2i(dname), av)

virtual AnyValue& RecItem::value ( int  dmn_i)
virtual

Get access to a domain value quickly but in multithread unsafe manner (MT_Unsafe).

Member Data Documentation

AnyValue** RecItem::av
protected

Array of values, attached to record data.

bool RecItem::own_memory
protected

TRUE to delete rec_name and domains in destructor

void* RecItem::ptr_rec
protected

Pointer to record's data


The documentation for this class was generated from the following file: