GlobalObjects
|
This class encodes or decodes data for transport in a TCP packet. More...
#include <GloDataStreamer.h>
Public Types | |
enum | ContainerType { eMAP , eLIST } |
Public Member Functions | |
DataStreamer () | |
virtual | ~DataStreamer () |
int | streamBlobInData (ClassInfo *&rpClassInfo, const eut::Blob &rBlob) |
int | streamBlobInData (ClassInfoAttribute::Type *&rpClassInfoAttributeType, const eut::Blob &rBlob) |
int | streamBlobInData (LimitRecord *&prLimitRecord, const eut::Blob &rBlob) |
int | streamBlobInData (Record *&rpRecord, const eut::Blob &rBlob, const std::map< unsigned long, ClassInfo * > &prClassInfoMap, unsigned long ulClassID=0) |
int | streamBlobInData (std::list< Record * > *&rpRecordList, const eut::Blob &rBlob, const std::map< unsigned long, ClassInfo * > &prClassInfoMap) |
int | streamBlobInData (std::map< ObjID, Record *, std::less< ObjID > > *&rpRecordMap, const eut::Blob &rBlob, const std::map< unsigned long, ClassInfo * > &prClassInfoMap) |
int | streamBlobInData (std::map< unsigned long, ClassInfo *, std::less< unsigned long > > *&prClassInfoMap, const eut::Blob &rBlob) |
int | streamBlobInData (std::vector< LimitRecord > *&prLimitRecordVector, const eut::Blob &rBlob) |
int | streamDataInBlob (eut::Blob &rBlob, const ClassInfo &rClassInfo) |
int | streamDataInBlob (eut::Blob &rBlob, const ClassInfoAttribute::Type &rClassInfoAttributeType) |
int | streamDataInBlob (eut::Blob &rBlob, const LimitRecord &rLimitRecord) |
int | streamDataInBlob (eut::Blob &rBlob, const Record &rRecord, std::map< ObjID, ObjID, std::less< ObjID > > &rReadyRecordMap) |
int | streamDataInBlob (eut::Blob &rBlob, const std::list< Record * > &rRecordList, std::map< ObjID, ObjID, std::less< ObjID > > &rReadyRecordMap) |
int | streamDataInBlob (eut::Blob &rBlob, const std::map< ObjID, Record *, std::less< ObjID > > &rRecordMap, std::map< ObjID, ObjID, std::less< ObjID > > &rReadyRecordMap) |
int | streamDataInBlob (eut::Blob &rBlob, const std::map< unsigned long, ClassInfo *, std::less< unsigned long > > &rClassInfoMap) |
int | streamDataInBlob (eut::Blob &rBlob, const std::vector< LimitRecord > &rLimitRecordVector) |
Private Member Functions | |
DataStreamer (const DataStreamer &) | |
int | getTagVariable (std::size_t &rnRetVal, const eut::Blob &rBlob, const std::string &rsTagVar) |
int | getTagVariable (std::string &rsRetVal, const eut::Blob &rBlob, const std::string &rsTagVar) |
DataStreamer & | operator= (const DataStreamer &) |
int | streamBlobAttributeInRecordAttribute (BaseRecordAttribute &rBaseRecordAttribute, const eut::Blob &rBlob, const std::string &rsFileInfo, unsigned int uiAttributeInformation, const std::map< unsigned long, ClassInfo * > &prClassInfoMap, std::map< ObjID, Record *, std::less< ObjID > > &rReadyRecordMap, unsigned long ulClassID=0) |
int | streamBlobAttributeListInClassInfo (ClassInfo &rClassInfo, const eut::Blob &rBlob) |
int | streamBlobAttributeListInRecord (Record &rRecord, const eut::Blob &rBlob, const std::map< unsigned long, ClassInfo * > &prClassInfoMap, std::map< ObjID, Record *, std::less< ObjID > > &rReadyRecordMap, unsigned long ulClassID=0) |
int | streamBlobInClassInfo (ClassInfo *&rpClassInfo, const eut::Blob &rBlob) |
int | streamBlobIndexItemsInClassInfoIndex (ClassInfoIndex &rClassInfoIndex, const eut::Blob &rBlob) |
int | streamBlobIndexListInClassInfo (ClassInfo &rClassInfo, const eut::Blob &rBlob) |
int | streamBlobInRecord (Record *&rpRecord, const eut::Blob &rBlob, const std::map< unsigned long, ClassInfo * > &prClassInfoMap, std::map< ObjID, Record *, std::less< ObjID > > &rReadyRecordMap, unsigned long ulClassID=0) |
int | streamBlobInRecordContainer (std::map< ObjID, Record *, std::less< ObjID > > *&rpRecordMap, std::list< Record * > *&rpRecordList, ContainerType eContainerType, const eut::Blob &rBlob, const std::map< unsigned long, ClassInfo * > &prClassInfoMap) |
int | streamBlobLimitRecordInLimitRecordAttribute (LimitRecord &rLimitRecord, const eut::Blob &rBlob) |
std::size_t | streamDataClassInfoAttributeInBlob (eut::Blob &rBlob, const ClassInfoAttribute &rAttribute) |
std::size_t | streamDataClassInfoInBlob (eut::Blob &rBlob, const ClassInfo &rClassInfo) |
std::size_t | streamDataClassInfoIndexAttributeInBlob (eut::Blob &rBlob, const ClassInfoIndex::IndexAttributeItem &rIndexAttributeInfo) |
std::size_t | streamDataClassInfoIndexInBlob (eut::Blob &rBlob, const ClassInfoIndex &rIndex) |
std::size_t | streamDataLimitRecordInBlob (eut::Blob &rBlob, const LimitRecord &rLimitRecord) |
template<typename T > | |
int | streamDataLotAttributeInBlob (eut::Blob &rAttributeValueBlob, T &rSet) |
std::size_t | streamDataRecordAttributeInBlob (eut::Blob &rBlob, BaseRecordAttribute &rAttribute, std::map< ObjID, ObjID, std::less< ObjID > > &rReadyRecordMap) |
std::size_t | streamDataRecordInBlob (eut::Blob &rBlob, const Record &rRecord, std::map< ObjID, ObjID, std::less< ObjID > > &rReadyRecordMap) |
Private Attributes | |
eut::CriticalSection | m_LocalCriticalSection |
This class encodes or decodes data for transport in a TCP packet.
This class was introduced in 2013, because the encoding performed so far did not allow to control the packet (e.g. it could not be printed). The XML format is used for most packets.
glo::DataStreamer::DataStreamer | ( | ) |
Standard constructor.
|
virtual |
Destructor.
|
private |
The copy constructor is not available.
|
private |
Returns the value of the passed TagVariable from the current position as a std::size_t. The original current position in the passed blob is reset to the original value; i.e., it is not changed.
If blob content...
...and the current position == 1 and TagVariable == 'p', then the return value is == 34.
[in,out] | rnRetVal | The value from the tag variable. |
[in] | rBlob | The blob to be evaluated as XML. |
[in] | rsTagVar | The tag variable. |
|
private |
Returns the value of the passed TagVariable from the current position as a string. The original current position in the passed blob is reset to the original value; i.e., it is not changed.
If blob content...
...and the current position == 1 and TagVariable == 'n', then the return value is == "OOMyClass.m_IsIt".
If blob content...
...and the current position == 10 and TagVariable == 'n', then the return value is == "Rest".
[in,out] | rsRetVal | The value from the tag variable. |
[in] | rBlob | The blob to be evaluated as XML. |
[in] | rsTagVar | The tag variable. |
|
private |
The assignment operator is not available.
|
private |
Fills a BaseRecordAttribute from the transferred eut::Blob.
Structure of the blob see here...
[in,out] | rBaseRecordAttribute | The BaseRecordAttribute to which the values from the blob are transferred. |
[in] | rBlob | The blob with the values of the record attribute as XML. |
[in] | rsFileInfo | If necessary a file name, so that additional data can be determined. |
[in] | uiAttributeInformation | Evaluated only if not 0 and the attribute is of type APointerRecordAttribute:
|
[in] | prClassInfoMap | The class information from which the structure of the data records emerges. |
[in] | rReadyRecordMap | The already streamed data records. |
[in] | ulClassID | If > 0, then the record is only filled with the data from the table of this class. |
|
private |
Fills the GloClassInfoAttributes in a passed ClassInfo from passed eut::Blob.
Structure of the blob see here...
[in,out] | rClassInfo | The class information, into which the data from the passed blob is copied. |
[in] | rBlob | The blob with the values of the ClassInfoAttribute as XML. |
|
private |
Fills a Record from the transferred eut::Blob.
Sample structure of the AttributBlob:
[in,out] | rRecord | The record to which the values from the blob are transferred. |
[in] | rBlob | The blob with the values of the Record as XML. |
[in] | prClassInfoMap | The class information from which the structure of the data records emerges. |
[in] | ulClassID | If > 0, then the record is only filled with the data from the table of this class. |
[in] | rReadyRecordMap | The already streamed data records. |
|
private |
Returns respectively fills a ClassInfo from the transferred eut::Blob.
Structure of the blob see here...
[in,out] | rpClassInfo | The class information to which the values from the blob are transferred. If nullptr is passed, a new class information is instantiated; the calling instance must then remove the object from memory. If a valid class information was passed, its values are set from the blob. |
[in] | rBlob | The blob with the values of the class information as XML. |
Returns respectively fills a ClassInfo from the transferred eut::Blob.
Structure of the blob see here....
[in,out] | rpClassInfo | The class information to which the values from the blob are transferred. If nullptr is passed, a new class information is instantiated; the calling instance must then remove the object from memory. If a valid class information was passed, its values are set from the blob. |
[in] | rBlob | The blob with the values of the class information as XML. |
int glo::DataStreamer::streamBlobInData | ( | ClassInfoAttribute::Type *& | rpClassInfoAttributeType, |
const eut::Blob & | rBlob ) |
Returns respectively fills a ClassInfoAttribute::Type from the transferred eut::Blob.
Structure of the blob see here...
[in,out] | rpClassInfoAttributeType | The ClassInfoAttribute::Type to which the values from the blob are transferred. if nullptr is passed, a new ClassInfoAttribute::Type is instantiated; the calling instance must then remove the object from memory. If a valid ClassInfoAttribute::Type was passed, its values are set from the blob. |
[in] | rBlob | The blob with the values of the ClassInfoAttribute::Type as XML. |
int glo::DataStreamer::streamBlobInData | ( | LimitRecord *& | prLimitRecord, |
const eut::Blob & | rBlob ) |
Returns respectively fills a LimitRecord from the transferred eut::Blob.
Structure of the blob see here...
[in,out] | prLimitRecord | The LimitRecord to which the values from the blob are transferred. If nullptr is passed, a new LimitRecord is instantiated; the calling instance must then remove the object from memory. If a valid LimitRecord was passed, its values are set from the blob. |
[in] | rBlob | The blob with the values of the LimitRecord as XML. |
int glo::DataStreamer::streamBlobInData | ( | Record *& | rpRecord, |
const eut::Blob & | rBlob, | ||
const std::map< unsigned long, ClassInfo * > & | prClassInfoMap, | ||
unsigned long | ulClassID = 0 ) |
Delivers respectively fills a Record from the transferred eut::Blob.
Structure of the blob see here....
[in,out] | rpRecord | The record to which the values from the blob are transferred. If nullptr is passed, a new record is instantiated; the calling instance must then remove the object from memory. If a valid record is passed, its attributes are set from the blob. |
[in] | rBlob | The blob with the values of the Record as XML. |
[in] | prClassInfoMap | The class information from which the structure of the data records emerges. |
[in] | ulClassID | If > 0, then the record is only filled with the data from the table of this class. |
int glo::DataStreamer::streamBlobInData | ( | std::list< Record * > *& | rpRecordList, |
const eut::Blob & | rBlob, | ||
const std::map< unsigned long, ClassInfo * > & | prClassInfoMap ) |
Returns respectively fills a std::list of GloRecords from the transferred eut::Blob.
Structure of the blob see here...
[in,out] | rpRecordList | The container into which the values from the blob are transferred. If "nullptr" is passed, a new container is instantiated; the calling instance must remove the object from memory. If a valid container is passed, the contents (if not already inside) from the blob are inserted without changing the original content of the container. |
[in] | rBlob | The blob with the values of the GloRecords as XML. |
[in] | prClassInfoMap | The class information from which the structure of the data records emerges. |
int glo::DataStreamer::streamBlobInData | ( | std::map< ObjID, Record *, std::less< ObjID > > *& | rpRecordMap, |
const eut::Blob & | rBlob, | ||
const std::map< unsigned long, ClassInfo * > & | prClassInfoMap ) |
Returns respectively fills a std::map of GloRecords from the transferred eut::Blob.
Structure of the blob see here...
[in,out] | rpRecordMap | The container into which the values from the blob are transferred. If "nullptr" is passed, a new container is instantiated; the calling instance must remove the object from memory. If a valid container is passed, the contents (if not already inside) from the blob are inserted without changing the original content of the container. |
[in] | rBlob | The blob with the values of the GloRecords as XML. |
[in] | prClassInfoMap | The class information from which the structure of the data records emerges. |
int glo::DataStreamer::streamBlobInData | ( | std::map< unsigned long, ClassInfo *, std::less< unsigned long > > *& | prClassInfoMap, |
const eut::Blob & | rBlob ) |
Returns respectively fills a std::map of GloClassInfos from the transferred eut::Blob.
Structure of the blob see here...
[in,out] | prClassInfoMap | The container into which the values from the blob are transferred. If "nullptr" is passed, a new container is instantiated; the calling instance must remove the object from memory. If a valid container is passed, the contents (if not already inside) from the blob are inserted without changing the original content of the container. |
[in] | rBlob | The blob with the values of the class information as XML. |
int glo::DataStreamer::streamBlobInData | ( | std::vector< LimitRecord > *& | prLimitRecordVector, |
const eut::Blob & | rBlob ) |
Returns respectively fills a std::vector of GloLimitRecords from the transferred eut::Blob.
Structure of the blob see here...
[in,out] | prLimitRecordVector | The container into which the values from the blob are transferred. If "nullptr" is passed, a new container is instantiated; the calling instance must remove the object from memory. If a valid container is passed, the contents (if not already inside) from the blob are inserted without changing the original content of the container. |
[in] | rBlob | The blob with the values of the GloLimitRecords as XML. |
|
private |
Fills the ClassInfoIndex::IndexAttributeItems in a passed ClassInfoIndex from passed eut::Blob.
Structure of the blob see here...
[in,out] | rClassInfoIndex | The ClassInfoIndex, into which the data from the passed blob is copied. |
[in] | rBlob | The blob with the values of the ClassInfoIndex::IndexAttributeItem as XML. |
|
private |
Fills the GloClassInfoIndexe in a passed ClassInfo from passed eut::Blob.
Structure of the blob see here...
[in,out] | rClassInfo | The class information, into which the data from the passed blob is copied. |
[in] | rBlob | The blob with the values of the ClassInfoIndex as XML. |
|
private |
Delivers respectively fills a Record from the transferred eut::Blob.
Structure of the blob see here...
[in,out] | rpRecord | The record to which the values from the blob are transferred. If nullptr is passed, a new record is instantiated; the calling instance must then remove the object from memory. If a valid record is passed, its attributes are set from the blob. |
[in] | rBlob | The blob with the values of the Record as XML. |
[in] | prClassInfoMap | The class information from which the structure of the data records emerges. |
[in] | rReadyRecordMap | The already streamed records; if the record to be streamed is already in these containers, then rpRecord is returned from this container with error ERR_RECORD_READY. |
[in] | ulClassID | If > 0, then the record is only filled with the data from the table of this class. |
|
private |
Returns respectively fills a std::map or std::list of GloRecords from passed eut::Blob depending on passed ContainerType.
Structure of the blob see here....
[in,out] | rpRecordMap | The container into which the values from the blob are transferred. If "nullptr" is passed, a new container is instantiated; the calling instance must remove the object from memory. If a valid container is passed, the contents (if not already inside) from the blob are inserted without changing the original content of the container. |
[in,out] | rpRecordList | See description of rpRecordMap. |
[in] | rBlob | The blob with the values of the record as XML. |
[in] | eContainerType | Specifies whether rpRecordMap or rpRecordList is taken into account as a parameter. |
[in] | prClassInfoMap | The class information from which the structure of the data records emerges. |
|
private |
Fills LimitRecord from the transferred eut::Blob.
Example structure (here with a comment):
[in,out] | rLimitRecord | The LimitRecord to which the values from the blob are transferred. |
[in] | rBlob | The blob with the values of the LimitRecord as XML. |
|
private |
Streams the values of the passed GloClassInfoAttributes as XML-string into a passed eut::Blob (without header etc.).
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rAttribute | The class information attribute whose values are to be appended to the passed eut::Blob as XML string. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
|
private |
Streams the values of the passed ClassInfo as XML-string into a passed eut::Blob (without header etc.)
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rClassInfo | The ClassInfo whose values are to be appended to the passed eut::Blob as XML string. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
|
private |
Streams the values of the passed ClassInfoIndex::IndexAttributeItem as XML-string into a passed eut::Blob (without header etc.).
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rIndexAttributeInfo | The class information index element whose values are to be appended to the passed eut::Blob as XML string. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
|
private |
Streams the values of the passed ClassInfoIndex as XML-string into a passed eut::Blob (without header etc.).
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rIndex | The class information index whose values are to be appended to the passed eut::Blob as XML string. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
Streams the values of the passed ClassInfo as XML-string into a passed eut::Blob, how it is sent.
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rClassInfo | The ClassInfo whose values are to be appended to the passed eut::Blob as XML string. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
int glo::DataStreamer::streamDataInBlob | ( | eut::Blob & | rBlob, |
const ClassInfoAttribute::Type & | rClassInfoAttributeType ) |
Streams the values of the passed ClassInfoAttribute::Type as XML-string into a passed eut::Blob how it is sent.
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rClassInfoAttributeType | The ClassInfoAttribute::Type whose values are to be appended to the passed eut::Blob as XML string. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
int glo::DataStreamer::streamDataInBlob | ( | eut::Blob & | rBlob, |
const LimitRecord & | rLimitRecord ) |
Streams the values of the passed LimitRecord as XML-string into a passed eut::Blob, how it is sent.
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rLimitRecord | The LimitRecord whose values are to be appended to the passed eut::Blob as XML string. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
int glo::DataStreamer::streamDataInBlob | ( | eut::Blob & | rBlob, |
const Record & | rRecord, | ||
std::map< ObjID, ObjID, std::less< ObjID > > & | rReadyRecordMap ) |
Streams the record attribute values of the passed Record as an XML string into a passed eut::Blob, how it is sent.
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rRecord | The data record whose attributes are to be appended to the passed eut::Blob as XML string. |
[in] | rReadyRecordMap | The already streamed data records must be passed, so that they are not streamed again completely, but only as object ID. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
int glo::DataStreamer::streamDataInBlob | ( | eut::Blob & | rBlob, |
const std::list< Record * > & | rRecordList, | ||
std::map< ObjID, ObjID, std::less< ObjID > > & | rReadyRecordMap ) |
Streams the record attribute values of the passed GloRecords in a std::list as XML-string into a passed eut::Blob, how it is sent.
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rRecordList | The records whose record attribute values are to be appended as an XML string to the passed eut::Blob. |
[in] | rReadyRecordMap | The already streamed data records must be passed, so that they are not streamed again completely, but only as object ID. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
int glo::DataStreamer::streamDataInBlob | ( | eut::Blob & | rBlob, |
const std::map< ObjID, Record *, std::less< ObjID > > & | rRecordMap, | ||
std::map< ObjID, ObjID, std::less< ObjID > > & | rReadyRecordMap ) |
Streams the record attribute values of the passed GloRecords in a std::map as XML-string into a passed eut::Blob, how it is sent.
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rRecordMap | The records whose record attribute values are to be appended as an XML string to the passed eut::Blob. |
[in] | rReadyRecordMap | The already streamed data records must be passed, so that they are not streamed again completely, but only as object ID. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
int glo::DataStreamer::streamDataInBlob | ( | eut::Blob & | rBlob, |
const std::map< unsigned long, ClassInfo *, std::less< unsigned long > > & | rClassInfoMap ) |
Streams the values of the passed GloClassInfos in a std::map as XML-string into a passed eut::Blob, how it is sent.
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rClassInfoMap | The GloClassInfos whose values are to be appended to the passed eut::Blob as XML string. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
int glo::DataStreamer::streamDataInBlob | ( | eut::Blob & | rBlob, |
const std::vector< LimitRecord > & | rLimitRecordVector ) |
Streams the values of the passed LimitRecord's in a std::vector as XML-string into a passed eut::Blob how it is sent
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rLimitRecordVector | The GloLimitRecords whose values are to be appended to the passed eut::Blob as XML string. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
|
private |
Streams the values of the passed LimitRecord as XML-string into a passed eut::Blob (without header etc.).
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rLimitRecord | The LimitRecord whose values are to be appended to the passed eut::Blob as XML string. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
|
private |
The individual values from a container are appended to an eut::Blob as XML string.
Example: The container has the two values "123456789012345" and "BabblingRhubarb". The XML string would then be...
[in,out] | rAttributeValueBlob | The blob to which the XML string is appended. |
[in] | rSet | The container with the individual values. |
|
private |
Streams the values of the passed BaseRecordAttribute as an XML-string into a passed eut::Blob (without headers etc.).4
Example structure (here with line break, indents and comments) for the individual attribute types:
After the "atr" tag the next variables have the following meaning:
</atr>'
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rAttribute | The data record attribute whose values are to be appended to the eut::Blob passed as XML string. |
[in] | rReadyRecordMap | The already streamed data records must be passed, so that they are not streamed again completely, but only as object ID. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
|
private |
Streams the record attribute values of the passed Record as XML-string into a passed eut::Blob (without header etc.).
Example structure (here with line break, indents and comments):
[in,out] | rBlob | The blob to which the XML string is appended. |
[in] | rRecord | The data record whose attributes are to be appended to the passed eut::Blob as XML string. |
[in] | rReadyRecordMap | The already streamed data records must be passed, so that they are not streamed again completely, but only as object ID. |
eut::ErrorNException | In case of an unrecoverable error an exception is thrown. |
|
private |
To ensure thread-safe access to the elements of the DataStreamer, access is synchronized via this local CriticalSection.