VR-Forces 4.0.4 Class Documentation
include/gdb/networkEdgeSegmentConstIter.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 2004 MaK Technologies, Inc.
00003 ** All rights reserved.
00004 *********************************************************************/
00005 /*********************************************************************
00006 ** $RCSfile: networkEdgeSegmentConstIter.h,v $ $Revision: 1.5 $ $State: Exp $
00007 *********************************************************************/
00008 #ifndef networkEdgeSegmentConstIter_H_
00009 #define networkEdgeSegmentConstIter_H_
00010 
00011 //
00012 // \file networkEdgeSegmentConstIter.h
00013 // \brief Contains the DtNetworkEdgeSegmentConstIter class declaration.
00014 //
00015 
00016 #include "gdb/gdbDefines.h"
00017 #include "gdb/netwrkEdge.h"
00018 
00019 class DtSegment;
00020 class DtString;
00021 
00022 
00023 //
00024 // DtNetworkEdgeSegmentConstIter is an ABC representing
00025 // a const iterator over the segments of a DtNetworkEdge.
00026 // \invariant At all times, this iterator must point to a valid DtNetworkEdge.
00027 // \invariant This iterator cannot be used to modify the reference DtNetworkEdge.
00028 class DT_DLL_gdb DtNetworkEdgeSegmentConstIter 
00029 {
00030 public:
00031    // \param an edge to iterate over.
00032    DtNetworkEdgeSegmentConstIter(const DtNetworkEdge& edge);
00033 
00034    // copy constructor
00035    DtNetworkEdgeSegmentConstIter(const DtNetworkEdgeSegmentConstIter& orig);
00036 
00037    // destructor
00038    virtual ~DtNetworkEdgeSegmentConstIter();
00039 
00040    // \return A DtPoint representing the starting or ending point of 
00041    // the segment as defined in the direction of iteration.
00042    virtual DtPoint startPoint() const = 0;
00043    virtual DtPoint endPoint() const = 0;
00044 
00045    virtual const DtNetworkEdge& edge() const;
00046 
00047    // Increments/Decrements to the next/previous segment in the edge as defined
00048    // by the direction of iteration.
00049    virtual void operator++() = 0; 
00050    virtual void operator--() = 0; 
00051    virtual const DtNetworkSegment& operator*() const = 0;
00052    virtual const DtNetworkSegment& operator->()  const = 0;
00053 
00054    virtual bool operator==(const DtNetworkEdgeSegmentConstIter& other) const;
00055    virtual bool operator!=(const DtNetworkEdgeSegmentConstIter& other) const;
00056 
00057    // \return the DtString "DtNetworkEdgeSegmentConstIter"
00058    virtual const DtString type() const;
00059    
00060 protected:
00061    // Tests the invariant of the iterator as defined above.
00062    // \return a boolean signifying true if the invariant is valid
00063    // and false otherwise.
00064    bool testInvariant() const;
00065 
00066    // default constructor
00067    DtNetworkEdgeSegmentConstIter();
00068 
00069    const DtNetworkEdge* myEdge;
00070 };
00071 
00072 
00073 inline DtNetworkEdgeSegmentConstIter::DtNetworkEdgeSegmentConstIter(const DtNetworkEdge& edge):
00074 myEdge(&edge)
00075 {
00076    assert(testInvariant());
00077 }
00078 
00079 inline DtNetworkEdgeSegmentConstIter::~DtNetworkEdgeSegmentConstIter()
00080 {
00081 }
00082 
00083 inline DtNetworkEdgeSegmentConstIter::DtNetworkEdgeSegmentConstIter(const DtNetworkEdgeSegmentConstIter& orig)
00084 {
00085    assert(testInvariant());
00086 
00087    myEdge = orig.myEdge;
00088    
00089    assert(testInvariant());
00090 }
00091 
00092 inline const DtString DtNetworkEdgeSegmentConstIter::type() const
00093 {
00094    assert(testInvariant());
00095 
00096    return "DtNetworkEdgeSegmentConstIter";
00097 }
00098 
00099 
00100 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)