ATLAS Offline Software
Loading...
Searching...
No Matches
AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator Class Reference

code only expands with the ASSOCIATIONMAP_CONTEXT More...

#include <AssociationMap.h>

Collaboration diagram for AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator:

Public Member Functions

Constructors and Destructor
 AssociationObjectIterator ()
 default constructor
 AssociationObjectIterator (const store_type &theStore)
 useful alternate constructor
 AssociationObjectIterator (const store_type &theStore, const typename store_type::const_iterator &pos)
 useful alternate constructor
 AssociationObjectIterator (const AssociationObjectIterator &rhs)
 copy constructor
AssociationObjectIteratoroperator= (const AssociationObjectIterator &rhs)
 assignment operator
 ~AssociationObjectIterator ()
 default destructor
Iterator Manipulation
AssociationObjectIterator begin ()
 begin object iterator
AssociationObjectIterator end ()
 end object iterator
AssociationObjectIterator begin () const
AssociationObjectIterator end () const
 end object iterator
AssociationObjectIterator next ()
 forward advancement
AssociationObjectIterator prev ()
 backward stepping
AssociationObjectIterator operator++ ()
 post-forward advancement operator
AssociationObjectIterator operator++ (int)
 pre-forward advancement operator
AssociationObjectIterator operator-- ()
 post-backward stepping operator
AssociationObjectIterator operator-- (int)
 pre-backward stepping operator
Iterator Comparisons
bool operator== (const AssociationObjectIterator &anOther) const
 equality comparison
bool operator!= (const AssociationObjectIterator &anOther) const
 inequality comparison

Data Access

const store_typem_store {}
store_type::const_iterator m_actual {}
AssociationObjectIterator operator* () const
 * operator returns iterator by value
const object_typeoperator-> ()
 access to underlying object
const object_typeoperator-> () const
 access to underlying object
const object_typefirst () const
 access to object pointer
asso_iterator second () const
 access to iterator of first association
AssociationObjectIterator find (const object_type *objectPointer) const
 find a given object in store
const object_typegetObject () const
 retrieve the pointer to a given object
const object_linkgetObjectLink () const
 retrieve link to the object.
bool isValid () const
asso_iterator getFirstAssociation () const
 retrieve iterator to first associated object
asso_iterator getLastAssociation () const
 retrieve end iterator to internal associated object store
asso_iterator findAssociation (const asso_type *assoPointer) const
 find the iterator for a given object
bool containsAssociation (const asso_type *assoPointer) const
 check if the given object can be matched among the associated objects
size_t getNumberOfAssociations () const
 get number of association for current pointed-to object
size_t size () const

Detailed Description

template<class OBJCONT, class ASSCONT>
class AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator

code only expands with the ASSOCIATIONMAP_CONTEXT

The AssociationObjectIterator protects the AssociationMap class from specifics of the internal look-up map.

object iterator for association maps (internal use only!)


This is not a stand-alone class. It can only be compiled within the AssociationMap class, or similar classes providing the required type definitions!

Author
Peter Loch loch@.nosp@m.phys.nosp@m.ics.a.nosp@m.rizo.nosp@m.na.ed.nosp@m.u
Date
June 2, 2004 - first implementation

fn AssociationObjectIterator begin() brief begin object iterator

fn AssociationObjectIterator end() brief end object iterator

fn AssociationObjectIterator next() brief advances iterator forward

fn AssociationObjectIterator prev() brief steps iterator back

fn AssociationObjectIterator operator++() brief same as next()

fn AssociationObjectIterator operator++(int) brief same as next()

fn AssociationObjectIterator operator--() brief same as prev()

fn AssociationObjectIterator operator--(int) brief same as prev()

fn bool operator==(const AssociationObjectIterator&) brief equality comparator

fn bool operator!=(const AssociationObjectIterator&) brief inequality comparator

fn AssociationObjectIterator operator*() brief iterator value access operator

var const object_type* first brief public variable holding object pointer

var asso_iterator second brief public variable holding iterator to associations

fn AssociationObjectIterator find(const object_type*) brief returns iterator for a given object

fn const object_type* getObject() brief get pointer to object (same as first )

fn const object_link& getObjectLink() brief get link to object

fn asso_iterator getFirstAssociation() brief get iterator to first association (same as second.begin() )

fn asso_iterator getLastAssocation() brief get end iterator for associations (same as second.end() )

fn asso_iterator findAssociation(const asso_type*) brief returns iterator for specific associated object

fn bool containsAssociation(const asso_type*) brief checks if given object is associated with current object

fn size_t size() brief number of associations for current object

Definition at line 89 of file AssociationMap.h.

Constructor & Destructor Documentation

◆ AssociationObjectIterator() [1/4]

template<class OBJCONT, class ASSCONT>
AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::AssociationObjectIterator ( )
inline

default constructor

Definition at line 96 of file AssociationMap.h.

◆ AssociationObjectIterator() [2/4]

