VR-Forces 4.1 Class Documentation
networkEdgePointConstIter.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2004 MAK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: networkEdgePointConstIter.h,v $ $Revision: 1.5 $ $State: Exp $
7 *********************************************************************/
8 #ifndef networkEdgePointConstIter_H_
9 #define networkEdgePointConstIter_H_
10 
11 //
12 // \file networkEdgePointConstIter.h
13 // \brief Contains the DtNetworkEdgePointConstIter class declaration.
14 //
15 
16 #include "gdb/gdbDefines.h"
17 #include "gdb/netwrkEdge.h"
18 
19 class DtPoint;
20 class DtString;
21 
22 //
23 // DtNetworkEdgePointConstIter is an ABC representing
24 // a const iterator over the points representing a DtNetworkEdge.
25 // \invariant At all times, this iterator must point to a valid DtNetworkEdge.
26 // \invariant This iterator can not be used to modify the referenced DtNetworkEdge
28 {
29 public:
30 
31  // constructor
32  // \param edge The DtNetworkEdge to iterate over
34 
35  // constructor that allows the user to specify that
36  // the iterator is initialized to the end of the
37  // points of the edge.
38  // \param edge The DtNetworkEdge to iterate over
39  // \param isend Is the iterator at the end or not.
40  DtNetworkEdgePointConstIter(const DtNetworkEdge& edge, bool isEnd);
41 
42  // destructor
43  virtual ~DtNetworkEdgePointConstIter();
44 
45  // copy constructor
47 
48  // assignment operator
49  virtual DtNetworkEdgePointConstIter& operator=(const DtNetworkEdgePointConstIter& orig);
50 
51  // Increment/Decrement to the next/previous points.
52  // \note Incrementing is defined as moving to the next point in the direction
53  // in which the iterator is iterating over the edge, NOT necessarily the
54  // next point in the order in which they are defined in the edge itself.
55  virtual void operator++() = 0;
56  virtual void operator--() = 0;
57 
58  // \return A reference to a const DtPoint in the edge
59  virtual const DtPoint& operator*() const = 0;
60  // \return A pointer to a const DtPoint in the edge
61  virtual const DtPoint* operator->() const = 0;
62 
63  // \return A boolean signifying whether the iteration is equal to the other
64  // iterator or not.
65  virtual bool operator==(const DtNetworkEdgePointConstIter& other) const;
66  virtual bool operator!=(const DtNetworkEdgePointConstIter& other) const;
67 
68  // \return the DtString "DtNetworkEdgePointConstIter"
69  virtual const DtString type() const;
70 
71 protected:
72  // Tests the invariant for the class (described above)
73  // \return true if the invariant is valid.
74  // false otherwise.
75  bool testInvariant() const;
76 
78  bool myIsEnd;
79 
80 private:
81  // default constructor
83 };
84 
85 
87 myEdge(&edge),
88 myIsEnd(false)
89 {
90 }
91 
93 myEdge(&edge),
94 myIsEnd(isEnd)
95 {
96 }
97 
98 
100 {
101 }
102 
104 {
105  myEdge = orig.myEdge;
106  myIsEnd = orig.myIsEnd;
107 }
108 
110 {
111  if (*this != orig)
112  {
113  myEdge = orig.myEdge;
114  myIsEnd = orig.myIsEnd;
115  }
116 
117  return *this;
118 }
119 
121 {
122  return "DtNetworkEdgePointConstIter";
123 }
124 
125 
126 #endif

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)