| 
                Last change
                  on this file since 5122 was
                  4838,
                  checked in by bensch, 20 years ago
           | 
        
        
          | 
               
orxonox/trunk: Element2D added → will be moved to lib/graphics afterwards 
ProtoClass update 
EventListeners do not have to be unsubscribed externally, but still one listener won't unsubscribe 
 
           | 
        
        | 
            File size:
            608 bytes
           | 
      
      
        
  | Line |   | 
|---|
| 1 | /*! | 
|---|
| 2 |  * @file proto_singleton.h | 
|---|
| 3 |  * @brief Definition of the ... singleton Class | 
|---|
| 4 | */ | 
|---|
| 5 |  | 
|---|
| 6 | #ifndef _PROTO_SINGLETON_H | 
|---|
| 7 | #define _PROTO_SINGLETON_H | 
|---|
| 8 |  | 
|---|
| 9 | #include "base_object.h" | 
|---|
| 10 |  | 
|---|
| 11 | // FORWARD DEFINITION | 
|---|
| 12 |  | 
|---|
| 13 | //! A default singleton class. | 
|---|
| 14 | class ProtoSingleton : public BaseObject { | 
|---|
| 15 |  | 
|---|
| 16 |  public: | 
|---|
| 17 |   virtual ~ProtoSingleton(void); | 
|---|
| 18 |   /** @returns a Pointer to the only object of this Class */ | 
|---|
| 19 |   inline static ProtoSingleton* getInstance(void) { if (!singletonRef) singletonRef = new ProtoSingleton();  return singletonRef; }; | 
|---|
| 20 |  | 
|---|
| 21 |  private: | 
|---|
| 22 |   ProtoSingleton(void); | 
|---|
| 23 |   static ProtoSingleton* singletonRef; | 
|---|
| 24 | }; | 
|---|
| 25 |  | 
|---|
| 26 | #endif /* _PROTO_SINGLETON_H */ | 
|---|
       
      
      Note: See 
TracBrowser
        for help on using the repository browser.