GlobalObjects
Lade ...
Suche ...
Keine Treffer
GloDataStreamer.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_GLODATASTREAMER_H
2#define INC_GLODATASTREAMER_H
3//-----------------------------------------------------------------------------
44//-----------------------------------------------------------------------------
45#include <vector>
46#include <map>
47#include <list>
48#include <set>
49#include <sstream>
50#include "GloTypes.h"
51#include "EuBlob.h"
52#include "GloClassInfoIndex.h"
54#include "GloLockManager.h"
55#if defined (__PTHREADS)
56 #include <EuPCriticalSection.h>
57#else
58 #include "EuCriticalSection.h"
59#endif
60//-----------------------------------------------------------------------------
61/* Forwards */
62namespace eut
63{
64 class Blob;
65}
66//-----------------------------------------------------------------------------
67namespace glo
68{
69 class Record;
70 class ObjID;
71 class LimitRecord;
72 class BaseRecordAttribute;
73 //---------------------------------------------------------------------------
96 {
97 public:
98 //============== Enums
99 //-----------------------------------------------------------------------
110 {
111 eMAP,
120 eLIST
129 };
130 //-----------------------------------------------------------------------
131
132 private:
133 //============== Attribute
134 //-----------------------------------------------------------------------
147 #if defined (__PTHREADS)
148 EuPCriticalSection m_LocalCriticalSection;
149 #else
151 #endif
152 //-----------------------------------------------------------------------
153
154 public:
155 //============== De- und Konstruktor
156 //-----------------------------------------------------------------------
167 //-----------------------------------------------------------------------
177 virtual ~DataStreamer();
178 //-----------------------------------------------------------------------
179
180 private:
181 //============== Copy-Konstruktor
182 //-----------------------------------------------------------------------
193 //-----------------------------------------------------------------------
194
195 public:
196 //============== Methoden
197 //-----------------------------------------------------------------------
329 const Record & rRecord,
330 std::map< ObjID, ObjID, std::less<ObjID> > & rReadyRecordMap );
331 //-----------------------------------------------------------------------
474 const std::map< ObjID, Record *, std::less<ObjID> > & rRecordMap,
475 std::map< ObjID, ObjID, std::less<ObjID> > & rReadyRecordMap );
476 //-----------------------------------------------------------------------
619 const std::list< Record * > & rRecordList,
620 std::map< ObjID, ObjID, std::less<ObjID> > & rReadyRecordMap );
621 //-----------------------------------------------------------------------
704 int streamDataInBlob( eut::Blob & rBlob, const ClassInfo & rClassInfo );
705 //-----------------------------------------------------------------------
797 const std::map< unsigned long, ClassInfo *, std::less<unsigned long> > & rClassInfoMap );
798 //-----------------------------------------------------------------------
845 int streamDataInBlob( eut::Blob & rBlob, const LimitRecord & rLimitRecord );
846 //-----------------------------------------------------------------------
902 const std::vector< LimitRecord > & rLimitRecordVector );
903 //-----------------------------------------------------------------------
951 const ClassInfoAttribute::Type & rClassInfoAttributeType );
952 //-----------------------------------------------------------------------
953
954 private:
955 //============== InBlob-RecordHelper-Methoden
956 //-----------------------------------------------------------------------
1082 std::size_t streamDataRecordInBlob( eut::Blob & rBlob,
1083 const Record & rRecord,
1084 std::map< ObjID, ObjID, std::less<ObjID> > & rReadyRecordMap );
1085 //-----------------------------------------------------------------------
1364 BaseRecordAttribute & rAttribute,
1365 std::map< ObjID, ObjID, std::less<ObjID> > & rReadyRecordMap );
1366 //-----------------------------------------------------------------------
1411 template<typename T> int streamDataLotAttributeInBlob( eut::Blob & rAttributeValueBlob, T & rSet );
1412 //-----------------------------------------------------------------------
1413
1414 //============== InBlob-ClassInfoHelper-Methoden
1415 //-----------------------------------------------------------------------
1493 const ClassInfo & rClassInfo );
1494 //-----------------------------------------------------------------------
1542 const ClassInfoAttribute & rAttribute );
1543 //-----------------------------------------------------------------------
1591 const ClassInfoIndex & rIndex );
1592 //-----------------------------------------------------------------------
1634 const ClassInfoIndex::IndexAttributeItem & rIndexAttributeInfo );
1635 //-----------------------------------------------------------------------
1636
1637 //============== InBlob-LimitRecordHelper-Methoden
1638 //-----------------------------------------------------------------------
1678 const LimitRecord & rLimitRecord );
1679 //-----------------------------------------------------------------------
1680
1681 public:
1682 //============== OutBlob-Methoden
1683 //-----------------------------------------------------------------------
1726 int streamBlobInData( Record *& rpRecord,
1727 const eut::Blob & rBlob,
1728 const std::map< unsigned long, ClassInfo * > & prClassInfoMap,
1729 unsigned long ulClassID = 0 );
1730 //-----------------------------------------------------------------------
1773 int streamBlobInData( std::map< ObjID, Record *, std::less<ObjID> > *& rpRecordMap,
1774 const eut::Blob & rBlob,
1775 const std::map< unsigned long, ClassInfo * > & prClassInfoMap);
1776 //-----------------------------------------------------------------------
1819 int streamBlobInData( std::list<Record *> *& rpRecordList,
1820 const eut::Blob & rBlob,
1821 const std::map< unsigned long, ClassInfo * > & prClassInfoMap );
1822 //-----------------------------------------------------------------------
1859 int streamBlobInData( ClassInfo *& rpClassInfo, const eut::Blob & rBlob );
1860 //-----------------------------------------------------------------------
1900 int streamBlobInData( std::map< unsigned long, ClassInfo *, std::less<unsigned long> > *& prClassInfoMap,
1901 const eut::Blob & rBlob );
1902 //-----------------------------------------------------------------------
1939 int streamBlobInData( LimitRecord *& prLimitRecord, const eut::Blob & rBlob );
1940 //-----------------------------------------------------------------------
1980 int streamBlobInData( std::vector< LimitRecord > *& prLimitRecordVector,
1981 const eut::Blob & rBlob );
1982 //-----------------------------------------------------------------------
2024 int streamBlobInData( ClassInfoAttribute::Type *& rpClassInfoAttributeType,
2025 const eut::Blob & rBlob );
2026 //-----------------------------------------------------------------------
2027
2028 private:
2029 //============== OutBlob-RecordHelper-Methoden
2030 //-----------------------------------------------------------------------
2079 int streamBlobInRecord( Record *& rpRecord,
2080 const eut::Blob & rBlob,
2081 const std::map< unsigned long, ClassInfo * > & prClassInfoMap,
2082 std::map< ObjID, Record *, std::less<ObjID> > & rReadyRecordMap,
2083 unsigned long ulClassID = 0 );
2084 //-----------------------------------------------------------------------
2135 int streamBlobInRecordContainer( std::map< ObjID, Record *, std::less<ObjID> > *& rpRecordMap,
2136 std::list<Record *> *& rpRecordList,
2137 ContainerType eContainerType,
2138 const eut::Blob & rBlob,
2139 const std::map< unsigned long, ClassInfo * > & prClassInfoMap );
2140 //-----------------------------------------------------------------------
2141
2142 //============== OutBlob-ClassInfoHelper-Methoden
2143 //-----------------------------------------------------------------------
2180 int streamBlobInClassInfo( ClassInfo *& rpClassInfo, const eut::Blob & rBlob );
2181 //-----------------------------------------------------------------------
2182
2183 //============== OutBlob-RecordAttributeHelper-Methoden
2184 //-----------------------------------------------------------------------
2268 const eut::Blob & rBlob,
2269 const std::map< unsigned long, ClassInfo * > & prClassInfoMap,
2270 std::map< ObjID, Record *, std::less<ObjID> > & rReadyRecordMap,
2271 unsigned long ulClassID = 0 );
2272 //-----------------------------------------------------------------------
2324 const eut::Blob & rBlob,
2325 const std::string & rsFileInfo,
2326 unsigned int uiAttributeInformation,
2327 const std::map< unsigned long, ClassInfo * > & prClassInfoMap,
2328 std::map< ObjID, Record *, std::less<ObjID> > & rReadyRecordMap,
2329 unsigned long ulClassID = 0 );
2330 //-----------------------------------------------------------------------
2331
2332 //============== OutBlob-ClassInfoHelper-Methoden
2333 //-----------------------------------------------------------------------
2361 const eut::Blob & rBlob );
2362 //-----------------------------------------------------------------------
2389 const eut::Blob & rBlob );
2390 //-----------------------------------------------------------------------
2419 const eut::Blob & rBlob );
2420 //-----------------------------------------------------------------------
2421
2422 //============== OutBlob-LimitRecordHelper-Methoden
2423 //-----------------------------------------------------------------------
2458 const eut::Blob & rBlob );
2459 //-----------------------------------------------------------------------
2460
2461 //============== DataStreamer Helper-Methoden
2462 //-----------------------------------------------------------------------
2515 int getTagVariable( std::string & rsRetVal,
2516 const eut::Blob & rBlob,
2517 const std::string & rsTagVar );
2518 //-----------------------------------------------------------------------
2557 int getTagVariable( std::size_t & rnRetVal,
2558 const eut::Blob & rBlob,
2559 const std::string & rsTagVar );
2560 //-----------------------------------------------------------------------
2561
2562 //============== Operatoren
2563 //-----------------------------------------------------------------------
2573 DataStreamer & operator= ( const DataStreamer & );
2574 //-----------------------------------------------------------------------
2575 };
2576 //---------------------------------------------------------------------------
2577 template<typename T> int DataStreamer::streamDataLotAttributeInBlob( eut::Blob & rAttributeValueBlob, T & rSet )
2578 {
2579 int t_iErr = 0;
2580 typename T::const_iterator t_Iter;
2581 std::ostringstream t_ossIterConverter,
2582 t_ossSizeConverter;
2583
2584 for ( t_Iter = rSet.begin();
2585 t_Iter != rSet.end();
2586 ++ t_Iter )
2587 {
2588 t_ossIterConverter.str("");
2589 t_ossSizeConverter.str("");
2590 t_ossIterConverter << (*t_Iter);
2591 t_iErr = rAttributeValueBlob.append( "<e l=\"", 6 );
2592 t_ossSizeConverter << t_ossIterConverter.str().size();
2593 if ( ! t_iErr ) t_iErr = rAttributeValueBlob.append( t_ossSizeConverter.str().c_str(),
2594 t_ossSizeConverter.str().size() );
2595 if ( ! t_iErr ) t_iErr = rAttributeValueBlob.append( "\">", 2 );
2596 if ( ! t_iErr ) t_iErr = rAttributeValueBlob.append( t_ossIterConverter.str().c_str(), t_ossIterConverter.str().size() );
2597 if ( ! t_iErr ) t_iErr = rAttributeValueBlob.append( "</e>", 4 );
2598 if ( t_iErr ) break;
2599 }
2600 return t_iErr;
2601 }
2602 //---------------------------------------------------------------------------
2603} // namespace glo
2604#endif
Header für Blob
Header für CriticalSection
Header für EuPCriticalSection
Header für ClassInfoAttribute und ClassInfoAttribute::Type
Header für ClassInfoIndex und ClassInfoIndex::IndexAttributeItem
Header für LockManager LockManager::LockedObject LockManager::LockedObject::CommunicatorRightsRes...
Für jede Bibliothek, hier 'GlobalObjects' gibt es eine Typen-Datei.
#define __glo_export_dll
Definition GloTypes.h:70
Ist ein Mutex, welcher über sein Lock-Modus abgefragt werden kann. Siehe isLocked().
Definition EuPCriticalSection.h:104
Diese Klasse erlaubt das Bearbeiten eines Blobs (einfügen, kopieren, durchsuchen etc....
Definition EuBlob.h:75
int append(const char *pBuffer, std::size_t nBufferSize)
Ist ein Mutex, welcher über sein Lock-Modus abgefragt werden kann. Siehe isLocked().
Definition EuCriticalSection.h:109
Basisklasse für die einzelnen Attribute eines Record.
Definition GloBaseRecordAttribute.h:116
Zusammengefasste Typinformationen für ein ClassInfoAttribute.
Definition GloClassInfoAttribute.h:108
In Objekten dieser Klasse sind die Information für GlobalObjects, wie ein persistentes Klassenattribu...
Definition GloClassInfoAttribute.h:83
Diese Klasse beinhaltet alle Informationen um Objekte einer Klasse in einer Datenbank speichern zu kö...
Definition GloClassInfo.h:86
Information für den Index aus welcher Klasse welches Attribut mit wie viel Zeichen zum Index gehört.
Definition GloClassInfoIndex.h:111
In Objekten dieser Klasse sind die Information für GlobalObjects, wie ein Index aufgebaut ist.
Definition GloClassInfoIndex.h:85
Diese Klasse kodiert bzw. dekodiert Daten für den Transport in einem TCP-Paket.
Definition GloDataStreamer.h:96
int streamBlobInData(std::map< ObjID, Record *, std::less< ObjID > > *&rpRecordMap, const eut::Blob &rBlob, const std::map< unsigned long, ClassInfo * > &prClassInfoMap)
eut::CriticalSection m_LocalCriticalSection
Definition GloDataStreamer.h:150
std::size_t streamDataLimitRecordInBlob(eut::Blob &rBlob, const LimitRecord &rLimitRecord)
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 ClassInfo &rClassInfo)
std::size_t streamDataClassInfoInBlob(eut::Blob &rBlob, const ClassInfo &rClassInfo)
int streamBlobInData(ClassInfoAttribute::Type *&rpClassInfoAttributeType, const eut::Blob &rBlob)
int streamDataInBlob(eut::Blob &rBlob, const std::map< unsigned long, ClassInfo *, std::less< unsigned long > > &rClassInfoMap)
int streamBlobInClassInfo(ClassInfo *&rpClassInfo, const eut::Blob &rBlob)
int streamBlobInData(std::vector< LimitRecord > *&prLimitRecordVector, const eut::Blob &rBlob)
int streamDataInBlob(eut::Blob &rBlob, const LimitRecord &rLimitRecord)
int streamDataInBlob(eut::Blob &rBlob, const std::vector< LimitRecord > &rLimitRecordVector)
int getTagVariable(std::size_t &rnRetVal, const eut::Blob &rBlob, const std::string &rsTagVar)
int streamDataInBlob(eut::Blob &rBlob, const Record &rRecord, std::map< ObjID, ObjID, std::less< ObjID > > &rReadyRecordMap)
int streamBlobIndexItemsInClassInfoIndex(ClassInfoIndex &rClassInfoIndex, const eut::Blob &rBlob)
std::size_t streamDataClassInfoIndexAttributeInBlob(eut::Blob &rBlob, const ClassInfoIndex::IndexAttributeItem &rIndexAttributeInfo)
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)
std::size_t streamDataClassInfoAttributeInBlob(eut::Blob &rBlob, const ClassInfoAttribute &rAttribute)
int streamBlobLimitRecordInLimitRecordAttribute(LimitRecord &rLimitRecord, const eut::Blob &rBlob)
DataStreamer(const DataStreamer &)
int streamBlobInData(std::map< unsigned long, ClassInfo *, std::less< unsigned long > > *&prClassInfoMap, const eut::Blob &rBlob)
int streamBlobInData(LimitRecord *&prLimitRecord, const eut::Blob &rBlob)
int streamDataInBlob(eut::Blob &rBlob, const ClassInfoAttribute::Type &rClassInfoAttributeType)
std::size_t streamDataRecordInBlob(eut::Blob &rBlob, const Record &rRecord, std::map< ObjID, ObjID, std::less< ObjID > > &rReadyRecordMap)
std::size_t streamDataClassInfoIndexInBlob(eut::Blob &rBlob, const ClassInfoIndex &rIndex)
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 streamBlobAttributeListInClassInfo(ClassInfo &rClassInfo, const eut::Blob &rBlob)
std::size_t streamDataRecordAttributeInBlob(eut::Blob &rBlob, BaseRecordAttribute &rAttribute, 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 streamDataLotAttributeInBlob(eut::Blob &rAttributeValueBlob, T &rSet)
Definition GloDataStreamer.h:2577
int streamBlobInData(std::list< Record * > *&rpRecordList, const eut::Blob &rBlob, const std::map< unsigned long, ClassInfo * > &prClassInfoMap)
virtual ~DataStreamer()
int getTagVariable(std::string &rsRetVal, const eut::Blob &rBlob, const std::string &rsTagVar)
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 streamBlobIndexListInClassInfo(ClassInfo &rClassInfo, const eut::Blob &rBlob)
ContainerType
Definition GloDataStreamer.h:110
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 streamBlobInData(ClassInfo *&rpClassInfo, const eut::Blob &rBlob)
int streamBlobInData(Record *&rpRecord, const eut::Blob &rBlob, const std::map< unsigned long, ClassInfo * > &prClassInfoMap, unsigned long ulClassID=0)
In Objekten dieser Klasse werden die Min- und Max-Werte von unterstützten Datentypen und deren Feldlä...
Definition GloLimitRecord.h:71
Ein Objekt-ID besteht aus der Klassen-ID, einer Datenbank-ID und der eigentlichen eindeutigen ObjektZ...
Definition GloObjID.h:84
Objekte dieser Klasse transportieren die Daten von den Tabellen ins persistente Objekt und von diesen...
Definition GloRecord.h:108
Definition IniFile.h:62
Definition GloAbstractBaseLot.h:49