Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

Cnum.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Pattern_Cnum_h
00002 #define Impala_Core_Array_Pattern_Cnum_h
00003 
00004 namespace Impala
00005 {
00006 namespace Core
00007 {
00008 namespace Array
00009 {
00010 namespace Pattern
00011 {
00012 
00013 
00016 struct Coord
00017 {
00018     int x, y;
00019 };
00020 
00021 
00024 class Cnum
00025 {
00026 public:
00028     Cnum() : mCoords(0)
00029     {
00030     }
00031 
00033     Cnum(Coord* coords) : mCoords(coords)
00034     {
00035     }
00036 
00038     Cnum(const Cnum& rhs) : mCoords(rhs.mCoords)
00039     {
00040     }
00041 
00043     Cnum&
00044     operator=(const Cnum& rhs)
00045     {
00046         mCoords = rhs.mCoords;
00047         return *this;
00048     }
00049 
00051     Cnum&
00052     operator=(Coord* coords)
00053     {
00054         mCoords = coords;
00055         return *this;
00056     }
00057 
00059     int
00060     X()
00061     {
00062         return mCoords->x;
00063     }
00064 
00066     int
00067     Y()
00068     {
00069         return mCoords->y;
00070     }
00071 
00073     void
00074     Inc()
00075     {
00076         mCoords++;
00077     }
00078 
00080     bool
00081     operator!=(const Cnum& rhs)
00082     {
00083         return mCoords != rhs.mCoords;
00084     }
00085 
00086 private:
00087     Coord* mCoords;
00088 };
00089 
00090 } // namespace Pattern
00091 } // namespace Array
00092 } // namespace Core
00093 } // namespace Impala
00094 
00095 #endif

Generated on Fri Mar 19 09:30:49 2010 for ImpalaSrc by  doxygen 1.5.1