template<class OBJCONT, class ASSCONT>
AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::AssociationObjectIterator ( const store_type & theStore)
inline

useful alternate constructor

Parameters
theStore- reference to association map

Definition at line 103 of file AssociationMap.h.

◆ AssociationObjectIterator() [3/4]

template<class OBJCONT, class ASSCONT>
AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::AssociationObjectIterator ( const store_type & theStore,
const typename store_type::const_iterator & pos )
inline

useful alternate constructor

Parameters
theStore- reference to association map
pos- reference to a position in the association map

Definition at line 113 of file AssociationMap.h.

◆ AssociationObjectIterator() [4/4]

template<class OBJCONT, class ASSCONT>
AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::AssociationObjectIterator ( const AssociationObjectIterator & rhs)
inline

copy constructor

Definition at line 121 of file AssociationMap.h.

◆ ~AssociationObjectIterator()

template<class OBJCONT, class ASSCONT>
AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::~AssociationObjectIterator ( )
inline

default destructor

Definition at line 138 of file AssociationMap.h.

Member Function Documentation

◆ begin() [1/2]

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::begin ( )
inline

begin object iterator

Definition at line 146 of file AssociationMap.h.

147 { return this->size(); }
size_t size()
get number of associations

◆ begin() [2/2]

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::begin ( ) const
inline

Definition at line 153 of file AssociationMap.h.

◆ containsAssociation()

template<class OBJCONT, class ASSCONT>
bool AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::containsAssociation ( const asso_type * assoPointer) const
inline

check if the given object can be matched among the associated objects

Definition at line 297 of file AssociationMap.h.

335{
336 public:
337
342 typedef
343 typename
348
351 typedef
352 typename
355 typedef typename std::list<const asso_type*> asso_list;
360 typedef typename store_type::iterator store_iterator_type;
362
363 // Dummy to allow defining an end iterator for an empty map.
364 static const asso_store s_dum_asso_store;
365
369 virtual ~AssociationMap();
371
372
382
400 const asso_type* assoPointer);
402 const asso_link& assoLink);
404
417
425
427
428
429
432 { return (*objectIter).getObject(); }
433
437
439 bool containsObject(const object_type* theObject) const
440 { return this->findObject(theObject) != this->endObject(); }
441
443 size_t getNumberOfObjects() const { return this->size(); }
444
448
449
451 { return *assoIter; }
452
455 const asso_type* assoPointer) const
458 const asso_type* assoPointer) const;
459
462 const asso_type* assoPointer) const
464
466 const asso_type* assoPointer) const;
467 bool containsAssociation(const asso_type* assoPointer) const;
468
471
474 { return this->getObjects(*assoIter,theObjects); }
475
478
481 { return this->getAssociations(objIter.getObject(),assocs); }
482
484 size_t size() { return m_associationMap.size(); }
485
487 size_t size() const { return m_associationMap.size(); }
488
489 size_t size(const object_type* objectPointer) const;
490
492 { return this->size(objectPointer); }
493
494 size_t size(const object_iterator& objectIter) const
496
498 { return this->size(objectIter); }
499
500 protected:
501
504
507 const asso_link& assoLink)
508 {
509 // check key
513 iMap != mapEnd;
514 ++iMap ) {
515 // look for the address of the pointed-at object
516 // must dereference the ElementLink pointer
517 if ( iMap->first.cptr() == objectLink.cptr() ) {
518 foundIter = iMap;
519 break;
520 }
521 }
522
523 if ( foundIter == m_associationMap.end() ) { return foundIter; }
524 // check data
525 if ( std::find((foundIter->second).begin(),
526 (foundIter->second).end(),
527 assoLink) !=
528 (foundIter->second).end() )
529 { return foundIter; }
530 // not found at all
531 return m_associationMap.end();
532 }
533
536
537};
538
540
541#undef ASSOCIATION_CONTEXT
542#undef ASSOCIATIONMAP_CONTEXT
543#endif
AssociationObjectIterator find(const object_type *objectPointer) const
find a given object in store
const object_type * getObject() const
retrieve the pointer to a given object
bool containsAssociation(const asso_type *assoPointer) const
check if the given object can be matched among the associated objects
size_t getNumberOfAssociations() const
get number of association for current pointed-to object
asso_iterator findAssociation(const asso_type *assoPointer) const
find the iterator for a given object
templated base class for a look-up map for associations
const asso_type * getAssociation(asso_iterator assoIter) const
associations iterator access
virtual ~AssociationMap()
asso_iterator beginAssociation(const object_type *objectPointer) const
begin iterator for associations
const object_type * getObject(const object_iterator &objectIter) const
get association iterators by object iterator
store_iterator_type internalFind(const object_link &objectLink, const asso_link &assoLink)
internally used find method
bool containsAssociation(const object_iterator &objectIter, const asso_type *assoPointer) const
containment check
AssociationObjectIterator object_iterator
object iterator type
object_iterator endObject() const
end iterator for objects
size_t getNumberOfAssociations(const object_type *objectPointer) const
bool getAssociations(const object_type *objPointer, asso_list &assocs) const
get all associations for a given object
size_t getNumberOfObjects() const
retrieve number of objects in store
void addAssociation(const object_container_type *objectContainer, const object_index_type &objectIndex, const asso_container_type *assoContainer, const asso_index_type &assoIndex)
bool getObjects(const asso_type *assoPointer, object_list &theObjects) const
get all objects for a given association
object_iterator findObject(const object_type *theObject) const
finding an object with allocation
bool addToStore(const object_link &objectLink, const asso_link &assoLink)
internally used function to add links to store
asso_iterator endAssociation(const object_type *objectPointer) const
end iterator for associations
bool containsObject(const object_type *theObject) const
testing if object is in store
asso_iterator findAssociation(const object_iterator &objectIter, const asso_type *assoPointer) const
find association
object_iterator beginObject() const
begin iterator for objects
ELVIterator< typename RefVector::const_iterator > const_iterator

