mirror of https://github.com/Icinga/icinga2.git
Fix INITIALIZE_ONCE().
This commit is contained in:
parent
b9e988f309
commit
7a87fc0d5e
|
@ -34,8 +34,8 @@ inline bool InitializeOnceHelper(InitializeFunc func)
|
|||
return true;
|
||||
}
|
||||
|
||||
#define INITIALIZE_ONCE(func) \
|
||||
static bool l_InitializeOnce ## __LINE__(InitializeOnceHelper(func));
|
||||
#define INITIALIZE_ONCE(name, func) \
|
||||
bool l_InitializeOnce ## name(InitializeOnceHelper(func));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ using namespace icinga;
|
|||
|
||||
Timer::Ptr DbConnection::m_ProgramStatusTimer;
|
||||
|
||||
INITIALIZE_ONCE(&DbConnection::StaticInitialize);
|
||||
INITIALIZE_ONCE(DbConnection, &DbConnection::StaticInitialize);
|
||||
|
||||
DbConnection::DbConnection(const Dictionary::Ptr& serializedUpdate)
|
||||
: DynamicObject(serializedUpdate)
|
||||
|
|
|
@ -40,6 +40,8 @@ public:
|
|||
|
||||
DbConnection(const Dictionary::Ptr& serializedUpdate);
|
||||
|
||||
static void StaticInitialize(void);
|
||||
|
||||
void SetReference(const DbObject::Ptr& dbobj, const DbReference& dbref);
|
||||
DbReference GetReference(const DbObject::Ptr& dbobj) const;
|
||||
|
||||
|
@ -60,7 +62,6 @@ private:
|
|||
std::map<DbObject::Ptr, DbReference> m_References;
|
||||
static Timer::Ptr m_ProgramStatusTimer;
|
||||
|
||||
static void StaticInitialize(void);
|
||||
static void ProgramStatusHandler(void);
|
||||
|
||||
friend class DbType;
|
||||
|
|
|
@ -34,7 +34,7 @@ boost::signals2::signal<void (const DbObject::Ptr&)> DbObject::OnRegistered;
|
|||
boost::signals2::signal<void (const DbObject::Ptr&)> DbObject::OnUnregistered;
|
||||
boost::signals2::signal<void (const DbQuery&)> DbObject::OnQuery;
|
||||
|
||||
INITIALIZE_ONCE(&DbObject::StaticInitialize);
|
||||
INITIALIZE_ONCE(DbObject, &DbObject::StaticInitialize);
|
||||
|
||||
DbObject::DbObject(const shared_ptr<DbType>& type, const String& name1, const String& name2)
|
||||
: m_Name1(name1), m_Name2(name2), m_Type(type), m_LastConfigUpdate(0), m_LastStatusUpdate(0)
|
||||
|
|
|
@ -46,6 +46,8 @@ class DbObject : public Object
|
|||
public:
|
||||
DECLARE_PTR_TYPEDEFS(DbObject);
|
||||
|
||||
static void StaticInitialize(void);
|
||||
|
||||
void SetObject(const DynamicObject::Ptr& object);
|
||||
DynamicObject::Ptr GetObject(void) const;
|
||||
|
||||
|
@ -87,8 +89,6 @@ private:
|
|||
|
||||
friend boost::shared_ptr<DbObject> boost::make_shared<>(const icinga::String&, const icinga::String&);
|
||||
|
||||
static void StaticInitialize(void);
|
||||
|
||||
static void ObjectRegisteredHandler(const DynamicObject::Ptr& object);
|
||||
static void ObjectUnregisteredHandler(const DynamicObject::Ptr& object);
|
||||
static void AttributesChangedHandler(const DynamicObject::Ptr& object, const std::set<String, string_iless>& attributes);
|
||||
|
|
Loading…
Reference in New Issue