1#ifndef INC_GLOTALLSET_H
2#define INC_GLOTALLSET_H
203 TAllSet(
Base & rBase,
bool bWithSubClasses =
true );
224 TAllSet(
Base & rBase,
const std::string & rsFullIndexName );
467 int get( T *& prRetVal,
const ObjID & rObjID );
487 int get( std::shared_ptr<T> & rRetVal,
const ObjID & rObjID );
504 virtual int getPersistent( std::shared_ptr<BasePersistent> & rRetVal,
505 const ObjID & rObjID );
668 const std::string & rsIndexSearchValue,
706 const std::string & rsIndexName,
707 const std::string & rsIndexSearchValue,
750 const std::string & rsIndexName,
751 unsigned long ulIndexClassID,
752 const std::string & rsIndexSearchValue,
796 const std::string & rsIndexSearchValue,
841 const std::string & rsIndexName,
842 const std::string & rsIndexSearchValue,
892 const std::string & rsIndexName,
893 unsigned long ulIndexClassID,
894 const std::string & rsIndexSearchValue,
930 const std::string & rsRangeStartIndex,
931 const std::string & rsRangeEndIndex );
970 const std::string & rsIndexName,
971 const std::string & rsRangeStartIndexSearchValue,
972 const std::string & rsRangeEndIndexSearchValue );
1017 const std::string & rsIndexName,
1018 unsigned long ulIndexClassID,
1019 const std::string & rsRangeStartIndexSearchValue,
1020 const std::string & rsRangeEndIndexSearchValue );
1151 #define SUPER BaseAllSet
1153 template <
class T >
1160 std::shared_ptr<T> t_TempT(
new T,
Forgeter<T>() );
1161 SUPER::setClassIDFromTemplate( t_TempT->getGloClassID() );
1164 template <
class T >
1166 :
SUPER( rBase, 0, bWithSubClasses )
1171 std::shared_ptr<T> t_TempT(
new T,
Forgeter<T>() );
1172 SUPER::setClassIDFromTemplate( t_TempT->getGloClassID() );
1175 template <
class T >
1182 std::shared_ptr<T> t_TempT(
new T,
Forgeter<T>() );
1183 SUPER::setClassIDFromTemplate( t_TempT->getGloClassID() );
1184 int t_iErr = SUPER::setFullIndexName( rsFullIndexName );
1187 throw eut::ErrorNException(
"TAllSet::setBase(Base * pBase, unsigned long ulClassID, const std::string & rsFullIndexName)", t_iErr, __FILE__, __LINE__ );
1191 template <
class T >
1196 template <
class T >
1200 return this->get( t_TempObjID, prRetVal, eMode );
1203 template <
class T >
1207 return this->get( t_TempObjID, rRetVal, eMode );
1210 template <
class T >
1216 t_iErr = this->open();
1221 t_iErr = this->getBase()->getObjectFromAllSet( rObjID, t_pGetObj, *
this, eMode );
1226 prRetVal =
dynamic_cast<T*
>( t_pGetObj );
1233 t_iErr = this->getBase()->getObjectFromAllSet( rObjID, t_pGetObj, *
this,
glo::NEXT );
1237 t_iErr = this->getBase()->getObjectFromAllSet( rObjID, t_pGetObj, *
this,
glo::PREVIOUS );
1244 }
while ( ! t_iErr );
1250 template <
class T >
1255 T * t_pPersistent = 0;
1256 int t_iErr = this->get( rObjID, t_pPersistent, eMode );
1258 if ( t_pPersistent )
1260 rRetVal = std::shared_ptr<T>( t_pPersistent,
Forgeter<T>() );
1265 template <
class T >
1272 if ( this->getBase()->objIDInAllSet( rObjID, *
this ) )
1274 t_iErr = this->getBase()->getAnObject( prRetVal, rObjID );
1283 template <
class T >
1289 t_iErr = this->open();
1293 if ( this->getBase()->objIDInAllSet( rObjID, *
this ) )
1295 t_iErr = this->getBase()->getAnObject( t_pReceivedObject, rObjID );
1298 prRetVal =
dynamic_cast<T*
>( t_pReceivedObject );
1301 t_pReceivedObject->
forget();
1314 template <
class T >
1319 T * t_pPersistent = 0;
1320 int t_iErr = this->get( t_pPersistent, rObjID );
1322 if ( t_pPersistent )
1324 rRetVal = std::shared_ptr<T>( t_pPersistent,
Forgeter<T>() );
1329 template <
class T >
1331 const ObjID & rObjID )
1333 return SUPER::getPersistent( rRetVal, rObjID );
1336 template <
class T >
1341 t_iErr = this->open();
1346 t_iErr = this->getBase()->getObjIdFromAllSet( t_ObjID, *
this, eMode );
1350 bool t_bIsKnownClassID =
false;
1352 t_iErr = this->getBase()->isKnownClassID( t_bIsKnownClassID, t_ObjID.
getClassID() );
1355 if ( ! t_bIsKnownClassID )
1360 t_iErr = this->getOndemand( prRetVal,
NEXT );
1364 t_iErr = this->getOndemand( prRetVal,
PREVIOUS );
1369 prRetVal =
new TOndemand<T>( t_ObjID, * this->getBase() );
1377 template <
class T >
1383 int t_iErr = this->getOndemand( t_pTempGloTOndemand, eMode );
1385 if ( t_pTempGloTOndemand )
1387 rRetVal = std::shared_ptr<T>( t_pTempGloTOndemand );
1392 template <
class T >
1396 int t_iErr = this->getOndemand( t_pTempGloTOndemand, eMode );
1398 if ( t_pTempGloTOndemand )
1400 rRetVal = * t_pTempGloTOndemand;
1401 delete t_pTempGloTOndemand;
1406 template <
class T >
1408 const std::string & rsIndexSearchValue,
1412 std::list< ObjID > t_ObjIDList;
1414 t_iErr = this->getIndexedObjIds( t_ObjIDList,
1419 this->transferObjIListIntoOndemandVector( t_ObjIDList, rOndemandVector );
1424 template <
class T >
1426 const std::string & rsIndexName,
1427 const std::string & rsIndexSearchValue,
1431 std::list< ObjID > t_ObjIDList;
1433 t_iErr = this->getIndexedObjIds( t_ObjIDList,
1439 this->transferObjIListIntoOndemandVector( t_ObjIDList, rOndemandVector );
1444 template <
class T >
1446 const std::string & rsIndexName,
1447 unsigned long ulIndexClassID,
1448 const std::string & rsIndexSearchValue,
1452 std::list< ObjID > t_ObjIDList;
1454 t_iErr = this->getIndexedObjIds( t_ObjIDList,
1461 this->transferObjIListIntoOndemandVector( t_ObjIDList, rOndemandVector );
1466 template <
class T >
1468 const std::string & rsIndexSearchValue,
1472 std::list< ObjID > t_ObjIDList;
1474 t_iErr = this->getIndexedObjIds( t_ObjIDList,
1480 this->transferObjIListIntoOndemandVector( t_ObjIDList, rOndemandVector );
1485 template <
class T >
1487 const std::string & rsIndexName,
1488 const std::string & rsIndexSearchValue,
1492 std::list< ObjID > t_ObjIDList;
1494 t_iErr = this->getIndexedObjIds( t_ObjIDList,
1501 this->transferObjIListIntoOndemandVector( t_ObjIDList, rOndemandVector );
1506 template <
class T >
1508 const std::string & rsIndexName,
1509 unsigned long ulIndexClassID,
1510 const std::string & rsIndexSearchValue,
1514 std::list< ObjID > t_ObjIDList;
1516 t_iErr = this->getIndexedObjIds( t_ObjIDList,
1524 this->transferObjIListIntoOndemandVector( t_ObjIDList, rOndemandVector );
1529 template <
class T >
1531 const std::string & rsRangeStartIndex,
1532 const std::string & rsRangeEndIndex )
1535 std::list< ObjID > t_ObjIDList;
1537 t_iErr = this->getIndexedObjIds( t_ObjIDList,
1543 this->transferObjIListIntoOndemandVector( t_ObjIDList, rOndemandVector );
1548 template <
class T >
1550 const std::string & rsIndexName,
1551 const std::string & rsRangeStartIndexSearchValue,
1552 const std::string & rsRangeEndIndexSearchValue )
1555 std::list< ObjID > t_ObjIDList;
1557 t_iErr = this->getIndexedObjIds( t_ObjIDList,
1559 rsRangeStartIndexSearchValue,
1560 rsRangeEndIndexSearchValue );
1564 this->transferObjIListIntoOndemandVector( t_ObjIDList, rOndemandVector );
1569 template <
class T >
1571 const std::string & rsIndexName,
1572 unsigned long ulIndexClassID,
1573 const std::string & rsRangeStartIndexSearchValue,
1574 const std::string & rsRangeEndIndexSearchValue )
1577 std::list< ObjID > t_ObjIDList;
1579 t_iErr = this->getIndexedObjIds( t_ObjIDList,
1582 rsRangeStartIndexSearchValue,
1583 rsRangeEndIndexSearchValue );
1587 this->transferObjIListIntoOndemandVector( t_ObjIDList, rOndemandVector );
1592 template <
class T >
1595 int t_iErr = this->open();
1606 pCallBack = t_pConstCastThis;
1608 t_iErr = this->getBase()->setWatchClass( this->getBase()->getObjectMaker()->getClassID(
this ),
1616 template <
class T >
1626 pCallBack = t_pConstCastThis;
1628 return this->getBase()->unsetWatchClass( this->getBase()->getObjectMaker()->getClassID(
this ),
1629 ulWatchMode, pCallBack );
1632 template <
class T >
1636 for ( std::list<ObjID>::const_iterator t_Iterator = rSourceList.begin();
1637 t_Iterator != rSourceList.end();
1640 rTargetVevtor.push_back(
TOndemand<T>( * t_Iterator, * this->getBase() ) );
#define NULL_PTR
Definition EuDef_NULL_PTR.h:74
Header für BasePersistent
#define SUPER
Definition GloTAllSet.h:1151
Für jede Bibliothek, hier 'GlobalObjects' gibt es eine Typen-Datei.
Diese Exception-Klasse hat zusätzlich zur Message ein Integer-Attribute für eine Fehlernummer.
Definition EuException.h:58
Ist die Basisklasse von Template-AllSets und dem generischen AllSet.
Definition GloBaseAllSet.h:80
Diese Klasse ist die Schnittstelle zu den persistenten Objekten. Hier können "Objekte" angemeldet,...
Definition GloBase.h:250
Abstrakte Basisklasse für Persistent und die generische GenericPersistent.
Definition GloBasePersistent.h:102
virtual unsigned int forget()
Oberklasse für die Klassen, welche mit einer Base 'verbunden' sind.
Definition GloCallBack.h:74
std::string m_strDebugInfo
Definition GloCallBack.h:115
Speziel für GenericPersistent oder abgeleitete Klassen von Persistent die Forget-Methode für std::sha...
Definition GloTypes.h:1249
Ein Objekt-ID besteht aus der Klassen-ID, einer Datenbank-ID und der eigentlichen eindeutigen ObjektZ...
Definition GloObjID.h:77
unsigned long getClassID() const
AllSet, welcher Objekte aus der Datenbank liefert.
Definition GloTAllSet.h:171
virtual int getPersistent(BasePersistent *&prRetVal, const ObjID &rObjID)
Liefert ein Objekt aus dem AllSet der Datenbank mit übergebener Objekt-ID.
Definition GloTAllSet.h:1266
int get(T *&prRetVal, EnSeekMode eMode)
Definition GloTAllSet.h:1197
TAllSet()
Definition GloTAllSet.h:1154
virtual int setWatch(TdWatchNotifyMode ulWatchMode, CallBack *pCallBack=0)
Definition GloTAllSet.h:1593
int getIndexedOndemands(std::vector< TOndemand< T > > &rOndemandVector, const std::string &rsIndexSearchValue, EnQueryType eQuerryType)
Definition GloTAllSet.h:1407
void transferObjIListIntoOndemandVector(const std::list< ObjID > &rSourceList, std::vector< TOndemand< T > > &rTargetVevtor)
Definition GloTAllSet.h:1633
virtual ~TAllSet()
Definition GloTAllSet.h:1192
virtual int unsetWatch(TdWatchNotifyMode ulWatchMode, CallBack *pCallBack=0)
Definition GloTAllSet.h:1617
TAllSet< T > & operator=(const TAllSet &)
int getOndemand(TOndemand< T > *&prRetVal, EnSeekMode eMode)
Definition GloTAllSet.h:1337
Referenz (als Attribut) eines persistenten Objekte auf ein anderes persistentes Objekt in der Datenba...
Definition GloTOndemand.h:90
Definition GloAbstractBaseLot.h:42
@ ERR_NO_BASE
Definition GloErrors.h:573
@ ERR_OBJID_NOT_IN_ALLSET
Definition GloErrors.h:1740
@ ERR_BASE_NOT_OPEN
Definition GloErrors.h:606
@ ERR_WRONG_TYPE
Definition GloErrors.h:540
EnComparisionOp
Definition GloTypes.h:1583
EnSeekMode
Definition GloTypes.h:166
@ END
Definition GloTypes.h:188
@ START
Definition GloTypes.h:177
@ PREVIOUS
Definition GloTypes.h:221
@ NEXT
Definition GloTypes.h:210
EnQueryType
Definition GloTypes.h:1179
unsigned long TdWatchNotifyMode
Definition GloTypes.h:543