◆ end() [1/2]

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::end ( )
inline

end object iterator

Definition at line 150 of file AssociationMap.h.

◆ end() [2/2]

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::end ( ) const
inline

end object iterator

Definition at line 157 of file AssociationMap.h.

◆ find()

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::find ( const object_type * objectPointer) const
inline

find a given object in store

Parameters
objectPointer- pointer reference to the object searched for

This method returns an AssociationObjectIterator which can immediately provide access to the associations using the second public variable, the appropriate getFirstAssociation, getLastAssociation methods.

Definition at line 244 of file AssociationMap.h.

◆ findAssociation()

template<class OBJCONT, class ASSCONT>
asso_iterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::findAssociation ( const asso_type * assoPointer) const
inline

find the iterator for a given object

Definition at line 289 of file AssociationMap.h.

327{
328 public:
329
334 typedef
335 typename
340
343 typedef
344 typename
347 typedef typename std::list<const asso_type*> asso_list;
352 typedef typename store_type::iterator store_iterator_type;
354
355 // Dummy to allow defining an end iterator for an empty map.
356 static const asso_store s_dum_asso_store;
357
361 virtual ~AssociationMap();
363
364
374
392 const asso_type* assoPointer);
394 const asso_link& assoLink);
396
409
417
419
420
421
424 { return (*objectIter).getObject(); }
425
429
431 bool containsObject(const object_type* theObject) const
432 { return this->findObject(theObject) != this->endObject(); }
433
435 size_t getNumberOfObjects() const { return this->size(); }
436
440
441
443 { return *assoIter; }
444
447 const asso_type* assoPointer) const
450 const asso_type* assoPointer) const;
451
454 const asso_type* assoPointer) const
456
458 const asso_type* assoPointer) const;
459 bool containsAssociation(const asso_type* assoPointer) const;
460
463
466 { return this->getObjects(*assoIter,theObjects); }
467
470
473 { return this->getAssociations(objIter.getObject(),assocs); }
474
476 size_t size() { return m_associationMap.size(); }
477
479 size_t size() const { return m_associationMap.size(); }
480
481 size_t size(const object_type* objectPointer) const;
482
484 { return this->size(objectPointer); }
485
486 size_t size(const object_iterator& objectIter) const
488
490 { return this->size(objectIter); }
491
492 protected:
493
496
499 const asso_link& assoLink)
500 {
501 // check key
505 iMap != mapEnd;
506 ++iMap ) {
507 // look for the address of the pointed-at object
508 // must dereference the ElementLink pointer
509 if ( iMap->first.cptr() == objectLink.cptr() ) {
510 foundIter = iMap;
511 break;
512 }
513 }
514
515 if ( foundIter == m_associationMap.end() ) { return foundIter; }
516 // check data
517 if ( std::find((foundIter->second).begin(),
518 (foundIter->second).end(),
519 assoLink) !=
520 (foundIter->second).end() )
521 { return foundIter; }
522 // not found at all
523 return m_associationMap.end();
524 }
525
528
529};
530
532
533#undef ASSOCIATION_CONTEXT
534#undef ASSOCIATIONMAP_CONTEXT
535#endif

◆ first()

template<class OBJCONT, class ASSCONT>
const object_type * AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::first ( ) const
inline

access to object pointer

Definition at line 232 of file AssociationMap.h.

◆ getFirstAssociation()

template<class OBJCONT, class ASSCONT>
asso_iterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::getFirstAssociation ( ) const
inline

retrieve iterator to first associated object

Definition at line 277 of file AssociationMap.h.

