Main Page | Namespace List | Class Hierarchy | Compound List | File List | Compound Members | File Members

RCBase.h

Go to the documentation of this file.
00001 
00002 #ifndef RCBASE_H
00003 #define RCBASE_h
00004 
00111 template <class Type>
00112 class RCBase
00113 {
00114 public:
00115 
00116   class ValRef
00117   {
00118     RCBase& o;
00119     const int i;
00120   public:
00121     ValRef(RCBase& oo, const int ii) : o(oo), i(ii) {}
00122     
00123     operator Type() const
00124     {
00125       // printf("RCBase::Type\n");
00126       return o.read(i);
00127     }
00128     void operator=(Type v)
00129     {
00130       // printf("RCBase::operator=\n");
00131       o.write(i, v);
00132     }
00133   }; // class ValRef
00134 
00135   virtual Type read( const int i ) const = 0;
00136   virtual void write( const int i, const Type v ) = 0;
00137 };
00138 
00139 #endif

Generated on Mon Sep 22 20:22:58 2003 by doxygen 1.3.3