VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
keyedVrfObjectIterator.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
17 
18 #pragma once
19 
20 #include "vrfcore/simManager.h"
22 
23 template<class T> class DtBaseSimObjectIterator : public DtIteratorBase<T>
24 {
25 private:
26 
27  //Default constructor. Do not use.
29 
31  const DtBaseSimObjectIterator& orig);
32 
33 public:
34 
39  simObjectManager) : DtIteratorBase<T>(list), mySimObjectManager(simObjectManager) {};
40 
43  DtIteratorBase<T>(orig),
45 
48 
49  T* first(bool move = true)
50  {
51  return dataToObject(this->internalFirst(move));
52  };
53  T* next(bool move = true)
54  {
55  return dataToObject(this->internalNext(move));
56  };
57  T* prev(bool move = true)
58  {
59  return dataToObject(this->internalPrev(move));
60  };
61  T* last(bool move = true)
62  {
63  return dataToObject(this->internalLast(move));
64  };
65  T* wrapNext(bool move = true)
66  {
67  return dataToObject(this->internalWrapNext(move));
68  };
69  T* wrapPrev(bool move = true)
70  {
71  return dataToObject(this->internalWrapPrev(move));
72  };
73 
74 protected:
75  T* dataToObject(const void* data) const
76  {
77  DtEntityIdentifier* keyP = (DtEntityIdentifier*) data;
78  if (keyP)
79  {
81 
82  if (object.isValid())
83  {
84  return *object;
85  }
86  }
87 
88  return NULL;
89  }
90 
91 protected:
93 };
94 
T * wrapPrev(bool move=true)
Definition: keyedVrfObjectIterator.h:69
const DtSimManager * mySimObjectManager
Definition: keyedVrfObjectIterator.h:92
virtual T * internalWrapPrev(bool move=true)
Definition: iteratorBase.h:309
DtBaseSimObjectIterator(const DtBaseSimObjectIterator &orig)
Copy Contructor.
Definition: keyedVrfObjectIterator.h:42
T * prev(bool move=true)
Definition: keyedVrfObjectIterator.h:57
DtBaseSimObjectIterator(const DtList &list, const DtSimManager *simObjectManager)
Constructor.
Definition: keyedVrfObjectIterator.h:38
T * wrapNext(bool move=true)
Definition: keyedVrfObjectIterator.h:65
const DtBaseSimObjectIterator & operator=(const DtBaseSimObjectIterator &orig)
DtBaseSimObjectIterator< const DtVrfObject > DtKeyedVrfObjectIterator
Definition: keyedVrfObjectIterator.h:95
virtual ~DtBaseSimObjectIterator()
Destructor.
Definition: keyedVrfObjectIterator.h:47
virtual const DtList & list()
Definition: iteratorBase.h:59
DtSharedVrfObjectReference class will allocate an empty DtVrfObjectReference if one is not assigned s...
Definition: vrfObjectReference.h:102
Description: DtIteratorBase is the base class for iterators used to iterate over a DtList...
Definition: iteratorBase.h:32
virtual T * internalFirst(bool move=true)
Returns the first vertex in the list if going DtIteratorForward, and the last vertex if going DtItera...
Definition: iteratorBase.h:149
virtual T * internalWrapNext(bool move=true)
If the cursor is 0, returns 0 (move is ignored in this case).
Definition: iteratorBase.h:270
File: keyedObjIter.h.
Definition: keyedVrfObjectIterator.h:23
virtual T * internalPrev(bool move=true)
If the cursor is 0, returns 0 (move is ignored in this case).
Definition: iteratorBase.h:294
T * last(bool move=true)
Definition: keyedVrfObjectIterator.h:61
virtual DtSharedVrfObjectReference lookupVrfObjectByEntityIdentifier(const DtEntityIdentifier &key) const
Looks up a DtVrfObject*, given a DtEntityIdentifier.
T * first(bool move=true)
Definition: keyedVrfObjectIterator.h:49
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
virtual DtVrfObjectManager * vrfObjectManager()
T * dataToObject(const void *data) const
Definition: keyedVrfObjectIterator.h:75
T * next(bool move=true)
Definition: keyedVrfObjectIterator.h:53
virtual T * internalLast(bool move=true)
Returns the last vertex in the list if going DtIteratorForward, and the first vertex if going DtItera...
Definition: iteratorBase.h:230
virtual T * internalNext(bool move=true)
Definition: iteratorBase.h:209

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)