315{
316 public:
317
322 typedef
323 typename
328
331 typedef
332 typename
335 typedef typename std::list<const asso_type*> asso_list;
340 typedef typename store_type::iterator store_iterator_type;
342
343 // Dummy to allow defining an end iterator for an empty map.
344 static const asso_store s_dum_asso_store;
345
349 virtual ~AssociationMap();
351
352
362
380 const asso_type* assoPointer);
382 const asso_link& assoLink);
384
397
405
407
408
409
412 { return (*objectIter).getObject(); }
413
417
419 bool containsObject(const object_type* theObject) const
420 { return this->findObject(theObject) != this->endObject(); }
421
423 size_t getNumberOfObjects() const { return this->size(); }
424
428
429
431 { return *assoIter; }
432
435 const asso_type* assoPointer) const
438 const asso_type* assoPointer) const;
439
442 const asso_type* assoPointer) const
444
446 const asso_type* assoPointer) const;
447 bool containsAssociation(const asso_type* assoPointer) const;
448
451
454 { return this->getObjects(*assoIter,theObjects); }
455
458
461 { return this->getAssociations(objIter.getObject(),assocs); }
462
464 size_t size() { return m_associationMap.size(); }
465
467 size_t size() const { return m_associationMap.size(); }
468
469 size_t size(const object_type* objectPointer) const;
470
472 { return this->size(objectPointer); }
473
474 size_t size(const object_iterator& objectIter) const
476
478 { return this->size(objectIter); }
479
480 protected:
481
484
487 const asso_link& assoLink)
488 {
489 // check key
493 iMap != mapEnd;
494 ++iMap ) {
495 // look for the address of the pointed-at object
496 // must dereference the ElementLink pointer
497 if ( iMap->first.cptr() == objectLink.cptr() ) {
498 foundIter = iMap;
499 break;
500 }
501 }
502
503 if ( foundIter == m_associationMap.end() ) { return foundIter; }
504 // check data
505 if ( std::find((foundIter->second).begin(),
506 (foundIter->second).end(),
507 assoLink) !=
508 (foundIter->second).end() )
509 { return foundIter; }
510 // not found at all
511 return m_associationMap.end();
512 }
513
516
517};
518
520
521#undef ASSOCIATION_CONTEXT
522#undef ASSOCIATIONMAP_CONTEXT
523#endif

◆ getLastAssociation()

template<class OBJCONT, class ASSCONT>
asso_iterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::getLastAssociation ( ) const
inline

retrieve end iterator to internal associated object store

Definition at line 283 of file AssociationMap.h.

321{
322 public:
323
328 typedef
329 typename
334
337 typedef
338 typename
341 typedef typename std::list<const asso_type*> asso_list;
346 typedef typename store_type::iterator store_iterator_type;
348
349 // Dummy to allow defining an end iterator for an empty map.
350 static const asso_store s_dum_asso_store;
351
355 virtual ~AssociationMap();
357
358
368
386 const asso_type* assoPointer);
388 const asso_link& assoLink);
390
403
411
413
414
415
418 { return (*objectIter).getObject(); }
419
423
425 bool containsObject(const object_type* theObject) const
426 { return this->findObject(theObject) != this->endObject(); }
427
429 size_t getNumberOfObjects() const { return this->size(); }
430
434
435
437 { return *assoIter; }
438
441 const asso_type* assoPointer) const
444 const asso_type* assoPointer) const;
445
448 const asso_type* assoPointer) const
450
452 const asso_type* assoPointer) const;
453 bool containsAssociation(const asso_type* assoPointer) const;
454
457
460 { return this->getObjects(*assoIter,theObjects); }
461
464
467 { return this->getAssociations(objIter.getObject(),assocs); }
468
470 size_t size() { return m_associationMap.size(); }
471
473 size_t size() const { return m_associationMap.size(); }
474
475 size_t size(const object_type* objectPointer) const;
476
478 { return this->size(objectPointer); }
479
480 size_t size(const object_iterator& objectIter) const
482
484 { return this->size(objectIter); }
485
486 protected:
487
490
493 const asso_link& assoLink)
494 {
495 // check key
499 iMap != mapEnd;
500 ++iMap ) {
501 // look for the address of the pointed-at object
502 // must dereference the ElementLink pointer
503 if ( iMap->first.cptr() == objectLink.cptr() ) {
504 foundIter = iMap;
505 break;
506 }
507 }
508
509 if ( foundIter == m_associationMap.end() ) { return foundIter; }
510 // check data
511 if ( std::find((foundIter->second).begin(),
512 (foundIter->second).end(),
513 assoLink) !=
514 (foundIter->second).end() )
515 { return foundIter; }
516 // not found at all
517 return m_associationMap.end();
518 }
519
522
523};
524
526
527#undef ASSOCIATION_CONTEXT
528#undef ASSOCIATIONMAP_CONTEXT
529#endif

◆ getNumberOfAssociations()

template<class OBJCONT, class ASSCONT>
size_t AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::getNumberOfAssociations ( ) const
inline

get number of association for current pointed-to object

Definition at line 301 of file AssociationMap.h.

