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

Public Member Functions

 RecList (const RecDef &rdef, unsigned quant=DEFAULT_QUANT, unsigned volume=START_VOLUME)
 
 RecList (const RecList &r)
 
 RecList (InputStream &ist)
 
virtual ~RecList ()
 
RecListoperator= (const RecList &r)
 
virtual int count () const
 
virtual AnyValuevalue (int dmn_i, int row_i)
 
AnyValuevalue (const char *dname, int row_i)
 
virtual const AnyValueget_value (int dmn_i, int row_i) const
 
const AnyValueget_value (const char *dname, int row_i) const
 
virtual void get_value (int dmn_i, int row_i, AnyValue &av) const
 
void get_value (const char *dname, int row_i, AnyValue &av) const
 
virtual void set_value (int dmn_i, int row_i, const AnyValue &av)
 
void set_value (const char *dname, int row_i, const AnyValue &av)
 
virtual RecItemitem (int row_i)
 
virtual void get_item (int row_i, RecItem &rec) const
 
virtual void attach_item (int row_i, RecItem &rec) const
 
virtual void add_record (int rows=1)
 
virtual void add_item (const RecItem &recit)
 
virtual void add_list (const RecList &reclist)
 
virtual void insert_record (int at_row_i, int rows=1)
 
virtual void insert_item (int at_row_i, const RecItem &recit)
 
virtual void insert_list (int at_row_i, const RecList &reclist)
 
virtual void remove_record (int at_row_i, int rows=1)
 
virtual void clean ()
 
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:

  • +0 Number of domains (4 byte integer) = N
  • +4 Domain definitions (40 bytes for each domain)
  • +4+40*N Format (AtomType) of cell with number of rows (2 bytes)
  • +6+40*N Number of rows (B bytes)
  • +6+40*N+B Extended information size (4 byte integer) = E
  • +10+40*N+B Extended information
  • +10+40*N+B+E Record list data by rows 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

DynArdatar
 
RecItemcur_item
 
AnyValue ** av
 

Additional Inherited Members

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

Constructor & Destructor Documentation

RecList::RecList ( const RecDef rdef,
unsigned  quant = DEFAULT_QUANT,
unsigned  volume = START_VOLUME 
)

Create new record list with zero number of items.

RecList::RecList ( const RecList r)

Create the copy of some record list

RecList::RecList ( InputStream ist)

Create list of records from the input stream

virtual RecList::~RecList ( )
virtual

Destroy the object

Member Function Documentation

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

Add one more domain to the record list. New column is not initialized at all (garbage bits).

Reimplemented from RecDef.

virtual void RecList::add_item ( const RecItem recit)
virtual

Append the list with new record.

virtual void RecList::add_list ( const RecList reclist)
virtual

Append the list with new records.

virtual void RecList::add_record ( int  rows = 1)
virtual

Append the list with new empty (zero bytes) record(s).

virtual void RecList::attach_item ( int  row_i,
RecItem rec 
) const
virtual

Attach item object to given record addressed by row_i. Very dangerous due to possible illegal use later, when list of records is changed (MT_Safe).

virtual void RecList::clean ( )
virtual

Remove all records

virtual int RecList::count ( ) const
virtual

Return number of records in the list

virtual void RecList::deserialize ( InputStream ist)
virtual

Deserialize (internalize) the record data from given input stream with record definition.

Reimplemented from RecDef.

virtual void RecList::get_item ( int  row_i,
RecItem rec 
) const
virtual

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

virtual const AnyValue& RecList::get_value ( int  dmn_i,
int  row_i 
) const
virtual

Get value quickly but in multithread unsafe manner (MT_Unsafe). Don't use twice in the same expression or argument list (for the same object) due to side effects!

const AnyValue & RecList::get_value ( const char *  dname,
int  row_i 
) const
inline

Call the get_value(n2i(dname), row_i)

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

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

void RecList::get_value ( const char *  dname,
int  row_i,
AnyValue av 
) const
inline

Call the get_value(n2i(dname), row_i, av)

virtual void RecList::insert_item ( int  at_row_i,
const RecItem recit 
)
virtual

Insert new record to the list at given position.

virtual void RecList::insert_list ( int  at_row_i,
const RecList reclist 
)
virtual

Insert new records to the list at given position.

virtual void RecList::insert_record ( int  at_row_i,
int  rows = 1 
)
virtual

Insert new empty record(s) to the list at given position.

virtual RecItem& RecList::item ( int  row_i)
virtual

Get access to the whole record item in multithread unsafe manner (MT_Unsafe). Don't use twice in the same expression or argument list (for the same object) due to side effects!

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

Assign new record list contents to this record list.

virtual void RecList::remove_record ( int  at_row_i,
int  rows = 1 
)
virtual

Remove record(s) of the list at given position.

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

Serialize (externalize) the record data to given output stream with record definition.

Reimplemented from RecDef.

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

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

void RecList::set_value ( const char *  dname,
int  row_i,
const AnyValue av 
)
inline

Call the set_value(n2i(dname), row_i, av)

virtual AnyValue& RecList::value ( int  dmn_i,
int  row_i 
)
virtual

Get access to given cell value quickly but in multithread unsafe manner (MT_Unsafe). Don't use twice in the same expression or argument list (for the same object) due to side effects!

Member Data Documentation

AnyValue** RecList::av
protected

Vector of values for each domain of record

RecItem* RecList::cur_item
protected

Pointer to currently attached record item or NULL in case of empty list or no item() calls.

DynAr* RecList::datar
protected

Data container for record list


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