commore  1.0.6-SNAPSHOT
All Classes Namespaces Functions Variables Typedefs Enumerations Pages
RefObject.h
1 //
2 // Copyright (c) 2006-2014 Raphael David / CANTOR
3 //
4 
5 #ifndef CMR_REF_OBJECT_DEFINED
6 #define CMR_REF_OBJECT_DEFINED
7 
8 #include "Commore.h"
9 #include "AutoRefBase.h"
10 
11 namespace commore
12 {
13  class CriticalSection;
14 
24  class CMREXD RefFactory
25  {
26  public:
27  RefFactory();
28  virtual ~RefFactory();
36  virtual const AChar* factory_name() const;
45  virtual AutoRefBase create(const AChar* s) const;
52  virtual AutoRefBase bind(const AChar* s) const;
64  static AutoRefBase lookup_create(const AChar* factory_name, const AChar* s, const AutoRefBase& def);
69  static AutoRefBase lookup_bind(const AChar* factory_name, const AChar* s, const AutoRefBase& def);
70 
71  private:
72  RefFactory* next_;
73  };
74 
89  class CMREXD RefObject
90  {
91  public:
96  RefObject();
97  virtual ~RefObject();
103  virtual void attach();
109  virtual void release();
110 
119  virtual void nested_attach();
120  virtual void nested_release();
121 
127  virtual void interface_release();
128 
133  virtual void Run() {}
134 
139  virtual CriticalSection* get_cs();
140 
149  {
150  return 0;
151  }
155  static AutoRefBase auto_create(const AChar* s)
156  {
157  return 0;
158  }
166  {
167  return 0;
168  }
172  static AutoRefBase create(const AChar* s)
173  {
174  return 0;
175  }
179  static AutoRefBase bind()
180  {
181  return 0;
182  }
186  static AutoRefBase bind(const AChar* s)
187  {
188  return 0;
189  }
195  static const AChar* factory_name()
196  {
197  return "";
198  }
199 
200  private:
201  long refCount_;
202  long irefCount_;
203 
204  };
205 }
206 
207 #endif
Definition: RefObject.h:24
static AutoRefBase auto_create(const AChar *s)
Definition: RefObject.h:155
Definition: AutoRefBase.h:18
static AutoRefBase create()
Definition: RefObject.h:165
virtual void Run()
Definition: RefObject.h:133
static AutoRefBase auto_create()
Definition: RefObject.h:148
static AutoRefBase create(const AChar *s)
Definition: RefObject.h:172
Definition: CriticalSection.h:15
Definition: RefObject.h:89
static const AChar * factory_name()
Definition: RefObject.h:195
static AutoRefBase bind(const AChar *s)
Definition: RefObject.h:186
static AutoRefBase bind()
Definition: RefObject.h:179