339{
340 public:
341
346 typedef
347 typename
352
355 typedef
356 typename
359 typedef typename std::list<const asso_type*> asso_list;
364 typedef typename store_type::iterator store_iterator_type;
366
367 // Dummy to allow defining an end iterator for an empty map.
368 static const asso_store s_dum_asso_store;
369
373 virtual ~AssociationMap();
375
376
386
404 const asso_type* assoPointer);
406 const asso_link& assoLink);
408
421
429
431
432
433
436 { return (*objectIter).getObject(); }
437
441
443 bool containsObject(const object_type* theObject) const
444 { return this->findObject(theObject) != this->endObject(); }
445
447 size_t getNumberOfObjects() const { return this->size(); }
448
452
453
455 { return *assoIter; }
456
459 const asso_type* assoPointer) const
462 const asso_type* assoPointer) const;
463
466 const asso_type* assoPointer) const
468
470 const asso_type* assoPointer) const;
471 bool containsAssociation(const asso_type* assoPointer) const;
472
475
478 { return this->getObjects(*assoIter,theObjects); }
479
482
485 { return this->getAssociations(objIter.getObject(),assocs); }
486
488 size_t size() { return m_associationMap.size(); }
489
491 size_t size() const { return m_associationMap.size(); }
492
493 size_t size(const object_type* objectPointer) const;
494
496 { return this->size(objectPointer); }
497
498 size_t size(const object_iterator& objectIter) const
500
502 { return this->size(objectIter); }
503
504 protected:
505
508
511 const asso_link& assoLink)
512 {
513 // check key
517 iMap != mapEnd;
518 ++iMap ) {
519 // look for the address of the pointed-at object
520 // must dereference the ElementLink pointer
521 if ( iMap->first.cptr() == objectLink.cptr() ) {
522 foundIter = iMap;
523 break;
524 }
525 }
526
527 if ( foundIter == m_associationMap.end() ) { return foundIter; }
528 // check data
529 if ( std::find((foundIter->second).begin(),
530 (foundIter->second).end(),
531 assoLink) !=
532 (foundIter->second).end() )
533 { return foundIter; }
534 // not found at all
535 return m_associationMap.end();
536 }
537
540
541};
542
544
545#undef ASSOCIATION_CONTEXT
546#undef ASSOCIATIONMAP_CONTEXT
547#endif

◆ getObject()

template<class OBJCONT, class ASSCONT>
const object_type * AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::getObject ( ) const
inline

retrieve the pointer to a given object

This method allows direct access to the object pointer stored in each AssociationObjectIterator instance.

Definition at line 269 of file AssociationMap.h.

307{
308 public:
309
314 typedef
315 typename
320
323 typedef
324 typename
327 typedef typename std::list<const asso_type*> asso_list;
332 typedef typename store_type::iterator store_iterator_type;
334
335 // Dummy to allow defining an end iterator for an empty map.
336 static const asso_store s_dum_asso_store;
337
341 virtual ~AssociationMap();
343
344
354
372 const asso_type* assoPointer);
374 const asso_link& assoLink);
376
389
397
399
400
401
404 { return (*objectIter).getObject(); }
405
409
411 bool containsObject(const object_type* theObject) const
412 { return this->findObject(theObject) != this->endObject(); }
413
415 size_t getNumberOfObjects() const { return this->size(); }
416
420
421
423 { return *assoIter; }
424
427 const asso_type* assoPointer) const
430 const asso_type* assoPointer) const;
431
434 const asso_type* assoPointer) const
436
438 const asso_type* assoPointer) const;
439 bool containsAssociation(const asso_type* assoPointer) const;
440
443
446 { return this->getObjects(*assoIter,theObjects); }
447
450
453 { return this->getAssociations(objIter.getObject(),assocs); }
454
456 size_t size() { return m_associationMap.size(); }
457
459 size_t size() const { return m_associationMap.size(); }
460
461 size_t size(const object_type* objectPointer) const;
462
464 { return this->size(objectPointer); }
465
466 size_t size(const object_iterator& objectIter) const
468
470 { return this->size(objectIter); }
471
472 protected:
473
476
479 const asso_link& assoLink)
480 {
481 // check key
485 iMap != mapEnd;
486 ++iMap ) {
487 // look for the address of the pointed-at object
488 // must dereference the ElementLink pointer
489 if ( iMap->first.cptr() == objectLink.cptr() ) {
490 foundIter = iMap;
491 break;
492 }
493 }
494
495 if ( foundIter == m_associationMap.end() ) { return foundIter; }
496 // check data
497 if ( std::find((foundIter->second).begin(),
498 (foundIter->second).end(),
499 assoLink) !=
500 (foundIter->second).end() )
501 { return foundIter; }
502 // not found at all
503 return m_associationMap.end();
504 }
505
508
509};
510
512
513#undef ASSOCIATION_CONTEXT
514#undef ASSOCIATIONMAP_CONTEXT
515#endif

◆ getObjectLink()

template<class OBJCONT, class ASSCONT>
const object_link & AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::getObjectLink ( ) const
inline

retrieve link to the object.

Definition at line 272 of file AssociationMap.h.

