VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
networkEdgeSegmentConstIter.h
Go to the documentation of this file.
1 /*********************************************************************
2 ** Copyright (c) 2004 MaK Technologies, Inc.
3 ** All rights reserved.
4 *********************************************************************/
5 /*********************************************************************
6 ** $RCSfile: networkEdgeSegmentConstIter.h,v $ $Revision: 1.5 $ $State: Exp $
7 *********************************************************************/
8 #ifndef networkEdgeSegmentConstIter_H_
9 #define networkEdgeSegmentConstIter_H_
10 
11 //
12 // \file networkEdgeSegmentConstIter.h
13 // \brief Contains the DtNetworkEdgeSegmentConstIter class declaration.
14 //
15 
16 #include "gdb/gdbDefines.h"
17 #include "gdb/networkEdge.h"
18 
19 class DtSegment;
20 class DtString;
21 
22 
23 //
24 // DtNetworkEdgeSegmentConstIter is an ABC representing
25 // a const iterator over the segments of a DtNetworkEdge.
26 // \invariant At all times, this iterator must point to a valid DtNetworkEdge.
27 // \invariant This iterator cannot be used to modify the reference DtNetworkEdge.
29 {
30 public:
31  // \param an edge to iterate over.
33 
34  // copy constructor
36 
37  // destructor
39 
40  // \return A DtPoint representing the starting or ending point of
41  // the segment as defined in the direction of iteration.
42  virtual DtPoint startPoint() const = 0;
43  virtual DtPoint endPoint() const = 0;
44 
45  virtual const DtNetworkEdge& edge() const;
46 
47  // Increments/Decrements to the next/previous segment in the edge as defined
48  // by the direction of iteration.
49  virtual void operator++() = 0;
50  virtual void operator--() = 0;
51  virtual const DtNetworkSegment& operator*() const = 0;
52  virtual const DtNetworkSegment& operator->() const = 0;
53 
54  virtual bool operator==(const DtNetworkEdgeSegmentConstIter& other) const;
55  virtual bool operator!=(const DtNetworkEdgeSegmentConstIter& other) const;
56 
57  // \return the DtString "DtNetworkEdgeSegmentConstIter"
58  virtual const DtString type() const;
59 
60 protected:
61  // Tests the invariant of the iterator as defined above.
62  // \return a boolean signifying true if the invariant is valid
63  // and false otherwise.
64  bool testInvariant() const;
65 
66  // default constructor
68 
70 };
71 
72 
74 myEdge(&edge)
75 {
76  assert(testInvariant());
77 }
78 
80 {
81 }
82 
84 {
85  assert(testInvariant());
86 
87  myEdge = orig.myEdge;
88 
89  assert(testInvariant());
90 }
91 
93 {
94  assert(testInvariant());
95 
96  return "DtNetworkEdgeSegmentConstIter";
97 }
98 
99 
100 #endif

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)