VR-Forces 4.2 Class Documentation
keyedObjIter.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2005 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: keyedObjIter.h,v $ $Revision: 1.8 $ $State: Exp $
7 *******************************************************************************/
8 
11 
20 
21 #ifndef DtKeyedSimObjectIterator_H_
22 #define DtKeyedSimObjectIterator_H_
23 
24 #include "vrfobjcore/vrfObjMgr.h"
25 
26 template<class T> class DtBaseSimObjectIterator : public DtIteratorBase<T>
27 {
28 private:
29 
30  //Default constructor. Do not use.
32 
34  const DtBaseSimObjectIterator& orig);
35 
36 public:
37 
42  simObjectManager) : DtIteratorBase<T>(list), mySimObjectManager(simObjectManager) {};
43 
46  DtIteratorBase<T>(orig),
48 
51 
52  T* first(bool move = true)
53  {
54  return dataToObject(this->internalFirst(move));
55  };
56  T* next(bool move = true)
57  {
58  return dataToObject(this->internalNext(move));
59  };
60  T* prev(bool move = true)
61  {
62  return dataToObject(this->internalPrev(move));
63  };
64  T* last(bool move = true)
65  {
66  return dataToObject(this->internalLast(move));
67  };
68  T* wrapNext(bool move = true)
69  {
70  return dataToObject(this->internalWrapNext(move));
71  };
72  T* wrapPrev(bool move = true)
73  {
74  return dataToObject(this->internalWrapPrev(move));
75  };
76 
77 protected:
78  T* dataToObject(void* data) const
79  {
80  DtEntityIdentifier* keyP = (DtEntityIdentifier*) data;
81  if (keyP)
82  {
83  return (T*)mySimObjectManager->lookup(*keyP);
84  }
85 
86  return NULL;
87  }
88 
89 protected:
91 };
92 
94 
95 #endif

Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)