310{
311 public:
312
317 typedef
318 typename
323
326 typedef
327 typename
330 typedef typename std::list<const asso_type*> asso_list;
335 typedef typename store_type::iterator store_iterator_type;
337
338 // Dummy to allow defining an end iterator for an empty map.
339 static const asso_store s_dum_asso_store;
340
344 virtual ~AssociationMap();
346
347
357
375 const asso_type* assoPointer);
377 const asso_link& assoLink);
379
392
400
402
403
404
407 { return (*objectIter).getObject(); }
408
412
414 bool containsObject(const object_type* theObject) const
415 { return this->findObject(theObject) != this->endObject(); }
416
418 size_t getNumberOfObjects() const { return this->size(); }
419
423
424
426 { return *assoIter; }
427
430 const asso_type* assoPointer) const
433 const asso_type* assoPointer) const;
434
437 const asso_type* assoPointer) const
439
441 const asso_type* assoPointer) const;
442 bool containsAssociation(const asso_type* assoPointer) const;
443
446
449 { return this->getObjects(*assoIter,theObjects); }
450
453
456 { return this->getAssociations(objIter.getObject(),assocs); }
457
459 size_t size() { return m_associationMap.size(); }
460
462 size_t size() const { return m_associationMap.size(); }
463
464 size_t size(const object_type* objectPointer) const;
465
467 { return this->size(objectPointer); }
468
469 size_t size(const object_iterator& objectIter) const
471
473 { return this->size(objectIter); }
474
475 protected:
476
479
482 const asso_link& assoLink)
483 {
484 // check key
488 iMap != mapEnd;
489 ++iMap ) {
490 // look for the address of the pointed-at object
491 // must dereference the ElementLink pointer
492 if ( iMap->first.cptr() == objectLink.cptr() ) {
493 foundIter = iMap;
494 break;
495 }
496 }
497
498 if ( foundIter == m_associationMap.end() ) { return foundIter; }
499 // check data
500 if ( std::find((foundIter->second).begin(),
501 (foundIter->second).end(),
502 assoLink) !=
503 (foundIter->second).end() )
504 { return foundIter; }
505 // not found at all
506 return m_associationMap.end();
507 }
508
511
512};
513
515
516#undef ASSOCIATION_CONTEXT
517#undef ASSOCIATIONMAP_CONTEXT
518#endif

◆ isValid()

template<class OBJCONT, class ASSCONT>
bool AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::isValid ( ) const
inline

Definition at line 274 of file AssociationMap.h.

312{
313 public:
314
319 typedef
320 typename
325
328 typedef
329 typename
332 typedef typename std::list<const asso_type*> asso_list;
337 typedef typename store_type::iterator store_iterator_type;
339
340 // Dummy to allow defining an end iterator for an empty map.
341 static const asso_store s_dum_asso_store;
342
346 virtual ~AssociationMap();
348
349
359
377 const asso_type* assoPointer);
379 const asso_link& assoLink);
381
394
402
404
405
406
409 { return (*objectIter).getObject(); }
410
414
416 bool containsObject(const object_type* theObject) const
417 { return this->findObject(theObject) != this->endObject(); }
418
420 size_t getNumberOfObjects() const { return this->size(); }
421
425
426
428 { return *assoIter; }
429
432 const asso_type* assoPointer) const
435 const asso_type* assoPointer) const;
436
439 const asso_type* assoPointer) const
441
443 const asso_type* assoPointer) const;
444 bool containsAssociation(const asso_type* assoPointer) const;
445
448
451 { return this->getObjects(*assoIter,theObjects); }
452
455
458 { return this->getAssociations(objIter.getObject(),assocs); }
459
461 size_t size() { return m_associationMap.size(); }
462
464 size_t size() const { return m_associationMap.size(); }
465
466 size_t size(const object_type* objectPointer) const;
467
469 { return this->size(objectPointer); }
470
471 size_t size(const object_iterator& objectIter) const
473
475 { return this->size(objectIter); }
476
477 protected:
478
481
484 const asso_link& assoLink)
485 {
486 // check key
490 iMap != mapEnd;
491 ++iMap ) {
492 // look for the address of the pointed-at object
493 // must dereference the ElementLink pointer
494 if ( iMap->first.cptr() == objectLink.cptr() ) {
495 foundIter = iMap;
496 break;
497 }
498 }
499
500 if ( foundIter == m_associationMap.end() ) { return foundIter; }
501 // check data
502 if ( std::find((foundIter->second).begin(),
503 (foundIter->second).end(),
504 assoLink) !=
505 (foundIter->second).end() )
506 { return foundIter; }
507 // not found at all
508 return m_associationMap.end();
509 }
510
513
514};
515
517
518#undef ASSOCIATION_CONTEXT
519#undef ASSOCIATIONMAP_CONTEXT
520#endif

◆ next()

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::next ( )
inline

forward advancement

Definition at line 161 of file AssociationMap.h.

◆ operator!=()

template<class OBJCONT, class ASSCONT>
bool AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::operator!= ( const AssociationObjectIterator & anOther) const
inline

