1#ifndef INC_GLOTALLSET_H
2#define INC_GLOTALLSET_H
224 TAllSet(
Base & rBase,
bool bWithSubClasses =
true );
245 TAllSet(
Base & rBase,
const std::string & rsFullIndexName );
508 int get( std::shared_ptr<T> & rRetVal,
const glo::ObjID & rObjID );
525 virtual int getPersistent( std::shared_ptr<BasePersistent> & rRetVal,
689 const std::string & rsIndexSearchValue,
731 const std::string & rsFullIndexName,
732 const std::string & rsIndexSearchValue,
779 const std::string & rsIndexName,
780 unsigned long ulIndexClassID,
781 const std::string & rsIndexSearchValue,
825 const std::string & rsIndexSearchValue,
874 const std::string & rsFullIndexName,
875 const std::string & rsIndexSearchValue,
929 const std::string & rsIndexName,
930 unsigned long ulIndexClassID,
931 const std::string & rsIndexSearchValue,
967 const std::string & rsRangeStartIndex,
968 const std::string & rsRangeEndIndex );
1011 const std::string & rsFullIndexName,
1012 const std::string & rsRangeStartIndexSearchValue,
1013 const std::string & rsRangeEndIndexSearchValue );
1062 const std::string & rsIndexName,
1063 unsigned long ulIndexClassID,
1064 const std::string & rsRangeStartIndexSearchValue,
1065 const std::string & rsRangeEndIndexSearchValue );
1204 #define SUPER BaseAllSet
1206 template <
class T >
1214 SUPER::setClassIDFromTemplate( t_TempT->getGloClassID() );
1217 template <
class T >
1219 :
SUPER( rBase, 0, bWithSubClasses )
1225 SUPER::setClassIDFromTemplate( t_TempT->getGloClassID() );
1228 template <
class T >
1236 SUPER::setClassIDFromTemplate( t_TempT->getGloClassID() );
1237 int t_iErr = SUPER::setFullIndexName( rsFullIndexName );
1240 throw eut::ErrorNException(
"TAllSet::setBase(Base * pBase, unsigned long ulClassID, const std::string & rsFullIndexName)", t_iErr, __FILE__, __LINE__ );
1244 template <
class T >
1249 template <
class T >
1253 return this->get( t_TempObjID, prRetVal, eMode );
1256 template <
class T >
1260 return this->get( t_TempObjID, rRetVal, eMode );
1263 template <
class T >
1269 t_iErr = this->open();
1274 t_iErr = this->getBase()->getObjectFromAllSet( rObjID, t_pGetObj, *
this, eMode );
1279 prRetVal =
dynamic_cast<T*
>( t_pGetObj );
1286 t_iErr = this->getBase()->getObjectFromAllSet( rObjID, t_pGetObj, *
this,
glo::NEXT );
1290 t_iErr = this->getBase()->getObjectFromAllSet( rObjID, t_pGetObj, *
this,
glo::PREVIOUS );
1297 }
while ( ! t_iErr );
1303 template <
class T >
1306 T * t_pPersistent =
nullptr;
1307 int t_iErr = this->get( rObjID, t_pPersistent, eMode );
1309 if ( t_pPersistent )
1311 rRetVal = std::shared_ptr<T>( t_pPersistent,
Forgetter<T>() );
1320 template <
class T >
1329 t_iErr = this->getBase()->getAnObject( prRetVal, rObjID );
1338 template <
class T >
1344 t_iErr = this->open();
1350 t_iErr = this->getBase()->getAnObject( t_pReceivedObject, rObjID );
1353 prRetVal =
dynamic_cast<T*
>( t_pReceivedObject );
1356 t_pReceivedObject->
forget();
1369 template <
class T >
1372 T * t_pPersistent =
nullptr;
1373 int t_iErr = this->get( t_pPersistent, rObjID );
1375 if ( t_pPersistent )
1377 rRetVal = std::shared_ptr<T>( t_pPersistent,
Forgetter<T>() );
1386 template <
class T >
1388 const ObjID & rObjID )
1390 return SUPER::getPersistent( rRetVal, rObjID );
1393 template <
class T >
1398 t_iErr = this->open();
1403 t_iErr = this->getBase()->getObjIdFromAllSet( t_ObjID, *
this, eMode );
1407 bool t_bIsKnownClassID =
false;
1409 t_iErr = this->getBase()->isKnownClassID( t_bIsKnownClassID, t_ObjID.
getClassID() );
1412 if ( ! t_bIsKnownClassID )
1417 t_iErr = this->getOndemand( prRetVal,
NEXT );
1421 t_iErr = this->getOndemand( prRetVal,
PREVIOUS );
1426 prRetVal =
new TOndemand<T>( t_ObjID, * this->getBase() );
1434 template <
class T >
1438 int t_iErr = this->getOndemand( t_pTempGloTOndemand, eMode );
1440 if ( t_pTempGloTOndemand )
1442 rRetVal = std::shared_ptr<T>( t_pTempGloTOndemand );
1451 template <
class T >
1455 int t_iErr = this->getOndemand( t_pTempGloTOndemand, eMode );
1457 if ( t_pTempGloTOndemand )
1459 rRetVal = * t_pTempGloTOndemand;
1460 delete t_pTempGloTOndemand;
1465 template <
class T >
1467 const std::string & rsIndexSearchValue,
1471 std::vector< ObjID > t_ObjIDContainer;
1473 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1478 this->transferObjIListIntoOndemandVector( t_ObjIDContainer, rOndemandVector );
1483 template <
class T >
1485 const std::string & rsFullIndexName,
1486 const std::string & rsIndexSearchValue,
1490 std::vector< ObjID > t_ObjIDContainer;
1492 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1498 this->transferObjIListIntoOndemandVector( t_ObjIDContainer, rOndemandVector );
1503 template <
class T >
1505 const std::string & rsIndexName,
1506 unsigned long ulIndexClassID,
1507 const std::string & rsIndexSearchValue,
1511 std::vector< ObjID > t_ObjIDContainer;
1513 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1520 this->transferObjIListIntoOndemandVector( t_ObjIDContainer, rOndemandVector );
1525 template <
class T >
1527 const std::string & rsIndexSearchValue,
1531 std::vector< ObjID > t_ObjIDContainer;
1533 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1539 this->transferObjIListIntoOndemandVector( t_ObjIDContainer, rOndemandVector );
1544 template <
class T >
1546 const std::string & rsFullIndexName,
1547 const std::string & rsIndexSearchValue,
1551 std::vector< ObjID > t_ObjIDContainer;
1553 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1560 this->transferObjIListIntoOndemandVector( t_ObjIDContainer, rOndemandVector );
1565 template <
class T >
1567 const std::string & rsIndexName,
1568 unsigned long ulIndexClassID,
1569 const std::string & rsIndexSearchValue,
1573 std::vector< ObjID > t_ObjIDContainer;
1575 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1583 this->transferObjIListIntoOndemandVector( t_ObjIDContainer, rOndemandVector );
1588 template <
class T >
1590 const std::string & rsRangeStartIndex,
1591 const std::string & rsRangeEndIndex )
1594 std::vector< ObjID > t_ObjIDContainer;
1596 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1602 this->transferObjIListIntoOndemandVector( t_ObjIDContainer, rOndemandVector );
1607 template <
class T >
1609 const std::string & rsFullIndexName,
1610 const std::string & rsRangeStartIndexSearchValue,
1611 const std::string & rsRangeEndIndexSearchValue )
1614 std::vector< ObjID > t_ObjIDContainer;
1616 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1618 rsRangeStartIndexSearchValue,
1619 rsRangeEndIndexSearchValue );
1623 this->transferObjIListIntoOndemandVector( t_ObjIDContainer, rOndemandVector );
1628 template <
class T >
1630 const std::string & rsIndexName,
1631 unsigned long ulIndexClassID,
1632 const std::string & rsRangeStartIndexSearchValue,
1633 const std::string & rsRangeEndIndexSearchValue )
1636 std::vector< ObjID > t_ObjIDContainer;
1638 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1641 rsRangeStartIndexSearchValue,
1642 rsRangeEndIndexSearchValue );
1646 this->transferObjIListIntoOndemandVector( t_ObjIDContainer, rOndemandVector );
1651 template <
class T >
1654 int t_iErr = this->open();
1665 pCallBack = t_pConstCastThis;
1667 t_iErr = this->getBase()->setWatchClass( this->getBase()->getObjectMaker()->getClassID(
this ),
1675 template <
class T >
1685 pCallBack = t_pConstCastThis;
1687 return this->getBase()->unsetWatchClass( this->getBase()->getObjectMaker()->getClassID(
this ),
1688 ulWatchMode, pCallBack );
1691 template <
class T >
1695 for ( std::vector<ObjID>::const_iterator t_Iterator = rSourceContainer.begin();
1696 t_Iterator != rSourceContainer.end();
1699 rTargetVevtor.push_back(
TOndemand<T>( * t_Iterator, * this->getBase() ) );
Header for BasePersistent
#define SUPER
Definition GloTAllSet.h:1204
For each library, here 'GlobalObjects' there is a type file.
This exception class has an integer attribute for an error number in addition to the message.
Definition EuException.h:73
Is the base class of template AllSets and the generic AllSet.
Definition GloBaseAllSet.h:87
Abstract base class for Persistent and the generic GenericPersistent.
Definition GloBasePersistent.h:124
virtual unsigned int forget()
Superclass for the classes that are 'connected' to a Base.
Definition GloCallBack.h:81
std::string m_strDebugInfo
Definition GloCallBack.h:111
Especially for GenericPersistent or derived classes of Persistent the Forget method for std::shared_p...
Definition GloTypes.h:1234
An object ID consists of the class ID, a database ID and the actual unique object number (all unsigne...
Definition GloObjID.h:84
unsigned long getClassID() const
AllSet, which returns objects from the database.
Definition GloTAllSet.h:192
virtual int getPersistent(BasePersistent *&prRetVal, const glo::ObjID &rObjID)
Returns an object from the AllSet of the database with passed object ID.
Definition GloTAllSet.h:1321
int get(T *&prRetVal, EnSeekMode eMode)
Definition GloTAllSet.h:1250
TAllSet()
Definition GloTAllSet.h:1207
virtual int setWatch(TdWatchNotifyMode ulWatchMode, CallBack *pCallBack=0)
Definition GloTAllSet.h:1652
virtual ~TAllSet()
Definition GloTAllSet.h:1245
virtual int unsetWatch(TdWatchNotifyMode ulWatchMode, CallBack *pCallBack=0)
Definition GloTAllSet.h:1676
void transferObjIListIntoOndemandVector(const std::vector< glo::ObjID > &rSourceContainer, std::vector< glo::TOndemand< T > > &rTargetVevtor)
Definition GloTAllSet.h:1692
TAllSet< T > & operator=(const TAllSet &)
int getOndemand(glo::TOndemand< T > *&prRetVal, EnSeekMode eMode)
Definition GloTAllSet.h:1394
int getIndexedOndemands(std::vector< glo::TOndemand< T > > &rOndemandVector, const std::string &rsIndexSearchValue, EnQueryType eQuerryType)
Definition GloTAllSet.h:1466
A reference (as attribute) of a persistent object to another persistent object in the database.
Definition GloTOndemand.h:102
Definition GloAbstractBaseLot.h:49
@ ERR_NO_BASE
Definition GloErrors.h:584
@ ERR_BASE_NOT_OPEN
Definition GloErrors.h:617
@ ERR_WRONG_TYPE
Definition GloErrors.h:551
EnComparisionOp
Definition GloTypes.h:1567
EnSeekMode
Definition GloTypes.h:173
@ END
Definition GloTypes.h:195
@ START
Definition GloTypes.h:184
@ PREVIOUS
Definition GloTypes.h:228
@ NEXT
Definition GloTypes.h:217
EnQueryType
Definition GloTypes.h:1164
unsigned long TdWatchNotifyMode
Definition GloTypes.h:558