Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

SketchRoot.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 
00003 #ifndef INCLUDED_SketchRoot_h
00004 #define INCLUDED_SketchRoot_h
00005 
00006 #include "SketchSpace.h"
00007 #include "SketchDataRoot.h"
00008 
00009 namespace DualCoding {
00010 
00011 //! Parent class for all Sketch<T>
00012 class SketchRoot {
00013  public:
00014 
00015   SketchRoot() {}
00016   virtual ~SketchRoot() {}
00017 
00018   SketchSpace& rootGetSpace() const;
00019   const SketchDataRoot* rootGetData() const;
00020 
00021   int getNewId() { return ++idCounter; }
00022 
00023 private:
00024   static int idCounter;
00025 
00026   friend class SketchRootReset;
00027   friend std::ostream& operator<<(std::ostream &os, const SketchRoot &r);
00028 };
00029 
00030 //! Dummy class used by SketchSpace to reset static SketchRoot::idCounter
00031 class SketchRootReset {
00032 public:
00033   SketchRootReset() { SketchRoot::idCounter = 0; } //!< constructor, set idCounter to 0
00034   virtual ~SketchRootReset() {} //!< virtual destructor to satisfy compiler warning
00035 };
00036 
00037 std::ostream& operator<<(std::ostream &os, const SketchRoot &r);
00038 
00039 } // namespace
00040 
00041 #endif

DualCoding 4.0
Generated Thu Nov 22 00:52:36 2007 by Doxygen 1.5.4