inequality comparison

Parameters
anOther- an other AssociationObjectIterator

Definition at line 205 of file AssociationMap.h.

◆ operator*()

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::operator* ( ) const
inline

* operator returns iterator by value

Warning
This is not the standard behavior of STL-like iterators! This implementation hides the actual value type, though, because it is not the object type, as clients would probably expect. The stored objects can be accessed using the specialized methods provided by this class.

Definition at line 221 of file AssociationMap.h.

221{

◆ operator++() [1/2]

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::operator++ ( )
inline

post-forward advancement operator

Definition at line 169 of file AssociationMap.h.

◆ operator++() [2/2]

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::operator++ ( int )
inline

pre-forward advancement operator

Definition at line 177 of file AssociationMap.h.

◆ operator--() [1/2]

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::operator-- ( )
inline

post-backward stepping operator

Definition at line 180 of file AssociationMap.h.

185 { return this->getAssociations(objIter.getObject(),assocs); }

◆ operator--() [2/2]

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::operator-- ( int )
inline

pre-backward stepping operator

Definition at line 188 of file AssociationMap.h.

188{ return m_associationMap.size(); }

◆ operator->() [1/2]

template<class OBJCONT, class ASSCONT>
const object_type * AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::operator-> ( )
inline

access to underlying object

Definition at line 224 of file AssociationMap.h.

◆ operator->() [2/2]

template<class OBJCONT, class ASSCONT>
const object_type * AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::operator-> ( ) const
inline

access to underlying object

Definition at line 228 of file AssociationMap.h.

◆ operator=()

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator & AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::operator= ( const AssociationObjectIterator & rhs)
inline

assignment operator

Definition at line 128 of file AssociationMap.h.

◆ operator==()

template<class OBJCONT, class ASSCONT>
bool AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::operator== ( const AssociationObjectIterator & anOther) const
inline

equality comparison

Parameters
anOther- an other AssociationObjectIterator

Definition at line 197 of file AssociationMap.h.

◆ prev()

template<class OBJCONT, class ASSCONT>
AssociationObjectIterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::prev ( )
inline

backward stepping

Definition at line 165 of file AssociationMap.h.

◆ second()

template<class OBJCONT, class ASSCONT>
asso_iterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::second ( ) const
inline

access to iterator of first association

Definition at line 234 of file AssociationMap.h.

◆ size()

template<class OBJCONT, class ASSCONT>
size_t AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::size ( ) const
inline

Definition at line 304 of file AssociationMap.h.

342{
343 public:
344
349 typedef
350 typename
355
358 typedef
359 typename
362 typedef typename std::list<const asso_type*> asso_list;
367 typedef typename store_type::iterator store_iterator_type;
369
370 // Dummy to allow defining an end iterator for an empty map.
371 static const asso_store s_dum_asso_store;
372
376 virtual ~AssociationMap();
378
379
389
407 const asso_type* assoPointer);
409 const asso_link& assoLink);
411
424
432
434
435
436
439 { return (*objectIter).getObject(); }
440
444
446 bool containsObject(const object_type* theObject) const
447 { return this->findObject(theObject) != this->endObject(); }
448
450 size_t getNumberOfObjects() const { return this->size(); }
451
455
456
458 { return *assoIter; }
459
462 const asso_type* assoPointer) const
465 const asso_type* assoPointer) const;
466
469 const asso_type* assoPointer) const
471
473 const asso_type* assoPointer) const;
474 bool containsAssociation(const asso_type* assoPointer) const;
475
478
481 { return this->getObjects(*assoIter,theObjects); }
482
485
488 { return this->getAssociations(objIter.getObject(),assocs); }
489
491 size_t size() { return m_associationMap.size(); }
492
494 size_t size() const { return m_associationMap.size(); }
495
496 size_t size(const object_type* objectPointer) const;
497
499 { return this->size(objectPointer); }
500
501 size_t size(const object_iterator& objectIter) const
503
505 { return this->size(objectIter); }
506
507 protected:
508
511
514 const asso_link& assoLink)
515 {
516 // check key
520 iMap != mapEnd;
521 ++iMap ) {
522 // look for the address of the pointed-at object
523 // must dereference the ElementLink pointer
524 if ( iMap->first.cptr() == objectLink.cptr() ) {
525 foundIter = iMap;
526 break;
527 }
528 }
529
530 if ( foundIter == m_associationMap.end() ) { return foundIter; }
531 // check data
532 if ( std::find((foundIter->second).begin(),
533 (foundIter->second).end(),
534 assoLink) !=
535 (foundIter->second).end() )
536 { return foundIter; }
537 // not found at all
538 return m_associationMap.end();
539 }
540
543
544};
545
547
548#undef ASSOCIATION_CONTEXT
549#undef ASSOCIATIONMAP_CONTEXT
550#endif

Member Data Documentation

◆ m_actual

template<class OBJCONT, class ASSCONT>
store_type::const_iterator AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::m_actual {}
private

