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

#include <RecDef.hpp>

Inheritance diagram for RecDef:
SerialThis RecItem RecList UrcDB1protoDef UrcProtocol UrcClient UrcServer UrcDB1Client UrcDB1Server

Public Member Functions

 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)
 
virtual void serialize (OutputStream &ost) const
 
virtual void deserialize (InputStream &ist)
 
virtual void add_domain (const DomainDef &dmn)
 
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 Member Functions

 RecDef (RecDef *rdef)
 
 RecDef ()
 
void constructor (const char *rtname, const DomainAr &dmns)
 

Detailed Description

Record definition object.

Record is a structure of named fields. Each field has predefined label (called name), type and other properties such as dimension, category etc.

Constructor & Destructor Documentation

RecDef::RecDef ( const char *  rtname,
const DomainAr &  dmns 
)

Define record type exactly by pointing its name (may be ""), and number of domains

RecDef::RecDef ( const char *  rtname,
int  dmns_n,
const DomainDef dmns 
)

Define record type exactly by pointing its name (may be ""), and number of domains

RecDef::RecDef ( const RecDef rdef)

Create copy of the record type

RecDef::RecDef ( const char *  rtname,
const RecDef rdef1,
const RecDef rdef2 
)

Create composition of two record types. First one is a favorite one in case of resolving the same domain name conflicts.

RecDef::RecDef ( InputStream ist)

Acquire name and domains definition from an input stream

virtual RecDef::~RecDef ( )
virtual

Destroy the record definition

RecDef::RecDef ( RecDef rdef)
protected

Get the foreign pointer to domains definition

RecDef::RecDef ( )
protected

Create empty record with caller obligation to call constructor() just before first usage of class facilities

Member Function Documentation

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

Add one more domain if it's possible or throw ERROR__N_A

Reimplemented in RecList, and RecItem.

bool RecDef::check_domain ( const char *  dname) const

Check domain name existence.

bool RecDef::check_domain ( const char *  dname,
AtomType  atype,
unsigned  dim = 1 
) const

Check domain name existence with given type and dimension.

void RecDef::constructor ( const char *  rtname,
const DomainAr &  dmns 
)
protected

Provides the same functionality as the constructor with the same signature.

virtual void RecDef::deserialize ( InputStream ist)
virtual

Get the record definition from given stream

Reimplemented from SerialThis.

Reimplemented in RecList, and RecItem.

unsigned RecDef::domain_count ( ) const

Get number of domains

const DomainDef& RecDef::domain_def ( int  dmn_i) const

Navigate through the record domains via domain index

DomainDef* RecDef::domain_defs ( ) const

Allocate array of domain definitions via operator new.

int RecDef::n2i ( const char *  dname) const

Domain name to domain index in the record method

void* RecDef::offset ( int  dmn_i,
const void *  base 
) const

Return computed offset to record cell from the base address

bool RecDef::operator!= ( const RecDef rdef) const
inline

Return FALSE in case of two records are exactly equal (name,atype,dim,categ; record_name() may differ) and TRUE otherwise.

bool RecDef::operator== ( const RecDef rdef) const

Return TRUE in case of two records are exactly equal (name,atype,dim,categ; record_name() may differ) and FALSE otherwise.

const char* RecDef::record_name ( ) const

Get name of the record type or "" in anonymous

size_t RecDef::record_size ( ) const

Get record size in bytes

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

Put the record definition to given stream

Reimplemented from SerialThis.

Reimplemented in RecList, and RecItem.

void RecDef::set_options ( int  dmn_i,
void *  options 
)

Setup options for given domain


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