GlobalObjects
Alle Klassen Namensbereiche Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Freundbeziehungen Makrodefinitionen Seiten
GloTAllSet.h
gehe zur Dokumentation dieser Datei
1#ifndef INC_GLOTALLSET_H
2#define INC_GLOTALLSET_H
3//-----------------------------------------------------------------------------
43//-----------------------------------------------------------------------------
44#include <list>
45#include "GloTypes.h"
46#include "GloBaseAllSet.h"
47#include "GloBasePersistent.h"
48#include "GloBase.h"
49#include "GloObjectMaker.h"
50//-----------------------------------------------------------------------------
51namespace glo
52{
53 //---------------------------------------------------------------------------
191 template < class T > class TAllSet : public BaseAllSet
192 {
193 public:
194 //============== Konstruktoren
195 //-----------------------------------------------------------------------
205 TAllSet();
206 //-----------------------------------------------------------------------
224 TAllSet( Base & rBase, bool bWithSubClasses = true );
225 //-----------------------------------------------------------------------
245 TAllSet( Base & rBase, const std::string & rsFullIndexName );
246 //-----------------------------------------------------------------------
266 TAllSet( Base & rBase, const char * pszFullIndexName );
267 //-----------------------------------------------------------------------
277 virtual ~TAllSet();
278 //-----------------------------------------------------------------------
279
280 private:
281 //============== Konstruktoren
282 //-----------------------------------------------------------------------
292 TAllSet( const TAllSet & );
293 //-----------------------------------------------------------------------
294
295 public:
296 //============== static methods
297 //-----------------------------------------------------------------------
309 static unsigned long getStaticGloClassID(){ return T::getStaticGloClassID();};
310 //-----------------------------------------------------------------------
311
312 public:
313 //============== Methoden
314 //-----------------------------------------------------------------------
360 int get( T *& prRetVal, EnSeekMode eMode );
361 //-----------------------------------------------------------------------
397 int get( std::shared_ptr<T> & rRetVal, EnSeekMode eMode );
398 //-----------------------------------------------------------------------
451 int get( glo::ObjID & rObjID, T *& prRetVal, EnSeekMode eMode );
452 //-----------------------------------------------------------------------
494 int get( glo::ObjID & rObjID, std::shared_ptr<T> & rRetVal, EnSeekMode eMode );
495 //-----------------------------------------------------------------------
497
525 virtual int getPersistent( BasePersistent *& prRetVal, const glo::ObjID & rObjID );
526 int get( T *& prRetVal, const glo::ObjID & rObjID );
528 //-----------------------------------------------------------------------
546 int get( std::shared_ptr<T> & rRetVal, const glo::ObjID & rObjID );
547 //-----------------------------------------------------------------------
563 virtual int getPersistent( std::shared_ptr<BasePersistent> & rRetVal,
564 const glo::ObjID & rObjID );
565 //-----------------------------------------------------------------------
617 int getOndemand( glo::TOndemand<T> *& prRetVal, EnSeekMode eMode );
618 //-----------------------------------------------------------------------
654 int getOndemand( std::shared_ptr< glo::TOndemand<T> > & rRetVal, EnSeekMode eMode );
655 //-----------------------------------------------------------------------
692 int getOndemand( glo::TOndemand<T> & rRetVal, EnSeekMode eMode );
693 //-----------------------------------------------------------------------
695
727 int getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandContainer,
728 const std::string & rsIndexSearchValue,
729 EnQueryType eQuerryType );
730 int getIndexedOndemands( glo::TOndemandList<T> & rOndemandContainer,
731 const std::string & rsIndexSearchValue,
732 EnQueryType eQuerryType );
734 //-----------------------------------------------------------------------
736
774 int getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandContainer,
775 const std::string & rsFullIndexName,
776 const std::string & rsIndexSearchValue,
777 EnQueryType eQuerryType );
778 int getIndexedOndemands( glo::TOndemandList<T> & rOndemandContainer,
779 const std::string & rsFullIndexName,
780 const std::string & rsIndexSearchValue,
781 EnQueryType eQuerryType );
783 //-----------------------------------------------------------------------
785
828 int getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandContainer,
829 const std::string & rsIndexName,
830 unsigned long ulIndexClassID,
831 const std::string & rsIndexSearchValue,
832 EnQueryType eQuerryType );
833 int getIndexedOndemands( glo::TOndemandList<T> & rOndemandContainer,
834 const std::string & rsIndexName,
835 unsigned long ulIndexClassID,
836 const std::string & rsIndexSearchValue,
837 EnQueryType eQuerryType );
839 //-----------------------------------------------------------------------
841
881 int getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandContainer,
882 const std::string & rsIndexSearchValue,
883 EnComparisionOp eComparisionOp );
884 int getIndexedOndemands( glo::TOndemandList<T> & rOndemandContainer,
885 const std::string & rsIndexSearchValue,
886 EnComparisionOp eComparisionOp );
888 //-----------------------------------------------------------------------
890
935 int getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandContainer,
936 const std::string & rsFullIndexName,
937 const std::string & rsIndexSearchValue,
938 EnComparisionOp eComparisionOp );
939 int getIndexedOndemands( glo::TOndemandList<T> & rOndemandContainer,
940 const std::string & rsFullIndexName,
941 const std::string & rsIndexSearchValue,
942 EnComparisionOp eComparisionOp );
944 //-----------------------------------------------------------------------
946
996 int getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandContainer,
997 const std::string & rsIndexName,
998 unsigned long ulIndexClassID,
999 const std::string & rsIndexSearchValue,
1000 EnComparisionOp eComparisionOp );
1001 int getIndexedOndemands( glo::TOndemandList<T> & rOndemandContainer,
1002 const std::string & rsIndexName,
1003 unsigned long ulIndexClassID,
1004 const std::string & rsIndexSearchValue,
1005 EnComparisionOp eComparisionOp );
1007 //-----------------------------------------------------------------------
1009
1041 int getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandContainer,
1042 const std::string & rsRangeStartIndex,
1043 const std::string & rsRangeEndIndex );
1044 int getIndexedOndemands( glo::TOndemandList<T> & rOndemandContainer,
1045 const std::string & rsRangeStartIndex,
1046 const std::string & rsRangeEndIndex );
1048 //-----------------------------------------------------------------------
1050
1090 int getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandContainer,
1091 const std::string & rsFullIndexName,
1092 const std::string & rsRangeStartIndexSearchValue,
1093 const std::string & rsRangeEndIndexSearchValue );
1094 int getIndexedOndemands( glo::TOndemandList<T> & rOndemandContainer,
1095 const std::string & rsFullIndexName,
1096 const std::string & rsRangeStartIndexSearchValue,
1097 const std::string & rsRangeEndIndexSearchValue );
1099 //-----------------------------------------------------------------------
1101
1147 int getIndexedOndemands( std::vector< glo::TOndemand<T> > & rOndemandContainer,
1148 const std::string & rsIndexName,
1149 unsigned long ulIndexClassID,
1150 const std::string & rsRangeStartIndexSearchValue,
1151 const std::string & rsRangeEndIndexSearchValue );
1152 int getIndexedOndemands( glo::TOndemandList<T> & rOndemandContainer,
1153 const std::string & rsIndexName,
1154 unsigned long ulIndexClassID,
1155 const std::string & rsRangeStartIndexSearchValue,
1156 const std::string & rsRangeEndIndexSearchValue );
1158 //-----------------------------------------------------------------------
1211 virtual int setWatch( TdWatchNotifyMode ulWatchMode, CallBack * pCallBack = 0 );
1212 //-----------------------------------------------------------------------
1256 virtual int unsetWatch( TdWatchNotifyMode ulWatchMode, CallBack * pCallBack = 0 );
1257 //-----------------------------------------------------------------------
1258
1259 private:
1260 //============== Methoden
1261 //-----------------------------------------------------------------------
1263
1278 void transferObjIListIntoOndemandContainer( const std::vector< glo::ObjID > & rSourceContainer,
1279 std::vector< glo::TOndemand<T> > & rTargetConteiner );
1280 void transferObjIListIntoOndemandContainer( const std::vector< glo::ObjID > & rSourceContainer,
1281 glo::TOndemandList<T> & rTargetConteiner );
1283 //-----------------------------------------------------------------------
1284
1285 //============== Operatoren
1286 //-----------------------------------------------------------------------
1297 //-----------------------------------------------------------------------
1298 };
1299 //---------------------------------------------------------------------------
1300 #define SUPER BaseAllSet
1301 //---------------------------------------------------------------------------
1302 template < class T >
1304 : SUPER()
1305 {
1306 #ifdef _DEBUG
1307 m_strDebugInfo = "TAllSet";
1308 #endif
1309 SUPER::setClassIDFromTemplate( T::getStaticGloClassID() );
1310 }
1311 //---------------------------------------------------------------------------
1312 template < class T >
1313 TAllSet< T >::TAllSet( Base & rBase, bool bWithSubClasses )
1314 : SUPER( rBase, 0, bWithSubClasses )
1315 {
1316 #ifdef _DEBUG
1317 m_strDebugInfo = "TAllSet";
1318 #endif
1319 SUPER::setClassIDFromTemplate( T::getStaticGloClassID() );
1320 }
1321 //---------------------------------------------------------------------------
1322 template < class T >
1323 TAllSet< T >::TAllSet( Base & rBase, const std::string & rsFullIndexName )
1324 : SUPER( rBase, 0 )
1325 {
1326 #ifdef _DEBUG
1327 m_strDebugInfo = "TAllSet";
1328 #endif
1329 SUPER::setClassIDFromTemplate( T::getStaticGloClassID() );
1330 int t_iErr = SUPER::setFullIndexName( rsFullIndexName );
1331 if ( t_iErr )
1332 {
1333 throw eut::ErrorNException( "TAllSet::setBase(Base * pBase, unsigned long ulClassID, const std::string & rsFullIndexName)", t_iErr, __FILE__, __LINE__ );
1334 }
1335 }
1336 //---------------------------------------------------------------------------
1337 template < class T >
1338 TAllSet< T >::TAllSet( Base & rBase, const char * pszFullIndexName )
1339 : SUPER( rBase, 0 )
1340 {
1341 #ifdef _DEBUG
1342 m_strDebugInfo = "TAllSet";
1343 #endif
1344 SUPER::setClassIDFromTemplate( T::getStaticGloClassID() );
1345 int t_iErr = SUPER::setFullIndexName( pszFullIndexName );
1346 if ( t_iErr )
1347 {
1348 throw eut::ErrorNException( "TAllSet::setBase(Base * pBase, unsigned long ulClassID, const std::string & rsFullIndexName)", t_iErr, __FILE__, __LINE__ );
1349 }
1350 }
1351 //---------------------------------------------------------------------------
1352 template < class T >
1354 {
1355 }
1356 //---------------------------------------------------------------------------
1357 template < class T >
1358 int TAllSet< T >::get( T *& prRetVal, EnSeekMode eMode )
1359 {
1360 ObjID t_TempObjID;
1361 return this->get( t_TempObjID, prRetVal, eMode );
1362 }
1363 //---------------------------------------------------------------------------
1364 template < class T >
1365 int TAllSet< T >::get( std::shared_ptr<T> & rRetVal, EnSeekMode eMode )
1366 {
1367 ObjID t_TempObjID;
1368 return this->get( t_TempObjID, rRetVal, eMode );
1369 }
1370 //---------------------------------------------------------------------------
1371 template < class T >
1372 int TAllSet< T >::get( ObjID & rObjID, T *& prRetVal, EnSeekMode eMode )
1373 {
1374 int t_iErr = 0;
1375
1376 prRetVal = nullptr;
1377 t_iErr = this->open();
1378 if ( ! t_iErr )
1379 {
1380 BasePersistent * t_pGetObj = nullptr;
1381
1382 t_iErr = this->getBase()->getObjectFromAllSet( rObjID, t_pGetObj, *this, eMode );
1383 if ( ! t_iErr )
1384 {
1385 do
1386 {
1387 prRetVal = dynamic_cast<T*>( t_pGetObj );
1388 if ( ! prRetVal )
1389 {
1390 t_pGetObj->forget();
1391
1392 if ( eMode == glo::START || eMode == glo::NEXT )
1393 {
1394 t_iErr = this->getBase()->getObjectFromAllSet( rObjID, t_pGetObj, *this, glo::NEXT );
1395 }
1396 else if ( eMode == glo::END || eMode == glo::PREVIOUS )
1397 {
1398 t_iErr = this->getBase()->getObjectFromAllSet( rObjID, t_pGetObj, *this, glo::PREVIOUS );
1399 }
1400 }
1401 else
1402 {
1403 break;
1404 }
1405 } while ( ! t_iErr );
1406 }
1407 }
1408 return t_iErr;
1409 }
1410 //---------------------------------------------------------------------------
1411 template < class T >
1412 int TAllSet< T >::get( ObjID & rObjID, std::shared_ptr<T> & rRetVal, EnSeekMode eMode )
1413 {
1414 T * t_pPersistent = nullptr;
1415 int t_iErr = this->get( rObjID, t_pPersistent, eMode );
1416
1417 if ( t_pPersistent )
1418 {
1419 rRetVal = std::shared_ptr<T>( t_pPersistent, Forgetter<T>() );
1420 }
1421 else
1422 {
1423 rRetVal.reset();
1424 }
1425 return t_iErr;
1426 }
1427 //---------------------------------------------------------------------------
1428 template < class T >
1429 int TAllSet< T >::getPersistent( BasePersistent *& prRetVal, const ObjID & rObjID )
1430 {
1431 int t_iErr = 0;
1432
1433 prRetVal = nullptr;
1434 if ( ! this->getBase() ) return ERR_NO_BASE;
1435 //if ( this->getBase()->objIDInAllSet( rObjID, *this ) )
1436 //{
1437 t_iErr = this->getBase()->getAnObject( prRetVal, rObjID );
1438 //}
1439 //else
1440 //{
1441 // return ERR_OBJID_NOT_IN_ALLSET;
1442 //}
1443 return t_iErr;
1444 }
1445 //---------------------------------------------------------------------------
1446 template < class T >
1447 int TAllSet< T >::get( T *& prRetVal, const ObjID & rObjID )
1448 {
1449 int t_iErr = 0;
1450
1451 prRetVal = nullptr;
1452 t_iErr = this->open();
1453 if ( ! t_iErr )
1454 {
1455 BasePersistent * t_pReceivedObject = nullptr;
1456 //if ( this->getBase()->objIDInAllSet( rObjID, *this ) )
1457 //{
1458 t_iErr = this->getBase()->getAnObject( t_pReceivedObject, rObjID );
1459 if ( ! t_iErr )
1460 {
1461 prRetVal = dynamic_cast<T*>( t_pReceivedObject );
1462 if ( ! prRetVal )
1463 {
1464 t_pReceivedObject->forget();
1465 t_iErr = ERR_WRONG_TYPE;
1466 }
1467 }
1468 //}
1469 //else
1470 //{
1471 // return ERR_OBJID_NOT_IN_ALLSET;
1472 //}
1473 }
1474 return t_iErr;
1475 }
1476 //---------------------------------------------------------------------------
1477 template < class T >
1478 int TAllSet< T >::get( std::shared_ptr<T> & rRetVal, const ObjID & rObjID )
1479 {
1480 T * t_pPersistent = nullptr;
1481 int t_iErr = this->get( t_pPersistent, rObjID );
1482
1483 if ( t_pPersistent )
1484 {
1485 rRetVal = std::shared_ptr<T>( t_pPersistent, Forgetter<T>() );
1486 }
1487 else
1488 {
1489 rRetVal.reset();
1490 }
1491 return t_iErr;
1492 }
1493 //---------------------------------------------------------------------------
1494 template < class T >
1495 int TAllSet< T >::getPersistent( std::shared_ptr<BasePersistent> & rRetVal,
1496 const ObjID & rObjID )
1497 {
1498 return SUPER::getPersistent( rRetVal, rObjID );
1499 }
1500 //---------------------------------------------------------------------------
1501 template < class T >
1503 {
1504 int t_iErr = 0;
1505
1506 t_iErr = this->open();
1507 if ( ! t_iErr )
1508 {
1509 ObjID t_ObjID;
1510
1511 t_iErr = this->getBase()->getObjIdFromAllSet( t_ObjID, *this, eMode );
1512 if ( ! t_iErr )
1513 {
1514 // Erfragen, ob ObjID-Klasse hier verarbeitbar
1515 bool t_bIsKnownClassID = false;
1516
1517 t_iErr = this->getBase()->isKnownClassID( t_bIsKnownClassID, t_ObjID.getClassID() );
1518 if ( ! t_iErr )
1519 {
1520 if ( ! t_bIsKnownClassID )
1521 {
1522 // Unbekannte Klasse! Auch OK, dann nächstes oder vorheriges Objekt
1523 if ( eMode == START || eMode == NEXT )
1524 {
1525 t_iErr = this->getOndemand( prRetVal, NEXT );
1526 }
1527 else if ( eMode == END || eMode == PREVIOUS )
1528 {
1529 t_iErr = this->getOndemand( prRetVal, PREVIOUS );
1530 }
1531 }
1532 else
1533 {
1534 prRetVal = new TOndemand<T>( t_ObjID, * this->getBase() );
1535 }
1536 }
1537 }
1538 }
1539 return t_iErr;
1540 }
1541 //---------------------------------------------------------------------------
1542 template < class T >
1543 int TAllSet< T >::getOndemand( std::shared_ptr< TOndemand<T> > & rRetVal, EnSeekMode eMode )
1544 {
1545 TOndemand<T> * t_pTempGloTOndemand = nullptr;
1546 int t_iErr = this->getOndemand( t_pTempGloTOndemand, eMode );
1547
1548 if ( t_pTempGloTOndemand )
1549 {
1550 rRetVal = std::shared_ptr<T>( t_pTempGloTOndemand );
1551 }
1552 else
1553 {
1554 rRetVal.reset();
1555 }
1556 return t_iErr;
1557 }
1558 //---------------------------------------------------------------------------
1559 template < class T >
1561 {
1562 TOndemand<T> * t_pTempGloTOndemand = nullptr;
1563 int t_iErr = this->getOndemand( t_pTempGloTOndemand, eMode );
1564
1565 if ( t_pTempGloTOndemand )
1566 {
1567 rRetVal = * t_pTempGloTOndemand;
1568 delete t_pTempGloTOndemand;
1569 }
1570 return t_iErr;
1571 }
1572 //---------------------------------------------------------------------------
1573 template < class T >
1574 int TAllSet< T >::getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandContainer,
1575 const std::string & rsIndexSearchValue,
1576 EnQueryType eQuerryType )
1577 {
1578 int t_iErr = 0;
1579 std::vector< ObjID > t_ObjIDContainer;
1580
1581 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1582 rsIndexSearchValue,
1583 eQuerryType );
1584 if ( ! t_iErr )
1585 {
1586 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1587 }
1588 return t_iErr;
1589 }
1590 //---------------------------------------------------------------------------
1591 template < class T >
1593 const std::string & rsIndexSearchValue,
1594 EnQueryType eQuerryType )
1595 {
1596 int t_iErr = 0;
1597 std::vector< ObjID > t_ObjIDContainer;
1598
1599 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1600 rsIndexSearchValue,
1601 eQuerryType );
1602 if ( ! t_iErr )
1603 {
1604 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1605 }
1606 return t_iErr;
1607 }
1608 //---------------------------------------------------------------------------
1609 template < class T >
1610 int TAllSet< T >::getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandContainer,
1611 const std::string & rsFullIndexName,
1612 const std::string & rsIndexSearchValue,
1613 EnQueryType eQuerryType )
1614 {
1615 int t_iErr = 0;
1616 std::vector< ObjID > t_ObjIDContainer;
1617
1618 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1619 rsFullIndexName,
1620 rsIndexSearchValue,
1621 eQuerryType );
1622 if ( ! t_iErr )
1623 {
1624 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1625 }
1626 return t_iErr;
1627 }
1628 //---------------------------------------------------------------------------
1629 template < class T >
1631 const std::string & rsFullIndexName,
1632 const std::string & rsIndexSearchValue,
1633 EnQueryType eQuerryType )
1634 {
1635 int t_iErr = 0;
1636 std::vector< ObjID > t_ObjIDContainer;
1637
1638 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1639 rsFullIndexName,
1640 rsIndexSearchValue,
1641 eQuerryType );
1642 if ( ! t_iErr )
1643 {
1644 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1645 }
1646 return t_iErr;
1647 }
1648 //---------------------------------------------------------------------------
1649 template < class T >
1650 int TAllSet< T >::getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandContainer,
1651 const std::string & rsIndexName,
1652 unsigned long ulIndexClassID,
1653 const std::string & rsIndexSearchValue,
1654 EnQueryType eQuerryType )
1655 {
1656 int t_iErr = 0;
1657 std::vector< ObjID > t_ObjIDContainer;
1658
1659 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1660 rsIndexName,
1661 ulIndexClassID,
1662 rsIndexSearchValue,
1663 eQuerryType );
1664 if ( ! t_iErr )
1665 {
1666 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1667 }
1668 return t_iErr;
1669 }
1670 //---------------------------------------------------------------------------
1671 template < class T >
1673 const std::string & rsIndexName,
1674 unsigned long ulIndexClassID,
1675 const std::string & rsIndexSearchValue,
1676 EnQueryType eQuerryType )
1677 {
1678 int t_iErr = 0;
1679 std::vector< ObjID > t_ObjIDContainer;
1680
1681 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1682 rsIndexName,
1683 ulIndexClassID,
1684 rsIndexSearchValue,
1685 eQuerryType );
1686 if ( ! t_iErr )
1687 {
1688 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1689 }
1690 return t_iErr;
1691 }
1692 //---------------------------------------------------------------------------
1693 template < class T >
1694 int TAllSet< T >::getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandContainer,
1695 const std::string & rsIndexSearchValue,
1696 EnComparisionOp eComparisionOp )
1697 {
1698 int t_iErr = 0;
1699 std::vector< ObjID > t_ObjIDContainer;
1700
1701 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1702 rsIndexSearchValue,
1703 eComparisionOp );
1704
1705 if ( ! t_iErr )
1706 {
1707 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1708 }
1709 return t_iErr;
1710 }
1711 //---------------------------------------------------------------------------
1712 template < class T >
1714 const std::string & rsIndexSearchValue,
1715 EnComparisionOp eComparisionOp )
1716 {
1717 int t_iErr = 0;
1718 std::vector< ObjID > t_ObjIDContainer;
1719
1720 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1721 rsIndexSearchValue,
1722 eComparisionOp );
1723
1724 if ( ! t_iErr )
1725 {
1726 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1727 }
1728 return t_iErr;
1729 }
1730 //---------------------------------------------------------------------------
1731 template < class T >
1732 int TAllSet< T >::getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandContainer,
1733 const std::string & rsFullIndexName,
1734 const std::string & rsIndexSearchValue,
1735 EnComparisionOp eComparisionOp )
1736 {
1737 int t_iErr = 0;
1738 std::vector< ObjID > t_ObjIDContainer;
1739
1740 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1741 rsFullIndexName,
1742 rsIndexSearchValue,
1743 eComparisionOp );
1744
1745 if ( ! t_iErr )
1746 {
1747 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1748 }
1749 return t_iErr;
1750 }
1751 //---------------------------------------------------------------------------
1752 template < class T >
1754 const std::string & rsFullIndexName,
1755 const std::string & rsIndexSearchValue,
1756 EnComparisionOp eComparisionOp )
1757 {
1758 int t_iErr = 0;
1759 std::vector< ObjID > t_ObjIDContainer;
1760
1761 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1762 rsFullIndexName,
1763 rsIndexSearchValue,
1764 eComparisionOp );
1765
1766 if ( ! t_iErr )
1767 {
1768 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1769 }
1770 return t_iErr;
1771 }
1772 //---------------------------------------------------------------------------
1773 template < class T >
1774 int TAllSet< T >::getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandContainer,
1775 const std::string & rsIndexName,
1776 unsigned long ulIndexClassID,
1777 const std::string & rsIndexSearchValue,
1778 EnComparisionOp eComparisionOp )
1779 {
1780 int t_iErr = 0;
1781 std::vector< ObjID > t_ObjIDContainer;
1782
1783 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1784 rsIndexName,
1785 ulIndexClassID,
1786 rsIndexSearchValue,
1787 eComparisionOp );
1788
1789 if ( ! t_iErr )
1790 {
1791 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1792 }
1793 return t_iErr;
1794 }
1795 //---------------------------------------------------------------------------
1796 template < class T >
1798 const std::string & rsIndexName,
1799 unsigned long ulIndexClassID,
1800 const std::string & rsIndexSearchValue,
1801 EnComparisionOp eComparisionOp )
1802 {
1803 int t_iErr = 0;
1804 std::vector< ObjID > t_ObjIDContainer;
1805
1806 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1807 rsIndexName,
1808 ulIndexClassID,
1809 rsIndexSearchValue,
1810 eComparisionOp );
1811
1812 if ( ! t_iErr )
1813 {
1814 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1815 }
1816 return t_iErr;
1817 }
1818 //---------------------------------------------------------------------------
1819 template < class T >
1820 int TAllSet< T >::getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandContainer,
1821 const std::string & rsRangeStartIndex,
1822 const std::string & rsRangeEndIndex )
1823 {
1824 int t_iErr = 0;
1825 std::vector< ObjID > t_ObjIDContainer;
1826
1827 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1828 rsRangeStartIndex,
1829 rsRangeEndIndex );
1830
1831 if ( ! t_iErr )
1832 {
1833 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1834 }
1835 return t_iErr;
1836 }
1837 //---------------------------------------------------------------------------
1838 template < class T >
1840 const std::string & rsRangeStartIndex,
1841 const std::string & rsRangeEndIndex )
1842 {
1843 int t_iErr = 0;
1844 std::vector< ObjID > t_ObjIDContainer;
1845
1846 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1847 rsRangeStartIndex,
1848 rsRangeEndIndex );
1849
1850 if ( ! t_iErr )
1851 {
1852 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1853 }
1854 return t_iErr;
1855 }
1856 //---------------------------------------------------------------------------
1857 template < class T >
1858 int TAllSet< T >::getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandContainer,
1859 const std::string & rsFullIndexName,
1860 const std::string & rsRangeStartIndexSearchValue,
1861 const std::string & rsRangeEndIndexSearchValue )
1862 {
1863 int t_iErr = 0;
1864 std::vector< ObjID > t_ObjIDContainer;
1865
1866 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1867 rsFullIndexName,
1868 rsRangeStartIndexSearchValue,
1869 rsRangeEndIndexSearchValue );
1870
1871 if ( ! t_iErr )
1872 {
1873 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1874 }
1875 return t_iErr;
1876 }
1877 //---------------------------------------------------------------------------
1878 template < class T >
1880 const std::string & rsFullIndexName,
1881 const std::string & rsRangeStartIndexSearchValue,
1882 const std::string & rsRangeEndIndexSearchValue )
1883 {
1884 int t_iErr = 0;
1885 std::vector< ObjID > t_ObjIDContainer;
1886
1887 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1888 rsFullIndexName,
1889 rsRangeStartIndexSearchValue,
1890 rsRangeEndIndexSearchValue );
1891
1892 if ( ! t_iErr )
1893 {
1894 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1895 }
1896 return t_iErr;
1897 }
1898 //---------------------------------------------------------------------------
1899 template < class T >
1900 int TAllSet< T >::getIndexedOndemands( std::vector< TOndemand<T> > & rOndemandContainer,
1901 const std::string & rsIndexName,
1902 unsigned long ulIndexClassID,
1903 const std::string & rsRangeStartIndexSearchValue,
1904 const std::string & rsRangeEndIndexSearchValue )
1905 {
1906 int t_iErr = 0;
1907 std::vector< ObjID > t_ObjIDContainer;
1908
1909 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1910 rsIndexName,
1911 ulIndexClassID,
1912 rsRangeStartIndexSearchValue,
1913 rsRangeEndIndexSearchValue );
1914
1915 if ( ! t_iErr )
1916 {
1917 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1918 }
1919 return t_iErr;
1920 }
1921 //---------------------------------------------------------------------------
1922 template < class T >
1924 const std::string & rsIndexName,
1925 unsigned long ulIndexClassID,
1926 const std::string & rsRangeStartIndexSearchValue,
1927 const std::string & rsRangeEndIndexSearchValue )
1928 {
1929 int t_iErr = 0;
1930 std::vector< ObjID > t_ObjIDContainer;
1931
1932 t_iErr = this->getIndexedObjIds( t_ObjIDContainer,
1933 rsIndexName,
1934 ulIndexClassID,
1935 rsRangeStartIndexSearchValue,
1936 rsRangeEndIndexSearchValue );
1937
1938 if ( ! t_iErr )
1939 {
1940 this->transferObjIListIntoOndemandContainer( t_ObjIDContainer, rOndemandContainer );
1941 }
1942 return t_iErr;
1943 }
1944 //---------------------------------------------------------------------------
1945 template < class T >
1946 int TAllSet< T >::setWatch( TdWatchNotifyMode ulWatchMode, CallBack * pCallBack )
1947 {
1948 int t_iErr = this->open();
1949
1950 if ( ! t_iErr )
1951 {
1952 if ( ! this->getBase()->getObjectMaker() ) t_iErr = ERR_BASE_NOT_OPEN;
1953 if ( ! t_iErr )
1954 {
1955 if ( ! pCallBack )
1956 {
1957 TAllSet< T > * t_pConstCastThis = const_cast<TAllSet< T >*>( this );
1958
1959 pCallBack = t_pConstCastThis;
1960 }
1961 t_iErr = this->getBase()->setWatchClass( this->getClassID(),
1962 ulWatchMode,
1963 pCallBack );
1964 }
1965 }
1966 return t_iErr;
1967 }
1968 //---------------------------------------------------------------------------
1969 template < class T >
1971 {
1972 if ( ! this->getBase() ) return ERR_NO_BASE;
1973 if ( ! this->getBase()->getObjectMaker() ) return ERR_BASE_NOT_OPEN;
1974
1975 if ( ! pCallBack )
1976 {
1977 TAllSet< T > * t_pConstCastThis = const_cast<TAllSet< T >*>( this );
1978
1979 pCallBack = t_pConstCastThis;
1980 }
1981 return this->getBase()->unsetWatchClass( this->getClassID(),
1982 ulWatchMode, pCallBack );
1983 }
1984 //---------------------------------------------------------------------------
1985 template < class T >
1986 void TAllSet< T >::transferObjIListIntoOndemandContainer( const std::vector< glo::ObjID > & rSourceContainer,
1987 std::vector< TOndemand<T> > & rTargetContainer )
1988 {
1989 for ( std::vector<ObjID>::const_iterator t_Iterator = rSourceContainer.begin();
1990 t_Iterator != rSourceContainer.end();
1991 ++t_Iterator )
1992 {
1993 rTargetContainer.push_back( TOndemand<T>( * t_Iterator, * this->getBase() ) );
1994 }
1995 }
1996 //---------------------------------------------------------------------------
1997 template < class T >
1998 void TAllSet< T >::transferObjIListIntoOndemandContainer( const std::vector< glo::ObjID > & rSourceContainer,
1999 glo::TOndemandList<T> & rTargetContainer )
2000 {
2001 for ( std::vector<ObjID>::const_iterator t_Iterator = rSourceContainer.begin();
2002 t_Iterator != rSourceContainer.end();
2003 ++t_Iterator )
2004 {
2005 rTargetContainer.appendOndemand( TOndemand<T>( * t_Iterator, * this->getBase() ) );
2006 }
2007 }
2008 //---------------------------------------------------------------------------
2009 #undef SUPER
2010 //---------------------------------------------------------------------------
2011} // namespace glo
2012#endif
Header für Base
Header für BaseAllSet
Header für BasePersistent
Header für ObjectMaker
#define SUPER
Definition GloTAllSet.h:1300
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:73
int getIndexedObjIds(std::vector< glo::ObjID > &rObjIDContainer, const std::string &rsIndexSearchValue, EnQueryType eQuerryType)
friend class Base
Definition GloBaseAllSet.h:212
virtual Base * getBase() const override
unsigned long getClassID() const
Abstrakte Basisklasse für Persistent und die generische GenericPersistent.
Definition GloBasePersistent.h:124
virtual unsigned int forget()
Oberklasse für die Klassen, welche mit einer Base 'verbunden' sind.
Definition GloCallBack.h:81
std::string m_strDebugInfo
Definition GloCallBack.h:111
Speziel für GenericPersistent oder abgeleitete Klassen von Persistent die Forget-Methode für std::sha...
Definition GloTypes.h:1253
Ein Objekt-ID besteht aus der Klassen-ID, einer Datenbank-ID und der eigentlichen eindeutigen ObjektZ...
Definition GloObjID.h:84
unsigned long getClassID() const
virtual int appendOndemand(const Reference &rNewOndemand)
int getIndexedOndemands(std::vector< glo::TOndemand< T > > &rOndemandContainer, const std::string &rsIndexSearchValue, EnQueryType eQuerryType)
Liefert einen Container von glo::TOndemand's aus dem AllSet in Bezug auf die übergebene Parameter.
Definition GloTAllSet.h:1574
void transferObjIListIntoOndemandContainer(const std::vector< glo::ObjID > &rSourceContainer, std::vector< glo::TOndemand< T > > &rTargetConteiner)
Überträgt die glo::ObjID's aus der übergebenen rSourceContainer als glo::TOndemand's in den übergeben...
Definition GloTAllSet.h:1986
virtual int getPersistent(BasePersistent *&prRetVal, const glo::ObjID &rObjID)
Liefert ein Objekt aus dem AllSet der Datenbank mit übergebener Objekt-ID.
Definition GloTAllSet.h:1429
int get(T *&prRetVal, EnSeekMode eMode)
Definition GloTAllSet.h:1358
TAllSet()
Definition GloTAllSet.h:1303
virtual int setWatch(TdWatchNotifyMode ulWatchMode, CallBack *pCallBack=0)
Definition GloTAllSet.h:1946
TAllSet(const TAllSet &)
static unsigned long getStaticGloClassID()
Definition GloTAllSet.h:309
virtual ~TAllSet()
Definition GloTAllSet.h:1353
virtual int unsetWatch(TdWatchNotifyMode ulWatchMode, CallBack *pCallBack=0)
Definition GloTAllSet.h:1970
TAllSet< T > & operator=(const TAllSet &)
int getOndemand(glo::TOndemand< T > *&prRetVal, EnSeekMode eMode)
Definition GloTAllSet.h:1502
Referenz (als Attribut) eines persistenten Objekte auf ein anderes persistentes Objekt in der Datenba...
Definition GloTOndemand.h:102
Eine typsichere Liste von Referenzen auf persistente Objekte in der Datenbank (gedacht als Attribut f...
Definition GloTOndemandList.h:95
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:1586
EnSeekMode
Definition GloTypes.h:192
@ END
Definition GloTypes.h:214
@ START
Definition GloTypes.h:203
@ PREVIOUS
Definition GloTypes.h:247
@ NEXT
Definition GloTypes.h:236
EnQueryType
Definition GloTypes.h:1183
unsigned long TdWatchNotifyMode
Definition GloTypes.h:577