Util--  1.1
dummy.hh
Go to the documentation of this file.
1 /* -*- C++ -*-
2  * $Id: dummy.hh 990 2005-09-14 15:17:04Z sjoyeux $
3  */
4 #ifndef UTILMM_SINGLETON_DUMMY_HEADER
5 # define UTILMM_SINGLETON_DUMMY_HEADER
6 
7 # include <string>
8 #include <boost/utility.hpp>
9 
11 
12 namespace utilmm {
13  namespace singleton {
14  class dummy;
15 
16  namespace details {
17  struct dummy_factory {
18  virtual ~dummy_factory() {};
19  virtual dummy* create() const = 0;
20  };
21  }
22 
32  class dummy :public ::boost::noncopyable {
33  protected:
35  dummy();
37  virtual ~dummy() =0;
38 
48  static void attach(std::string const &name, details::dummy_factory const& factory);
57  static void detach(std::string const &name);
58 
66  static dummy *instance(std::string const &name);
67 
68  private:
69  void incr_ref() const;
70  bool decr_ref() const;
71 
72  mutable size_t ref_counter;
73 
74  friend class utilmm::singleton::server;
75  }; // class utilmm::singleton::dummy
76 
77  } // namespace utilmm::singleton
78 } // namespace utilmm
79 
80 #endif // UTILMM_SINGLETON_DUMMY_HEADER
81 
Generic Factory implementation.
Definition: factory.hh:46
virtual ~dummy_factory()
Definition: dummy.hh:18
Definition: auto_flag.hh:6
virtual dummy * create() const =0
Forward declaration of utilmm::singleton::server.
base class for utilmm::singleton::wrapper
Definition: dummy.hh:32

Generated on Mon Oct 8 2018 08:38:45 for Util-- by doxygen 1.8.11
SourceForge.net Project Page