Definition at line 309 of file AssociationMap.h.

347{
348 public:
349
354 typedef
355 typename
360
363 typedef
364 typename
367 typedef typename std::list<const asso_type*> asso_list;
372 typedef typename store_type::iterator store_iterator_type;
374
375 // Dummy to allow defining an end iterator for an empty map.
376 static const asso_store s_dum_asso_store;
377
381 virtual ~AssociationMap();
383
384
394
412 const asso_type* assoPointer);
414 const asso_link& assoLink);
416
429
437
439
440
441
444 { return (*objectIter).getObject(); }
445
449
451 bool containsObject(const object_type* theObject) const
452 { return this->findObject(theObject) != this->endObject(); }
453
455 size_t getNumberOfObjects() const { return this->size(); }
456
460
461
463 { return *assoIter; }
464
467 const asso_type* assoPointer) const
470 const asso_type* assoPointer) const;
471
474 const asso_type* assoPointer) const
476
478 const asso_type* assoPointer) const;
479 bool containsAssociation(const asso_type* assoPointer) const;
480
483
486 { return this->getObjects(*assoIter,theObjects); }
487
490
493 { return this->getAssociations(objIter.getObject(),assocs); }
494
496 size_t size() { return m_associationMap.size(); }
497
499 size_t size() const { return m_associationMap.size(); }
500
501 size_t size(const object_type* objectPointer) const;
502
504 { return this->size(objectPointer); }
505
506 size_t size(const object_iterator& objectIter) const
508
510 { return this->size(objectIter); }
511
512 protected:
513
516
519 const asso_link& assoLink)
520 {
521 // check key
525 iMap != mapEnd;
526 ++iMap ) {
527 // look for the address of the pointed-at object
528 // must dereference the ElementLink pointer
529 if ( iMap->first.cptr() == objectLink.cptr() ) {
530 foundIter = iMap;
531 break;
532 }
533 }
534
535 if ( foundIter == m_associationMap.end() ) { return foundIter; }
536 // check data
537 if ( std::find((foundIter->second).begin(),
538 (foundIter->second).end(),
539 assoLink) !=
540 (foundIter->second).end() )
541 { return foundIter; }
542 // not found at all
543 return m_associationMap.end();
544 }
545
548
549};
550
552
553#undef ASSOCIATION_CONTEXT
554#undef ASSOCIATIONMAP_CONTEXT
555#endif

◆ m_store

template<class OBJCONT, class ASSCONT>
const store_type* AssociationMap< OBJCONT, ASSCONT >::AssociationObjectIterator::m_store {}
private

Definition at line 308 of file AssociationMap.h.

346{
347 public:
348
353 typedef
354 typename
359
362 typedef
363 typename
366 typedef typename std::list<const asso_type*> asso_list;
371 typedef typename store_type::iterator store_iterator_type;
373
374 // Dummy to allow defining an end iterator for an empty map.
375 static const asso_store s_dum_asso_store;
376
380 virtual ~AssociationMap();
382
383
393
411 const asso_type* assoPointer);
413 const asso_link& assoLink);
415
428
436
438
439
440
443 { return (*objectIter).getObject(); }
444
448
450 bool containsObject(const object_type* theObject) const
451 { return this->findObject(theObject) != this->endObject(); }
452
454 size_t getNumberOfObjects() const { return this->size(); }
455
459
460
462 { return *assoIter; }
463
466 const asso_type* assoPointer) const
469 const asso_type* assoPointer) const;
470
473 const asso_type* assoPointer) const
475
477 const asso_type* assoPointer) const;
478 bool containsAssociation(const asso_type* assoPointer) const;
479
482
485 { return this->getObjects(*assoIter,theObjects); }
486
489
492 { return this->getAssociations(objIter.getObject(),assocs); }
493
495 size_t size() { return m_associationMap.size(); }
496
498 size_t size() const { return m_associationMap.size(); }
499
500 size_t size(const object_type* objectPointer) const;
501
503 { return this->size(objectPointer); }
504
505 size_t size(const object_iterator& objectIter) const
507
509 { return this->size(objectIter); }
510
511 protected:
512
515
518 const asso_link& assoLink)
519 {
520 // check key
524 iMap != mapEnd;
525 ++iMap ) {
526 // look for the address of the pointed-at object
527 // must dereference the ElementLink pointer
528 if ( iMap->first.cptr() == objectLink.cptr() ) {
529 foundIter = iMap;
530 break;
531 }
532 }
533
534 if ( foundIter == m_associationMap.end() ) { return foundIter; }
535 // check data
536 if ( std::find((foundIter->second).begin(),
537 (foundIter->second).end(),
538 assoLink) !=
539 (foundIter->second).end() )
540 { return foundIter; }
541 // not found at all
542 return m_associationMap.end();
543 }
544
547
548};
549
551
552#undef ASSOCIATION_CONTEXT
553#undef ASSOCIATIONMAP_CONTEXT
554#endif

The documentation for this class was generated from the following file: