Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages   Examples  

LoopState.h

00001 // See the file LICENSE in the some directory as this file for legal
00002 // notices about this software.   
00003 // $Id: LoopState_8h-source.html,v 1.11 2001/10/10 20:40:58 sandro Exp $
00004 #ifndef DEV_W3_ORG__2001_BLINDFOLD_SRC_LOOPSTATE_H
00005 #define DEV_W3_ORG__2001_BLINDFOLD_SRC_LOOPSTATE_H
00006 #include "config.h"
00007 
00008 
00017 class LoopState {
00018       
00019 public:
00020 
00021     // STANDARD MEMBER FUNCTIONS
00022     LoopState();
00023     LoopState(const LoopState& other);
00024     const LoopState& operator=(const LoopState& other);
00025     bool operator==(const LoopState& other) const;
00026     bool operator<(const LoopState& other) const;
00027     size_t hash() const;
00028     friend std::ostream& operator<<(std::ostream& s, const LoopState& me);
00029     std::ostream& print_to(std::ostream& stream) const; 
00030     ~LoopState();       
00031 
00032     // CLASS-SPECIFIC PUBLIC INTERFACE
00033 
00034 
00038   union {
00039      void* as_ptr;
00040      int as_int;
00041      unsigned long as_ulong;
00042   } data;
00043 
00044 
00048   void (*reset_handler)(LoopState&);
00049 
00053   void reset() {
00054     if (reset_handler) {
00055       (*reset_handler)(*this);
00056     } else {
00057       data.as_ptr = 0;
00058     }
00059   }
00060 
00061 
00062 private:
00063 
00064 
00065 };     
00066 
00067 
00068 inline LoopState::LoopState() {
00069     data.as_ptr = 0;
00070     reset_handler = 0;
00071 }
00072 
00073 inline LoopState::~LoopState() {
00074     reset();
00075 }
00076 
00077 
00137 STANDARD_EXTERNAL(LoopState)
00138 
00139 #endif   /* LOOPSTATE */  // -*-C++-*-

Home to blindfold. This page generated via doxygen 1.2.11.1 Wed Oct 10 16:40:33 2001.