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

slotbuffer_v0.h

Go to the documentation of this file.
00001 
00002 #ifndef header_slotbuffer_v0
00003 #define header_slotbuffer_v0
00004 
00005 class CL_SlotBuffer_v0
00006 {
00007 // Construction:
00008 public:
00009         CL_SlotBuffer_v0() : count(0)
00010         {
00011         }
00012 
00013         CL_SlotBuffer_v0(CL_Signal_v0 &signal) : count(0)
00014         {
00015                 connect(signal);
00016         }
00017 
00018 // Attributes:
00019 public:
00020         operator bool()
00021         {
00022                 return count > 0;
00023         }
00024 
00025         int size()
00026         {
00027                 return count;
00028         }
00029 
00030 // Operations:
00031 public:
00032         void connect(CL_Signal_v0 &signal)
00033         {
00034                 slot = signal.connect(CL_CreateSlot(this, &CL_SlotBuffer_v0::callback));
00035         }
00036 
00037         void disconnect(CL_Signal_v0 &signal)
00038         {
00039                 signal.disconnect(slot);
00040         }
00041 
00042 // Implementation:
00043 private:
00044         void callback()
00045         {
00046                 count++;
00047         }
00048 
00049         CL_Slot slot;
00050         int count;
00051 };
00052 
00053 #endif

Generated at Wed Apr 4 19:54:03 2001 for ClanLib by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001