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

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)