00001 00009 #ifndef ATOMS_ONCE_HH 00010 #define ATOMS_ONCE_HH 00011 00012 #include <atoms/gen.hh> 00013 #include <atoms/mutex.hh> 00014 #include <boost/function.hpp> 00015 00016 namespace atoms { 00017 00024 class Once : boost::noncopyable { 00025 public: 00027 Once() : done(false) {} 00028 00034 void operator()(const boost::function<void ()> &action); 00035 00036 private: 00038 bool done; 00039 00041 Mutex m; 00042 }; 00043 00044 } // namespace atoms 00045 #endif // !ATOMS_ONCE_HH
1.3.5