GlobalObjects
Lade ...
Suche ...
Keine Treffer
GloRecord.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_GLORECORD_H
2#define INC_GLORECORD_H
3//-----------------------------------------------------------------------------
36//-----------------------------------------------------------------------------
37#include <map>
38#include <set>
39#include <memory>
40#include <unordered_set>
41#if defined (__PTHREADS)
42 #include <EuPCriticalSection.h>
43#else
44 #include "EuCriticalSection.h"
45#endif
46#include "GloTypes.h"
47#include "GloObjID.h"
48#include "GloClassInfoIndex.h"
49//-----------------------------------------------------------------------------
50namespace glo
51{
52 //---------------------------------------------------------------------------
53 // Forwards
54 class ClassInfoIndex;
55 class ObjIDRecordAttribute;
56 //---------------------------------------------------------------------------
57 #ifdef _MSC_VER
58 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
59 #pragma warning( disable : 4251 )
60 #endif
61 //---------------------------------------------------------------------------
101 {
102 private:
103 //============== Friends
104 //-----------------------------------------------------------------------
105 friend class Manager;
108 friend class DataStreamer;
109 //-----------------------------------------------------------------------
110
111 public:
112 //-----------------------------------------------------------------------
113 // >>>>>>>>>>>>>>>>>>>>>>> IndexStrNameTuple >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
114 //-----------------------------------------------------------------------
133 {
134 private:
135 //============ Attribute
136 //---------------------------------------------------------------------
152 std::string m_sIndex;
153 //---------------------------------------------------------------------
165 std::string m_sIndexName;
166 //---------------------------------------------------------------------
178 //---------------------------------------------------------------------
190 unsigned long m_ulClassID;
191 //---------------------------------------------------------------------
192
193 public:
194 //============== Konstruktoren
195 //---------------------------------------------------------------------
206 //---------------------------------------------------------------------
225 IndexStrNameTuple( const std::string & rsIndex,
226 const std::string & rsIndexName,
227 bool bUnique,
228 unsigned long ulClassID );
229 //---------------------------------------------------------------------
242 //---------------------------------------------------------------------
253 //---------------------------------------------------------------------
254
255 //============== Methoden
256 //---------------------------------------------------------------------
268 void setIndex( const std::string & rsIndex );
269 //---------------------------------------------------------------------
281 std::string getIndex() const;
282 //---------------------------------------------------------------------
294 void setIndexName( const std::string & rsIndexName );
295 //---------------------------------------------------------------------
307 std::string getIndexName() const;
308 //---------------------------------------------------------------------
321 void setUnique( bool bUnique );
322 //---------------------------------------------------------------------
335 bool isUnique() const;
336 //---------------------------------------------------------------------
348 void setClassID( unsigned long ulClassID );
349 //---------------------------------------------------------------------
361 unsigned long getClassID() const;
362 //---------------------------------------------------------------------
363
364 //============== Operatoren
365 //---------------------------------------------------------------------
367
378 bool operator== ( const IndexStrNameTuple & rT ) const;
379 bool operator!= ( const IndexStrNameTuple & rT ) const;
381 //---------------------------------------------------------------------
394 //---------------------------------------------------------------------
395 };
396 //-----------------------------------------------------------------------
397 // <<<<<<<<<<<<<<<<<<<<<< IndexStrNameTuple <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
398 //-----------------------------------------------------------------------
399
400
401 //============== Static attributes
402 //-----------------------------------------------------------------------
414 #ifdef _DEBUG
415 static unsigned int sm_uiInstanceCount;
416 #endif // _DEBUG
417 //-----------------------------------------------------------------------
418
419 private:
420 //============== Attributes
421 //-----------------------------------------------------------------------
431 unsigned int m_uiReferenceCount;
432 //-----------------------------------------------------------------------
444 #if defined (__PTHREADS)
445 EuPCriticalSection m_LocalCriticalSection;
446 #else
448 #endif
449 //-----------------------------------------------------------------------
469 //-----------------------------------------------------------------------
482 //-----------------------------------------------------------------------
498 std::map< AttributeID, BaseRecordAttribute *, std::less<AttributeID> > m_AttributeMap;
499 //-----------------------------------------------------------------------
509 std::map< AttributeID, BaseRecordAttribute * >::iterator m_AttributeMapIterator;
510 //-----------------------------------------------------------------------
520 std::map< AttributeID, ObjIDRecordAttribute *, std::less<AttributeID> > m_TableObjIDMap;
521 //-----------------------------------------------------------------------
531 std::map< AttributeID, ObjIDRecordAttribute * >::iterator m_TableObjIDMapIterator;
532 //-----------------------------------------------------------------------
544 std::vector< std::shared_ptr< Record::IndexStrNameTuple > > m_IndexStrNameTupleVector;
545 //-----------------------------------------------------------------------
546
547 public:
548 //============== Konstruktoren
549 //-----------------------------------------------------------------------
560 //-----------------------------------------------------------------------
572 Record( const ObjID & rObjID );
573 //-----------------------------------------------------------------------
590 Record( const Record & rT, bool bDeepCopy = false );
591 //-----------------------------------------------------------------------
592
593 protected:
594 //============== Destruktoren
595 //-----------------------------------------------------------------------
605 virtual ~Record()
606 ;
607 //-----------------------------------------------------------------------
608
609 private:
610 //============== Methoden
611 //-----------------------------------------------------------------------
621 void init();
622 //-----------------------------------------------------------------------
623
624 protected:
625 //============== Methoden
626 //-----------------------------------------------------------------------
641 //-----------------------------------------------------------------------
642
643 public:
644 //============== Methoden
645 //-----------------------------------------------------------------------
663 unsigned int remember();
664 //-----------------------------------------------------------------------
686 unsigned int forget();
687 //-----------------------------------------------------------------------
699 unsigned int getReferenceCount() const;
700 //-----------------------------------------------------------------------
715 void setObjID( const ObjID & rObjID );
716 //-----------------------------------------------------------------------
728 unsigned long getClassID() const;
729 //-----------------------------------------------------------------------
742 //-----------------------------------------------------------------------
754 int initNew();
755 //-----------------------------------------------------------------------
771 int initNew( unsigned long ulClassID );
772 //-----------------------------------------------------------------------
800 int initNew( const std::map< unsigned long, ClassInfo * > & rClassInfoMap,
801 unsigned long ulClassID,
802 bool bWithSuperClassAttributes = true );
803 //-----------------------------------------------------------------------
831 int initNew( const std::map< unsigned long, std::shared_ptr<glo::ClassInfo> > & rClassInfoMap,
832 unsigned long ulClassID,
833 bool bWithSuperClassAttributes = true );
834 //-----------------------------------------------------------------------
854 bool bDeepCopy = false );
855 //-----------------------------------------------------------------------
893 int getAttribute( BaseRecordAttribute *& prRetVal, EnSeekMode eMode );
894 //-----------------------------------------------------------------------
932 int getAttribute( std::shared_ptr<BaseRecordAttribute> & rRetVal,
933 EnSeekMode eMode );
934 //-----------------------------------------------------------------------
961 const std::string & sName ) const;
962 //-----------------------------------------------------------------------
986 int getAttributeByFieldName( std::shared_ptr<BaseRecordAttribute> & rRetVal,
987 const std::string & sName ) const;
988 //-----------------------------------------------------------------------
1017 const std::string & sName ) const;
1018 //-----------------------------------------------------------------------
1042 int getAttributeByTableFieldName( std::shared_ptr<BaseRecordAttribute> & rRetVal,
1043 const std::string & sName ) const;
1044 //-----------------------------------------------------------------------
1072 const std::string & sName ) const;
1073 //-----------------------------------------------------------------------
1099 int getAttributeByClassMemberName( std::shared_ptr<BaseRecordAttribute> & rRetVal,
1100 const std::string & sName ) const;
1101 //-----------------------------------------------------------------------
1126 const AttributeID & rAttributeID ) const;
1127 //-----------------------------------------------------------------------
1150 int getAttributeByAttributeID( std::shared_ptr<BaseRecordAttribute> & rRetVal,
1151 const AttributeID & rAttributeID ) const;
1152 //-----------------------------------------------------------------------
1175 void getAllClassMemberNames( std::list<std::string> & rRetValList,
1176 const std::vector<unsigned long> * pClassIdVector = 0 ) const;
1177 //-----------------------------------------------------------------------
1200 void getAllClassMemberNamesSortByID( std::map< AttributeID, std::string> & rRetValMap,
1201 const std::vector<unsigned long> * pClassIdVector = 0 ) const;
1202 //-----------------------------------------------------------------------
1225 int getAttributesFromTableSortByFieldPos( std::map< int, BaseRecordAttribute *, std::less<int> > & rRetValMap,
1226 const std::string & sName ) const;
1227 //-----------------------------------------------------------------------
1247 void getAllAttributes( std::list< BaseRecordAttribute * > & rRetValList,
1248 const std::vector<unsigned long> * pClassIdVector = 0 ) const;
1249 //-----------------------------------------------------------------------
1268 void getAllAttributes( std::list< std::shared_ptr<BaseRecordAttribute> > & rRetValList,
1269 const std::vector<unsigned long> * pClassIdVector = 0 ) const;
1270 //-----------------------------------------------------------------------
1292 void getAllAttributesSortByName( std::map< std::string, BaseRecordAttribute *, std::less<std::string> > & rRetValMap,
1293 const std::vector<unsigned long> * pClassIdVector = 0 ) const;
1294 //-----------------------------------------------------------------------
1315 void getAllAttributesSortByName( std::map< std::string, std::shared_ptr<BaseRecordAttribute>, std::less<std::string> > & rRetValMap,
1316 const std::vector<unsigned long> * pClassIdVector = 0 ) const;
1317 //-----------------------------------------------------------------------
1339 void getAllAttributesSortByID( std::map< AttributeID, BaseRecordAttribute *, std::less<AttributeID> > & rRetValMap,
1340 const std::vector<unsigned long> * pClassIdVector = 0 ) const;
1341 //-----------------------------------------------------------------------
1363 void getAllAttributesSortByID( std::map< AttributeID, std::shared_ptr<BaseRecordAttribute>, std::less<AttributeID> > & rRetValMap,
1364 const std::vector<unsigned long> * pClassIdVector = 0 ) const;
1365 //-----------------------------------------------------------------------
1381 //-----------------------------------------------------------------------
1402 int takeOverRecord( const Record & rRecord, bool bDeepCopy = false );
1403 //-----------------------------------------------------------------------
1427 int takeOverRecordData( const Record & rSourceRecord );
1428 //-----------------------------------------------------------------------
1450 int takeOverObjIDsFilePos( const Record & rSourceRecord );
1451 //-----------------------------------------------------------------------
1492 EnSeekMode eMode );
1493 //-----------------------------------------------------------------------
1532 int getTableObjIDAttribute( std::shared_ptr<BaseRecordAttribute> & rRetVal,
1533 EnSeekMode eMode );
1534 //-----------------------------------------------------------------------
1548 //-----------------------------------------------------------------------
1563 //-----------------------------------------------------------------------
1576 //-----------------------------------------------------------------------
1588 bool hasObjIDInMap() const;
1589 //-----------------------------------------------------------------------
1602 //-----------------------------------------------------------------------
1621 //-----------------------------------------------------------------------
1633 std::vector< std::shared_ptr< Record::IndexStrNameTuple > > getAllIndexStrings() const;
1634 //-----------------------------------------------------------------------
1655 void insertInAllIndexStrings( const std::string & rsIndex,
1656 const std::string & rsIndexName,
1657 bool bUnique,
1658 unsigned long ulClassID );
1659 //-----------------------------------------------------------------------
1670 //-----------------------------------------------------------------------
1671
1672 protected:
1673 //============== Methoden
1674 //-----------------------------------------------------------------------
1702 int getIndexString( std::string & rsRetValIndex,
1703 const SchemaInterface & rSchemaInterface,
1704 const ClassInfoIndex & rClassInfoIndex,
1705 const std::map< ObjID, Record *, std::less<ObjID> > & rIndexRecords ) const;
1706 //-----------------------------------------------------------------------
1734 int getIndexString( std::string & rsRetValIndex,
1735 const std::vector< eut::LanguageFunctions::EnLanguageKey > & rLanguageKeys,
1736 bool bCaseSensitive,
1737 const SchemaInterface & rSchemaInterface,
1738 const ClassInfoIndex::IndexAttributeItem & rIndexAttributeItem,
1739 const std::map< ObjID, Record *, std::less<ObjID> > & rIndexRecords ) const;
1740 //-----------------------------------------------------------------------
1760 int acceptClassInfoAttributesToDataAttributes( const std::set<ClassInfoAttribute*> & rClassInfoAttributeSet,
1761 unsigned long ulClassID );
1762 //-----------------------------------------------------------------------
1782 bool bDeepCopy = false );
1783 //-----------------------------------------------------------------------
1801 bool containedInAttributeSet( const BaseRecordAttribute & rPruefAttribut ) const;
1802 //-----------------------------------------------------------------------
1818 bool containedInTableObjIDSet( const ObjIDRecordAttribute & rPruefAttribut ) const;
1819 //-----------------------------------------------------------------------
1833 const std::map< AttributeID, BaseRecordAttribute *, std::less<AttributeID> > & AttributeMap() const;
1834 //-----------------------------------------------------------------------
1848 const std::map< AttributeID, ObjIDRecordAttribute *, std::less<AttributeID> > & TableObjIDMap() const;
1849 //-----------------------------------------------------------------------
1850
1851 public:
1852 //============== Debug-Methoden
1853 //-----------------------------------------------------------------------
1854 #ifdef _DEBUG
1864 std::string _DEBUG_ToString();
1865 #endif
1866 //-----------------------------------------------------------------------
1867
1868 //============== Operatoren
1869 //-----------------------------------------------------------------------
1887 Record & operator= ( const Record & rT );
1888 //-----------------------------------------------------------------------
1889 };
1890 //---------------------------------------------------------------------------
1891 #ifdef _MSC_VER
1892 /* 'Bezeichner': Klasse 'Typ' benötigt eine DLL-Schnittstelle, die von... */
1893 #pragma warning( default : 4251 )
1894 #endif
1895 //---------------------------------------------------------------------------
1896} // namespace glo
1897#endif
Header für CriticalSection
Header für EuPCriticalSection
Header für ClassInfoIndex und ClassInfoIndex::IndexAttributeItem
Header für ObjID
Für jede Bibliothek, hier 'GlobalObjects' gibt es eine Typen-Datei.
#define __glo_export_dll
Definition GloTypes.h:63
Ist ein Mutex, welcher über sein Lock-Modus abgefragt werden kann. Siehe isLocked().
Definition EuPCriticalSection.h:89
Ist ein Mutex, welcher über sein Lock-Modus abgefragt werden kann. Siehe isLocked().
Definition EuCriticalSection.h:94
Diese Klasse spiegelt eine eindeutige ID eines Klasseninformations-Attributes wieder.
Definition GloAttributeID.h:74
Basisklasse für die einzelnen Attribute eines Record.
Definition GloBaseRecordAttribute.h:109
Information für den Index aus welcher Klasse welches Attribut mit wie viel Zeichen zum Index gehört.
Definition GloClassInfoIndex.h:104
In Objekten dieser Klasse sind die Information für GlobalObjects, wie ein Index aufgebaut ist.
Definition GloClassInfoIndex.h:78
Diese Klasse kodiert bzw. dekodiert Daten für den Transport in einem TCP-Paket.
Definition GloDataStreamer.h:89
Das Objekt dieser Klasse ist die zentrale Anlaufstelle für Aktionen, welche mit GlobalObjects-Daten z...
Definition GloManager.h:184
Ein Objekt-ID besteht aus der Klassen-ID, einer Datenbank-ID und der eigentlichen eindeutigen ObjektZ...
Definition GloObjID.h:77
Eine Klasse für die Objekt-ID-Attribute eines Record. Repräsentiert ein Attribut vom Typ 'ObjID'.
Definition GloObjIDRecordAttribute.h:61
IndexStrNameTuples halten einen Index als sortierbaren String, dessen Bezeichnung und die Klassen-ID ...
Definition GloRecord.h:133
std::string m_sIndexName
Definition GloRecord.h:165
IndexStrNameTuple(const IndexStrNameTuple &rT)
unsigned long m_ulClassID
Definition GloRecord.h:190
void setIndex(const std::string &rsIndex)
bool m_bUnique
Definition GloRecord.h:177
std::string getIndex() const
std::string getIndexName() const
IndexStrNameTuple(const std::string &rsIndex, const std::string &rsIndexName, bool bUnique, unsigned long ulClassID)
void setClassID(unsigned long ulClassID)
unsigned long getClassID() const
std::string m_sIndex
Definition GloRecord.h:152
void setUnique(bool bUnique)
void setIndexName(const std::string &rsIndexName)
Objekte dieser Klasse transportieren die Daten von den Tabellen ins persistente Objekt und von diesen...
Definition GloRecord.h:101
void getAllAttributes(std::list< BaseRecordAttribute * > &rRetValList, const std::vector< unsigned long > *pClassIdVector=0) const
unsigned long getClassID() const
int getAttributeByAttributeID(std::shared_ptr< BaseRecordAttribute > &rRetVal, const AttributeID &rAttributeID) const
ObjID getObjID() const
void getAllAttributes(std::list< std::shared_ptr< BaseRecordAttribute > > &rRetValList, const std::vector< unsigned long > *pClassIdVector=0) const
eut::CriticalSection m_LocalCriticalSection
Definition GloRecord.h:447
std::map< AttributeID, BaseRecordAttribute *, std::less< AttributeID > > m_AttributeMap
Definition GloRecord.h:498
void getAllAttributesSortByName(std::map< std::string, std::shared_ptr< BaseRecordAttribute >, std::less< std::string > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
int getAttributeByTableFieldName(BaseRecordAttribute *&prRetVal, const std::string &sName) const
int initNew(unsigned long ulClassID)
void deleteAllIndexStrings()
int getAttribute(BaseRecordAttribute *&prRetVal, EnSeekMode eMode)
int getAttributesFromTableSortByFieldPos(std::map< int, BaseRecordAttribute *, std::less< int > > &rRetValMap, const std::string &sName) const
unsigned int forget()
std::string _DEBUG_ToString()
std::vector< std::shared_ptr< Record::IndexStrNameTuple > > getAllIndexStrings() const
const std::map< AttributeID, ObjIDRecordAttribute *, std::less< AttributeID > > & TableObjIDMap() const
void removeAllFilePos()
void getAllAttributesSortByID(std::map< AttributeID, BaseRecordAttribute *, std::less< AttributeID > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
std::map< AttributeID, ObjIDRecordAttribute * >::iterator m_TableObjIDMapIterator
Definition GloRecord.h:531
int takeOverTableObjIDAttribute(ObjIDRecordAttribute *pObjIDAttribute, bool bDeepCopy=false)
bool hasObjIDInMap() const
unsigned int m_uiReferenceCount
Definition GloRecord.h:431
ObjID m_ObjID
Definition GloRecord.h:481
virtual ~Record()
Record(const Record &rT, bool bDeepCopy=false)
int takeOverRecordData(const Record &rSourceRecord)
int takeOverRecord(const Record &rRecord, bool bDeepCopy=false)
void getAllAttributesSortByID(std::map< AttributeID, std::shared_ptr< BaseRecordAttribute >, std::less< AttributeID > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
bool allObjIDsHaveFilePos() const
int initNew(const std::map< unsigned long, ClassInfo * > &rClassInfoMap, unsigned long ulClassID, bool bWithSuperClassAttributes=true)
Record(const ObjID &rObjID)
int getAttributeByClassMemberName(std::shared_ptr< BaseRecordAttribute > &rRetVal, const std::string &sName) const
int getAttributeByFieldName(BaseRecordAttribute *&prRetVal, const std::string &sName) const
int getTableObjIDAttribute(ObjIDRecordAttribute *&prRetVal, EnSeekMode eMode)
void deleteAllAttributeData()
int initNew(const std::map< unsigned long, std::shared_ptr< glo::ClassInfo > > &rClassInfoMap, unsigned long ulClassID, bool bWithSuperClassAttributes=true)
std::map< AttributeID, ObjIDRecordAttribute *, std::less< AttributeID > > m_TableObjIDMap
Definition GloRecord.h:520
void setDeterminedFileNamesForAllAttributesWithThese()
void setObjID(const ObjID &rObjID)
static unsigned int sm_uiInstanceCount
Definition GloRecord.h:415
int getAttribute(std::shared_ptr< BaseRecordAttribute > &rRetVal, EnSeekMode eMode)
bool containedInTableObjIDSet(const ObjIDRecordAttribute &rPruefAttribut) const
int getAttributeByAttributeID(BaseRecordAttribute *&prRetVal, const AttributeID &rAttributeID) const
void getAllAttributesSortByName(std::map< std::string, BaseRecordAttribute *, std::less< std::string > > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
int getIndexString(std::string &rsRetValIndex, const std::vector< eut::LanguageFunctions::EnLanguageKey > &rLanguageKeys, bool bCaseSensitive, const SchemaInterface &rSchemaInterface, const ClassInfoIndex::IndexAttributeItem &rIndexAttributeItem, const std::map< ObjID, Record *, std::less< ObjID > > &rIndexRecords) const
void insertInAllIndexStrings(const std::string &rsIndex, const std::string &rsIndexName, bool bUnique, unsigned long ulClassID)
int getAttributeByClassMemberName(BaseRecordAttribute *&prRetVal, const std::string &sName) const
const std::map< AttributeID, BaseRecordAttribute *, std::less< AttributeID > > & AttributeMap() const
void removeGenericDanglingPointer()
std::map< AttributeID, BaseRecordAttribute * >::iterator m_AttributeMapIterator
Definition GloRecord.h:509
int acceptClassInfoAttributesToDataAttributes(const std::set< ClassInfoAttribute * > &rClassInfoAttributeSet, unsigned long ulClassID)
unsigned int remember()
int getAttributeByTableFieldName(std::shared_ptr< BaseRecordAttribute > &rRetVal, const std::string &sName) const
std::vector< std::shared_ptr< Record::IndexStrNameTuple > > m_IndexStrNameTupleVector
Definition GloRecord.h:544
int takeOverObjIDsFilePos(const Record &rSourceRecord)
void getAllClassMemberNamesSortByID(std::map< AttributeID, std::string > &rRetValMap, const std::vector< unsigned long > *pClassIdVector=0) const
void removeAndForgetAllObjIDRecordAttributes()
unsigned int getReferenceCount() const
bool containedInAttributeSet(const BaseRecordAttribute &rPruefAttribut) const
int getAttributeByFieldName(std::shared_ptr< BaseRecordAttribute > &rRetVal, const std::string &sName) const
int getIndexString(std::string &rsRetValIndex, const SchemaInterface &rSchemaInterface, const ClassInfoIndex &rClassInfoIndex, const std::map< ObjID, Record *, std::less< ObjID > > &rIndexRecords) const
int takeOverAttribute(BaseRecordAttribute *pAttribute, bool bDeepCopy=false)
int getTableObjIDAttribute(std::shared_ptr< BaseRecordAttribute > &rRetVal, EnSeekMode eMode)
void removeAndForgetAllBaseRecordAttributes()
bool m_bDeleteControl
Definition GloRecord.h:468
void getAllClassMemberNames(std::list< std::string > &rRetValList, const std::vector< unsigned long > *pClassIdVector=0) const
Diese Klasse ist die Schnittstelle zu einem GlobalObjects-Schema. Sie beinhaltet alle Klasseninformat...
Definition GloSchemaInterface.h:84
Ein Objekt dieser Klasse greift auf Tabellen zu und liest Datensätze (Record) und Binärdateien (eut::...
Definition GloTableReaderInterface.h:77
Ein Objekt dieser Klasse greift auf Tabellen zu und schreibt Datensätze (Record) und Binärdateien (eu...
Definition GloTableWriterInterface.h:70
Definition GloAbstractBaseLot.h:42
EnSeekMode
Definition GloTypes.h:166