]> granicus.if.org Git - icinga2/commitdiff
Cleaned up #includes (Part 1).
authorGunnar Beutner <gunnar@beutner.name>
Fri, 15 Mar 2013 17:21:29 +0000 (18:21 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 15 Mar 2013 17:21:29 +0000 (18:21 +0100)
77 files changed:
components/checker/checkercomponent.cpp
components/checker/checkercomponent.h
components/compat/compatcomponent.cpp
components/compat/compatcomponent.h
components/livestatus/column.h
components/livestatus/commentstable.cpp
components/livestatus/commentstable.h
components/livestatus/contactgroupstable.cpp
components/livestatus/contactgroupstable.h
components/livestatus/contactstable.cpp
components/livestatus/contactstable.h
components/livestatus/downtimestable.cpp
components/livestatus/downtimestable.h
components/livestatus/hoststable.cpp
components/livestatus/hoststable.h
components/livestatus/query.cpp
components/livestatus/servicestable.cpp
components/livestatus/servicestable.h
components/livestatus/statustable.cpp
components/livestatus/statustable.h
components/livestatus/table.cpp
components/livestatus/table.h
icinga-app/icinga.cpp
lib/base/application.cpp
lib/base/asynctask.h
lib/base/connection.cpp
lib/base/convert.cpp
lib/base/dictionary.cpp
lib/base/dynamicobject.h
lib/base/dynamictype.h
lib/base/eventqueue.cpp
lib/base/eventqueue.h
lib/base/exception.h
lib/base/i2-base.h
lib/base/object.h
lib/base/process-unix.cpp
lib/base/process.h
lib/base/qstring.cpp
lib/base/qstring.h
lib/base/registry.h
lib/base/script.cpp
lib/base/script.h
lib/base/scriptfunction.h
lib/base/singleton.h
lib/base/socket.cpp
lib/base/socket.h
lib/base/stacktrace.h
lib/base/stream.cpp
lib/base/stream.h
lib/base/timer.cpp
lib/base/timer.h
lib/base/tlsstream.cpp
lib/base/utility.cpp
lib/base/utility.h
lib/base/value.cpp
lib/base/value.h
lib/config/configcompiler.h
lib/config/configitem.cpp
lib/config/configitem.h
lib/config/configtype.cpp
lib/config/expression.cpp
lib/icinga/externalcommandprocessor.cpp
lib/icinga/externalcommandprocessor.h
lib/icinga/host.cpp
lib/icinga/i2-icinga.h
lib/icinga/macroprocessor.cpp
lib/icinga/notification.cpp
lib/icinga/notification.h
lib/icinga/pluginchecktask.cpp
lib/icinga/service-check.cpp
lib/icinga/service-downtime.cpp
lib/icinga/service-notification.cpp
lib/icinga/service.h
lib/remoting/endpoint.cpp
lib/remoting/endpoint.h
lib/remoting/endpointmanager.cpp
lib/remoting/endpointmanager.h

index c65ca89254b13db0ae77b0d4bcd542a153e00a8a..2ee6cb56d418eb1757cecd4267de303a7799ce8a 100644 (file)
@@ -40,7 +40,7 @@ void CheckerComponent::Start(void)
 
        m_Stopped = false;
 
-       m_Thread = thread(boost::bind(&CheckerComponent::CheckThreadProc, this));
+       m_Thread = boost::thread(boost::bind(&CheckerComponent::CheckThreadProc, this));
 
        m_ResultTimer = boost::make_shared<Timer>();
        m_ResultTimer->SetInterval(5);
index f93d4f343ddf552a82fd83242738e3e353b46439..0de4306ae9ee20a569c2ff4e53ef1da8b4a9c451 100644 (file)
@@ -74,7 +74,7 @@ private:
        boost::mutex m_Mutex;
        boost::condition_variable m_CV;
        bool m_Stopped;
-       thread m_Thread;
+       boost::thread m_Thread;
 
        ServiceSet m_IdleServices;
        ServiceSet m_PendingServices;
index 7c06d63152540c5994546cf25f18f4b3c74fec37..eea8ed77e8a16384fb2d79c7d1ae3ba634d04a56 100644 (file)
@@ -41,7 +41,7 @@ void CompatComponent::Start(void)
        m_StatusTimer->Reschedule(0);
 
 #ifndef _WIN32
-       m_CommandThread = thread(boost::bind(&CompatComponent::CommandPipeThread, this, GetCommandPath()));
+       m_CommandThread = boost::thread(boost::bind(&CompatComponent::CommandPipeThread, this, GetCommandPath()));
        m_CommandThread.detach();
 #endif /* _WIN32 */
 }
index 4da7e826fbd4a652e5f48aaae12ab0748daad93b..9c412dd10db49e4764cbb393064d6343722e7906 100644 (file)
@@ -46,7 +46,7 @@ private:
        Attribute<String> m_CommandPath;
 
 #ifndef _WIN32
-       thread m_CommandThread;
+       boost::thread m_CommandThread;
 
        void CommandPipeThread(const String& commandPath);
 #endif /* _WIN32 */
index 2f226322a55463444e7abb77006ca0c4d181db05..94718a4fe797e5e1fe56ba980db592cdeb7ecfa7 100644 (file)
@@ -26,8 +26,8 @@ namespace livestatus
 class Column
 {
 public:
-       typedef function<Value (const Object::Ptr&)> ValueAccessor;
-       typedef function<Object::Ptr (const Object::Ptr&)> ObjectAccessor;
+       typedef boost::function<Value (const Object::Ptr&)> ValueAccessor;
+       typedef boost::function<Object::Ptr (const Object::Ptr&)> ObjectAccessor;
 
        Column(const ValueAccessor& valueAccessor, const ObjectAccessor& objectAccessor);
 
index 935361727f507b511767fd9e95af3e9b780db97f..ed272052397c049d2a652efe9c16a2be9a512be8 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-livestatus.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 using namespace livestatus;
@@ -50,7 +51,7 @@ String CommentsTable::GetName(void) const
        return "comments";
 }
 
-void CommentsTable::FetchRows(const function<void (const Object::Ptr&)>& addRowFn)
+void CommentsTable::FetchRows(const AddRowFunction& addRowFn)
 {
        BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("Service")) {
                Service::Ptr service = static_pointer_cast<Service>(object);
@@ -62,7 +63,7 @@ void CommentsTable::FetchRows(const function<void (const Object::Ptr&)>& addRowF
                ObjectLock olock(comments);
 
                Value comment;
-               BOOST_FOREACH(tie(tuples::ignore, comment), comments) {
+               BOOST_FOREACH(boost::tie(boost::tuples::ignore, comment), comments) {
                        addRowFn(comment);
                }
        }
index e3997dfbad47768e092977ae107bd7b0da72dbc4..aaa58dad2abb77fe3751ffd1aa106cd0a87de8ee 100644 (file)
@@ -40,7 +40,7 @@ public:
        virtual String GetName(void) const;
 
 protected:
-       virtual void FetchRows(const function<void (const Object::Ptr&)>& addRowFn);
+       virtual void FetchRows(const AddRowFunction& addRowFn);
 };
 
 }
index 3b9f8a98fe381d37a85f62f5a47e3eb9bd6d9a06..39638a97af4d7aa4ab2e2609db4544b426f598c2 100644 (file)
@@ -40,7 +40,7 @@ String ContactGroupsTable::GetName(void) const
        return "contactgroups";
 }
 
-void ContactGroupsTable::FetchRows(const function<void (const Object::Ptr&)>& addRowFn)
+void ContactGroupsTable::FetchRows(const AddRowFunction& addRowFn)
 {
        BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("UserGroup")) {
                addRowFn(object);
@@ -61,4 +61,4 @@ Value ContactGroupsTable::MembersAccessor(const Object::Ptr& object)
        }
 
        return members;
-}
\ No newline at end of file
+}
index c5431d5ae839eb67b76f9a1481002378d3d2dde4..1d6cd9ce6ad40dbda15c99b32e3a5d75966e3515 100644 (file)
@@ -40,7 +40,7 @@ public:
        virtual String GetName(void) const;
 
 protected:
-       virtual void FetchRows(const function<void (const Object::Ptr&)>& addRowFn);
+       virtual void FetchRows(const AddRowFunction& addRowFn);
 
        static Value NameAccessor(const Object::Ptr& object);
        static Value MembersAccessor(const Object::Ptr& object);
index a0a81fbf99fb27aaf6769858e62266fb5838a31b..473bd3481cbb0d4073ea25403db15d3a3ab4e84b 100644 (file)
@@ -53,7 +53,7 @@ String ContactsTable::GetName(void) const
        return "contacts";
 }
 
-void ContactsTable::FetchRows(const function<void (const Object::Ptr&)>& addRowFn)
+void ContactsTable::FetchRows(const AddRowFunction& addRowFn)
 {
        BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("User")) {
                addRowFn(object);
index 246127d7b31252d930d0fd195dca7b087f2d6eee..1a22f91bb02544b4ee27e53767db4518905735ba 100644 (file)
@@ -40,7 +40,7 @@ public:
        virtual String GetName(void) const;
 
 protected:
-       virtual void FetchRows(const function<void (const Object::Ptr&)>& addRowFn);
+       virtual void FetchRows(const AddRowFunction& addRowFn);
 
        static Value NameAccessor(const Object::Ptr& object);
        static Value MembersAccessor(const Object::Ptr& object);
index 7ce057f925eec5bdcfff023b926ee577b3aeb32e..1e1b111381a683ceaf6f6978d1a80c0e5b20ab61 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-livestatus.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 using namespace livestatus;
@@ -50,7 +51,7 @@ String DowntimesTable::GetName(void) const
        return "downtimes";
 }
 
-void DowntimesTable::FetchRows(const function<void (const Object::Ptr&)>& addRowFn)
+void DowntimesTable::FetchRows(const AddRowFunction& addRowFn)
 {
        BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("Service")) {
                Service::Ptr service = static_pointer_cast<Service>(object);
@@ -62,7 +63,7 @@ void DowntimesTable::FetchRows(const function<void (const Object::Ptr&)>& addRow
                ObjectLock olock(downtimes);
 
                Value downtime;
-               BOOST_FOREACH(tie(tuples::ignore, downtime), downtimes) {
+               BOOST_FOREACH(boost::tie(boost::tuples::ignore, downtime), downtimes) {
                        addRowFn(downtime);
                }
        }
index 1505321d752fc4263d4563df3ce839650fef459a..23e788565cc295ec6c8c9918238bde4ce9c0c91f 100644 (file)
@@ -40,7 +40,7 @@ public:
        virtual String GetName(void) const;
 
 protected:
-       virtual void FetchRows(const function<void (const Object::Ptr&)>& addRowFn);
+       virtual void FetchRows(const AddRowFunction& addRowFn);
 };
 
 }
index 32de6681ef177458028c2c71d8d55feb76b924b8..cb64f2411c9877f6befde6c67d271aafa74f5214 100644 (file)
@@ -145,7 +145,7 @@ String HostsTable::GetName(void) const
        return "hosts";
 }
 
-void HostsTable::FetchRows(const function<void (const Object::Ptr&)>& addRowFn)
+void HostsTable::FetchRows(const AddRowFunction& addRowFn)
 {
        BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("Host")) {
                addRowFn(object);
index bf6ecc01e50cdd418797498c76f0e401c25b532d..e16524a2a5952e0365b6bfc7463ee9a10b2e5f75 100644 (file)
@@ -40,7 +40,7 @@ public:
        virtual String GetName(void) const;
 
 protected:
-       virtual void FetchRows(const function<void (const Object::Ptr&)>& addRowFn);
+       virtual void FetchRows(const AddRowFunction& addRowFn);
 
        static Value NameAccessor(const Object::Ptr& object);
        static Value DisplayNameAccessor(const Object::Ptr& object);
index 5ebe405bd04e5c039546749663b05a091ba18794..45280b5917ff8b5f78d2851e2ebedbee07198650 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-livestatus.h"
+#include <boost/algorithm/string/classification.hpp>
 
 using namespace icinga;
 using namespace livestatus;
@@ -62,11 +63,11 @@ Query::Query(const vector<String>& lines)
                else if (header == "OutputFormat")
                        m_OutputFormat = params;
                else if (header == "Columns")
-                       m_Columns = params.Split(is_any_of(" "));
+                       m_Columns = params.Split(boost::is_any_of(" "));
                else if (header == "ColumnHeaders")
                        m_ColumnHeaders = (params == "on");
                else if (header == "Filter" || header == "Stats") {
-                       vector<String> tokens = params.Split(is_any_of(" "));
+                       vector<String> tokens = params.Split(boost::is_any_of(" "));
 
                        if (tokens.size() == 2)
                                tokens.push_back("");
index 2010abef0e0beb7d7ca4f70a5fa1a7ac7ef1caab..97fe4e2973c0e478063c65672a27ff8a855c573c 100644 (file)
@@ -121,7 +121,7 @@ String ServicesTable::GetName(void) const
        return "services";
 }
 
-void ServicesTable::FetchRows(const function<void (const Object::Ptr&)>& addRowFn)
+void ServicesTable::FetchRows(const AddRowFunction& addRowFn)
 {
        BOOST_FOREACH(const DynamicObject::Ptr& object, DynamicType::GetObjects("Service")) {
                addRowFn(object);
index 7b08199f91292e3ef22bde4a2666c06b42743440..cf7abce093b889f0b9aad153f114194d7dd8e341 100644 (file)
@@ -40,7 +40,7 @@ public:
        virtual String GetName(void) const;
 
 protected:
-       virtual void FetchRows(const function<void (const Object::Ptr&)>& addRowFn);
+       virtual void FetchRows(const AddRowFunction& addRowFn);
 
        static Object::Ptr HostAccessor(const Object::Ptr& object);
 
index b4e212bd02e29d6f1277a2ac962d44eb22ec343b..e35415c7b78057fb83f6c4ba9e5e2411f591c76e 100644 (file)
@@ -96,7 +96,7 @@ String StatusTable::GetName(void) const
        return "status";
 }
 
-void StatusTable::FetchRows(const function<void (const Object::Ptr&)>& addRowFn)
+void StatusTable::FetchRows(const AddRowFunction& addRowFn)
 {
        Object::Ptr obj = boost::make_shared<Object>();
 
index 971d2d5c0de333f1a48007ef561afc96f8198e58..4320fedbfa604433ccd9ce25abf5c3cd2549cc28 100644 (file)
@@ -40,7 +40,7 @@ public:
        virtual String GetName(void) const;
 
 protected:
-       virtual void FetchRows(const function<void (const Object::Ptr&)>& addRowFn);
+       virtual void FetchRows(const AddRowFunction& addRowFn);
 };
 
 }
index dba1178b5728774d10b773e66684e612d5a8b472..c3fdeede450e151e45d119e837f225091eeaf210 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-livestatus.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 using namespace livestatus;
@@ -70,7 +71,7 @@ vector<String> Table::GetColumnNames(void) const
        vector<String> names;
 
        String name;
-       BOOST_FOREACH(tie(name, tuples::ignore), m_Columns) {
+       BOOST_FOREACH(boost::tie(name, boost::tuples::ignore), m_Columns) {
                names.push_back(name);
        }
 
index d5813fd1143f495c662a2c0656beaae70f7e483b..ac35f893804f469e5ab6cdf50415e11abf8a4143 100644 (file)
@@ -34,6 +34,8 @@ public:
        typedef shared_ptr<Table> Ptr;
        typedef weak_ptr<Table> WeakPtr;
 
+       typedef boost::function<void (const Object::Ptr&)> AddRowFunction;
+
        static Table::Ptr GetByName(const String& name);
 
        
@@ -48,7 +50,7 @@ public:
 protected:
        Table(void);
 
-       virtual void FetchRows(const function<void (const Object::Ptr&)>& addRowFn) = 0;
+       virtual void FetchRows(const AddRowFunction& addRowFn) = 0;
 
        static Value ZeroAccessor(const Object::Ptr&);
        static Value OneAccessor(const Object::Ptr&);
index 2350259d1a34e61ed42abbb6e122b0102ebbcafd..64d6bea9ffecae658a19401f9dc02ca178feb18b 100644 (file)
@@ -18,7 +18,8 @@
  ******************************************************************************/
 
 #include <i2-icinga.h>
-
+#include <boost/program_options.hpp>
+#include <boost/tuple/tuple.hpp>
 
 #ifndef _WIN32
 #      include "icinga-version.h"
@@ -49,7 +50,7 @@ static bool LoadConfigFiles(bool validateOnly)
        }
 
        String name, fragment;
-       BOOST_FOREACH(tie(name, fragment), ConfigFragmentRegistry::GetInstance()->GetItems()) {
+       BOOST_FOREACH(boost::tie(name, fragment), ConfigFragmentRegistry::GetInstance()->GetItems()) {
                ConfigCompiler::CompileText(name, fragment);
        }
 
index c21be8e5b4e930331d9fa91b1da1f548b5e12171..17aad626a64db0a8faa547f1c3ffd056ed590795 100644 (file)
@@ -18,6 +18,9 @@
  ******************************************************************************/
 
 #include "i2-base.h"
+#include <boost/algorithm/string/classification.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/bind.hpp>
 
 using namespace icinga;
 
@@ -126,7 +129,7 @@ void Application::ShutdownTimerHandler(void)
 void Application::RunEventLoop(void) const
 {
        /* Start the system time watch thread. */
-       thread t(&Application::TimeWatchThreadProc);
+       boost::thread t(&Application::TimeWatchThreadProc);
        t.detach();
 
        /* Set up a timer that watches the m_Shutdown flag. */
index 210720311b96c8b4ba78902709c78ec6212ea7a7..9e4a84d8310c94c3d922b5d49d914905ffe79c43 100644 (file)
 #ifndef ASYNCTASK_H
 #define ASYNCTASK_H
 
+#include <boost/function.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/condition_variable.hpp>
+#include <boost/bind.hpp>
+
 namespace icinga
 {
 
@@ -38,7 +43,7 @@ public:
        /**
         * A completion callback for an AsyncTask.
         */
-       typedef function<void (const shared_ptr<TClass>&)> CompletionCallback;
+       typedef boost::function<void (const shared_ptr<TClass>&)> CompletionCallback;
 
        /**
         * Constructor for the AsyncTask class.
index cedd4ef6f3e3121fda1b15d173668a169295a162..6fb0c7947a11c049d4d7f9b96925afa353b60d9c 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-base.h"
+#include <boost/bind.hpp>
 
 using namespace icinga;
 
index 3a35326c653a03a33287fb2713475176fd3e9f16..6a55d643f11341307765e0c7dd4720b5d3a4b3f2 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-base.h"
+#include <boost/lexical_cast.hpp>
 
 using namespace icinga;
 
index 0914fa65e2e255af037535d09a9a73dbaef4e826..86f1ce2fa9d709ae98c95750f8bb12c9fe9ec933 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "i2-base.h"
 #include <cJSON.h>
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 
@@ -248,7 +249,7 @@ Dictionary::Ptr Dictionary::ShallowClone(void) const
 
        String key;
        Value value;
-       BOOST_FOREACH(tie(key, value), m_Data) {
+       BOOST_FOREACH(boost::tie(key, value), m_Data) {
                clone->Set(key, value);
        }
 
@@ -294,7 +295,7 @@ cJSON *Dictionary::ToJson(void) const
 
                String key;
                Value value;
-               BOOST_FOREACH(tie(key, value), m_Data) {
+               BOOST_FOREACH(boost::tie(key, value), m_Data) {
                        cJSON_AddItemToObject(json, key.CStr(), value.ToJson());
                }
        } catch (...) {
index aeee01c39726231c85abc65fa9d13f240f530bb9..467692833841a1611f5d40b26f5a06a187e5e795 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef DYNAMICOBJECT_H
 #define DYNAMICOBJECT_H
 
+#include <boost/thread/once.hpp>
+
 namespace icinga
 {
 
index 6c20147de7510b7ff0e31d917b4659dea10de464..9507b18f5ecb7f98b7762ff139f6c615691b600e 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef DYNAMICTYPE_H
 #define DYNAMICTYPE_H
 
+#include <boost/function.hpp>
+
 namespace icinga
 {
 
@@ -29,7 +31,7 @@ public:
        typedef shared_ptr<DynamicType> Ptr;
        typedef weak_ptr<DynamicType> WeakPtr;
 
-       typedef function<DynamicObject::Ptr (const Dictionary::Ptr&)> ObjectFactory;
+       typedef boost::function<DynamicObject::Ptr (const Dictionary::Ptr&)> ObjectFactory;
 
        DynamicType(const String& name, const ObjectFactory& factory);
 
@@ -73,7 +75,7 @@ private:
  *
  * @ingroup base
  */
-class I2_BASE_API DynamicTypeRegistry : public Registry<DynamicType::Ptr>
+class DynamicTypeRegistry : public Registry<DynamicType::Ptr>
 { };
 
 /**
index e25f8d023d3fd3833797592320d64cce59ff2d24..3fa30df408230fc4bd2cdde03d32d482eb0dec1d 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-base.h"
+#include <boost/bind.hpp>
 
 using namespace icinga;
 
@@ -27,7 +28,7 @@ using namespace icinga;
 EventQueue::EventQueue(void)
        : m_Stopped(false)
 {
-       unsigned int threads = thread::hardware_concurrency();
+       unsigned int threads = boost::thread::hardware_concurrency();
 
        if (threads == 0)
                threads = 1;
@@ -37,7 +38,7 @@ EventQueue::EventQueue(void)
        for (unsigned int i = 0; i < threads; i++)
                m_Threads.create_thread(boost::bind(&EventQueue::QueueThreadProc, this));
 
-       thread reportThread(boost::bind(&EventQueue::ReportThreadProc, this));
+       boost::thread reportThread(boost::bind(&EventQueue::ReportThreadProc, this));
        reportThread.detach();
 }
 
index 141e4c3812e1ae410f1044ea5730722204180ea2..3637fab89ca2504b8211c1fbdb2d25965a59e2cd 100644 (file)
 #ifndef EVENTQUEUE_H
 #define EVENTQUEUE_H
 
+#include <boost/function.hpp>
+#include <boost/thread/thread.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/condition_variable.hpp>
+
 namespace icinga
 {
 
@@ -33,7 +38,7 @@ class Timer;
 class I2_BASE_API EventQueue
 {
 public:
-       typedef function<void ()> Callback;
+       typedef boost::function<void ()> Callback;
 
        EventQueue(void);
        ~EventQueue(void);
@@ -44,10 +49,10 @@ public:
        void Post(const Callback& callback);
 
 private:
-       thread_group m_Threads;
+       boost::thread_group m_Threads;
 
        boost::mutex m_Mutex;
-       condition_variable m_CV;
+       boost::condition_variable m_CV;
 
        bool m_Stopped;
        stack<Callback> m_Events;
index 9d3901b5761b1ac80e15633d9ad9c470b7f972a3..3d6e87b2998a3abd6151c7ee2522df14cd60b348 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef EXCEPTION_H
 #define EXCEPTION_H
 
+#include <boost/thread/tss.hpp>
+
 namespace icinga
 {
 
index 6010fc9bf44940062859be89d048108c0f61bbc0..d176c6b91dd8b11183a00ebfcd8297f8997f3aab 100644 (file)
@@ -126,21 +126,8 @@ using std::type_info;
 #include <boost/smart_ptr.hpp>
 #include <boost/make_shared.hpp>
 #include <boost/bind.hpp>
-#include <boost/function.hpp>
 #include <boost/signals2.hpp>
-#include <boost/algorithm/string/trim.hpp>
-#include <boost/algorithm/string/split.hpp>
-#include <boost/algorithm/string/join.hpp>
-#include <boost/algorithm/string/compare.hpp>
-#include <boost/thread.hpp>
-#include <boost/variant.hpp>
-#include <boost/lexical_cast.hpp>
 #include <boost/foreach.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <boost/uuid/uuid.hpp>
-#include <boost/uuid/uuid_generators.hpp>
-#include <boost/uuid/uuid_io.hpp>
-#include <boost/program_options.hpp>
 #include <boost/exception/diagnostic_information.hpp>
 #include <boost/exception/error_info.hpp>
 #include <boost/exception/errinfo_api_function.hpp>
@@ -149,23 +136,11 @@ using std::type_info;
 #include <boost/multi_index_container.hpp>
 #include <boost/multi_index/ordered_index.hpp>
 #include <boost/multi_index/key_extractors.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
 
 using boost::shared_ptr;
 using boost::weak_ptr;
-using boost::enable_shared_from_this;
 using boost::dynamic_pointer_cast;
 using boost::static_pointer_cast;
-using boost::function;
-using boost::thread;
-using boost::thread_group;
-using boost::recursive_mutex;
-using boost::condition_variable;
-using boost::system_time;
-using boost::posix_time::millisec;
-using boost::tie;
-using boost::rethrow_exception;
-using boost::current_exception;
 using boost::diagnostic_information;
 using boost::errinfo_api_function;
 using boost::errinfo_errno;
@@ -177,7 +152,6 @@ using boost::multi_index::ordered_unique;
 using boost::multi_index::ordered_non_unique;
 using boost::multi_index::nth_index;
 
-namespace tuples = boost::tuples;
 namespace signals2 = boost::signals2;
 
 #if defined(__APPLE__) && defined(__MACH__)
index 37b565bf872ecfb2b3d0eae5ab89a2c4f6e600f0..fb49f39d5a731228f30d6fe932c8dc58e487eeb5 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef OBJECT_H
 #define OBJECT_H
 
+#include <boost/thread/mutex.hpp>
+
 namespace icinga
 {
 
@@ -31,7 +33,7 @@ class SharedPtrHolder;
  *
  * @ingroup base
  */
-class I2_BASE_API Object : public enable_shared_from_this<Object>
+class I2_BASE_API Object : public boost::enable_shared_from_this<Object>
 {
 public:
        typedef shared_ptr<Object> Ptr;
index 250e52c30ba41c5b25041a539c1e5165f5b42c9d..ceadd927670eb220a9cd59c4f9766bd7e4ca16b4 100644 (file)
  ******************************************************************************/
 
 #include "i2-base.h"
+#include <boost/bind.hpp>
+#include <boost/tuple/tuple.hpp>
 
 #ifndef _WIN32
 #include <execvpe.h>
 
 using namespace icinga;
 
-condition_variable Process::m_CV;
+boost::condition_variable Process::m_CV;
 int Process::m_TaskFd;
 Timer::Ptr Process::m_StatusTimer;
 
@@ -60,7 +62,7 @@ void Process::Initialize(void)
 
        m_TaskFd = fds[1];
 
-       unsigned int threads = thread::hardware_concurrency();
+       unsigned int threads = boost::thread::hardware_concurrency();
 
        if (threads == 0)
                threads = 2;
@@ -77,7 +79,7 @@ void Process::Initialize(void)
                Utility::SetNonBlocking(childTaskFd);
                Utility::SetCloExec(childTaskFd);
 
-               thread t(&Process::WorkerThreadProc, childTaskFd);
+               boost::thread t(&Process::WorkerThreadProc, childTaskFd);
                t.detach();
        }
 
@@ -108,7 +110,7 @@ void Process::WorkerThreadProc(int taskFd)
                int idx = 0;
 
                int fd;
-               BOOST_FOREACH(tie(fd, tuples::ignore), tasks) {
+               BOOST_FOREACH(boost::tie(fd, boost::tuples::ignore), tasks) {
                        pfds[idx].fd = fd;
                        pfds[idx].events = POLLIN | POLLHUP;
                        idx++;
@@ -284,7 +286,7 @@ void Process::InitTask(void)
                String key;
                Value value;
                int index = envc;
-               BOOST_FOREACH(tie(key, value), m_ExtraEnvironment) {
+               BOOST_FOREACH(boost::tie(key, value), m_ExtraEnvironment) {
                        String kv = key + "=" + Convert::ToString(value);
                        envp[index] = strdup(kv.CStr());
                        index++;
index 1b0dbd168f8642026adaffe5015cde604cb1f2dd..1c32b7ddf23012a580adaa4d9cdab0bd3a6a3951 100644 (file)
 #ifndef PROCESS_H
 #define PROCESS_H
 
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/condition_variable.hpp>
+#include <boost/thread/once.hpp>
+
 namespace icinga
 {
 
@@ -71,7 +75,7 @@ private:
        static boost::mutex m_Mutex;
        static deque<Process::Ptr> m_Tasks;
 #ifndef _WIN32
-       static condition_variable m_CV;
+       static boost::condition_variable m_CV;
        static int m_TaskFd;
 
        static Timer::Ptr m_StatusTimer;
index 883fe9f5c0508c7db045db30397e8dcdb377158a..8318040aa05abc85538741ac45a436a82add9f16 100644 (file)
@@ -18,6 +18,9 @@
  ******************************************************************************/
 
 #include "i2-base.h"
+#include <boost/algorithm/string/trim.hpp>
+#include <boost/algorithm/string/join.hpp>
+#include <boost/algorithm/string/compare.hpp>
 
 using namespace icinga;
 
index 2afd6180481e1608182943b19201beca0736b4a1..1aeebe92951a68a272b2e7ec3ba6ac61bc1d9d3f 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef STRING_H
 #define STRING_H
 
+#include <boost/algorithm/string/split.hpp>
+
 namespace icinga {
 
 /**
index a783f533f27024df04d37cbd1bc411767ac5b91a..b32721f4db4d47f27a20abf1154b28ba3ab387b9 100644 (file)
@@ -29,7 +29,7 @@ namespace icinga
  * @ingroup base
  */
 template<typename T>
-class Registry
+class I2_BASE_API Registry
 {
 public:
        typedef map<String, T, string_iless> ItemMap;
index 285b0692a72b0d4a821aac4acb3997f364a65f85..38ea3d9305ee7bbe21ad8e1f8822a805968c8152 100644 (file)
@@ -26,10 +26,10 @@ REGISTER_TYPE(Script);
 /**
  * Constructor for the Script class.
  *
- * @param properties A serialized dictionary containing attributes.
+ * @param serializedUpdate A serialized dictionary containing attributes.
  */
-Script::Script(const Dictionary::Ptr& properties)
-       : DynamicObject(properties)
+Script::Script(const Dictionary::Ptr& serializedUpdate)
+       : DynamicObject(serializedUpdate)
 {
        RegisterAttribute("language", Attribute_Config, &m_Language);
        RegisterAttribute("code", Attribute_Config, &m_Code);
index 208abbdb22231f842f6b386519606e5701d698f4..970c18e962baf53263c6573dd706748fe21e18d0 100644 (file)
@@ -36,7 +36,7 @@ public:
        typedef shared_ptr<Script> Ptr;
        typedef weak_ptr<Script> WeakPtr;
 
-       Script(const Dictionary::Ptr& properties);
+       Script(const Dictionary::Ptr& serializedUpdate);
 
        virtual void Start(void);
 
index 4ef41183639c6a6c2fd60ac83d42b78655e1fdd6..eb471f6675992bb1ee7d32d1d550c1c93e5241e8 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef SCRIPTFUNCTION_H
 #define SCRIPTFUNCTION_H
 
+#include <boost/function.hpp>
+
 namespace icinga
 {
 
@@ -36,7 +38,7 @@ public:
        typedef shared_ptr<ScriptFunction> Ptr;
        typedef weak_ptr<ScriptFunction> WeakPtr;
 
-       typedef function<void (const shared_ptr<ScriptTask>&, const vector<Value>& arguments)> Callback;
+       typedef boost::function<void (const shared_ptr<ScriptTask>&, const vector<Value>& arguments)> Callback;
 
        explicit ScriptFunction(const Callback& function);
 
index c1a13e0a46f0f2101ba6aab031395647ec239940..4f65da04a00145232ddea57e77624bc6164fe026 100644 (file)
@@ -29,7 +29,7 @@ namespace icinga
  * @ingroup base
  */
 template<typename T>
-class Singleton
+class I2_BASE_API Singleton
 {
 public:
        static T *GetInstance(void)
@@ -38,17 +38,20 @@ public:
                static boost::mutex mutex;
                boost::mutex::scoped_lock lock(mutex);
 
-               static T *instance = NULL;
+               if (!m_Instance)
+                       m_Instance = new T();
 
-               if (!instance)
-                       instance = new T();
-
-               return instance;
+               return m_Instance;
        }
 private:
        friend T *T::GetInstance(void);
+
+       static T *m_Instance;
 };
 
+template<typename T>
+T *Singleton<T>::m_Instance = NULL;
+
 }
 
 #endif /* SINGLETON_H */
index 5c88e7e40187062e2b66501093000890ccc5743f..e0b061a875909bc3233f122a118699807279d63d 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-base.h"
+#include <boost/bind.hpp>
 
 using namespace icinga;
 
@@ -51,11 +52,11 @@ void Socket::Start(void)
        ASSERT(!m_ReadThread.joinable() && !m_WriteThread.joinable());
        ASSERT(GetFD() != INVALID_SOCKET);
 
-       // TODO: figure out why we're not using "this" here
-       m_ReadThread = thread(boost::bind(&Socket::ReadThreadProc, static_cast<Socket::Ptr>(GetSelf())));
+       // TODO: figure out why we're not using "this" here (hint: to keep the object alive until the threads are done)
+       m_ReadThread = boost::thread(boost::bind(&Socket::ReadThreadProc, static_cast<Socket::Ptr>(GetSelf())));
        m_ReadThread.detach();
 
-       m_WriteThread = thread(boost::bind(&Socket::WriteThreadProc, static_cast<Socket::Ptr>(GetSelf())));
+       m_WriteThread = boost::thread(boost::bind(&Socket::WriteThreadProc, static_cast<Socket::Ptr>(GetSelf())));
        m_WriteThread.detach();
 
        Stream::Start();
index d0de45c3cfc41b7bbcd3ad585ef146405d33ec9c..8b0286dc847e63dbab9bb57a824a605c5f1217e9 100644 (file)
 #ifndef SOCKET_H
 #define SOCKET_H
 
+#include <boost/thread/thread.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/condition_variable.hpp>
+
 namespace icinga {
 
 /**
@@ -69,10 +73,10 @@ private:
        bool m_Connected;
        bool m_Listening;
 
-       thread m_ReadThread;
-       thread m_WriteThread;
+       boost::thread m_ReadThread;
+       boost::thread m_WriteThread;
 
-       condition_variable m_WriteCV;
+       boost::condition_variable m_WriteCV;
 
        void ReadThreadProc(void);
        void WriteThreadProc(void);
index 96d838020854a4491feb70a4afa9fae1d69497d6..41f3c0df5e8c715a8a611f733b44e191f6cbf1b4 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef STACKTRACE_H
 #define STACKTRACE_H
 
+#include <boost/thread/once.hpp>
+
 namespace icinga
 {
 
index 8b74a259ceaeec6348e362a9261b33ece4c027c2..9200e5e6e26c5cf63b6a950e21a34d707eadf137 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-base.h"
+#include <boost/algorithm/string/trim.hpp>
 
 using namespace icinga;
 
index 6e3ea92abd79a41a86dd372307c4225f5ac66636..1235f16dcea6e1ef4e9850264c75e61941666c46 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef STREAM_H
 #define STREAM_H
 
+#include <boost/exception_ptr.hpp>
+
 namespace icinga
 {
 
index ccc4136f527df902f1de44dad2beabe4768017d3..2c8612e2784b33f9d66414cd7d3ec61cad665bf2 100644 (file)
  ******************************************************************************/
 
 #include "i2-base.h"
+#include <boost/bind.hpp>
 
 using namespace icinga;
 
 Timer::TimerSet Timer::m_Timers;
-thread Timer::m_Thread;
+boost::thread Timer::m_Thread;
 boost::mutex Timer::m_Mutex;
 boost::condition_variable Timer::m_CV;
 bool Timer::m_StopThread;
@@ -62,7 +63,7 @@ void Timer::Initialize(void)
 {
        boost::mutex::scoped_lock lock(m_Mutex);
        m_StopThread = false;
-       m_Thread = thread(boost::bind(&Timer::TimerThreadProc));
+       m_Thread = boost::thread(boost::bind(&Timer::TimerThreadProc));
 }
 
 /**
index 818e7467447e23fbd35993c4bbd1561ea581be97..d95432d3eccadc81a47bef4469bef6525be6ecfb 100644 (file)
@@ -20,7 +20,9 @@
 #ifndef TIMER_H
 #define TIMER_H
 
-#include <time.h>
+#include <boost/thread/thread.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/condition_variable.hpp>
 
 namespace icinga {
 
@@ -82,7 +84,7 @@ private:
 
        static boost::mutex m_Mutex;
        static boost::condition_variable m_CV;
-       static thread m_Thread;
+       static boost::thread m_Thread;
        static bool m_StopThread;
        static TimerSet m_Timers;
 
index eae8e5eaaf4a9aacd975472ca6e9e8a96212e9f4..bcf608131ebce5cb9b3499523d72530647fa3ea9 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-base.h"
+#include <boost/bind.hpp>
 
 using namespace icinga;
 
index 1ad374429972d8ba788102dc24dd2c0c3fd5815c..99fca04329e967b75ad11c0e301986e2559cb589 100644 (file)
 
 #include "i2-base.h"
 #include <mmatch.h>
+#include <boost/uuid/uuid.hpp>
+#include <boost/uuid/uuid_generators.hpp>
+#include <boost/uuid/uuid_io.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/function.hpp>
 
 using namespace icinga;
 
@@ -402,7 +407,7 @@ String Utility::NewUUID(void)
  *
  * @param pathSpec The path specification.
  */
-bool Utility::Glob(const String& pathSpec, const function<void (const String&)>& callback)
+bool Utility::Glob(const String& pathSpec, const boost::function<void (const String&)>& callback)
 {
 #ifdef _WIN32
        HANDLE handle;
index 37827f0653437d5745b64819d2f6324959e23089..65eef9fe537a74de87b5449c2f0b51a7ef7c2f7d 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef UTILITY_H
 #define UTILITY_H
 
+#include <boost/function.hpp>
+
 namespace icinga
 {
 
@@ -53,7 +55,7 @@ public:
 
        static String NewUUID(void);
 
-       static bool Glob(const String& pathSpec, const function<void (const String&)>& callback);
+       static bool Glob(const String& pathSpec, const boost::function<void (const String&)>& callback);
 
        static void QueueAsyncCallback(const boost::function<void (void)>& callback);
 
index c5b9da189990ea522149a274c5ba4a49e74326a0..d82ce5b968906651808a63a02415d2cdf2fc5501 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "i2-base.h"
 #include <cJSON.h>
+#include <boost/lexical_cast.hpp>
 
 using namespace icinga;
 
index db84fc2ffc1701dd32870780aea3ad795b2de5c9..41bf94986d726b09dbf4af8136e1f54da3a020ba 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef VALUE_H
 #define VALUE_H
 
+#include <boost/variant.hpp>
+
 struct cJSON;
 
 namespace icinga
index cbe5cf091ad776ec2fd5dfbb895206abe13f2a63..2858b9af4cfa70b45ec7943ad70110131fbb1881 100644 (file)
@@ -32,7 +32,7 @@ namespace icinga
 class I2_CONFIG_API ConfigCompiler
 {
 public:
-       typedef function<void (const String&, bool, const DebugInfo&)> HandleIncludeFunc;
+       typedef boost::function<void (const String&, bool, const DebugInfo&)> HandleIncludeFunc;
 
        explicit ConfigCompiler(const String& path, istream *input = &cin,
            HandleIncludeFunc includeHandler = &ConfigCompiler::HandleFileInclude);
@@ -72,7 +72,7 @@ private:
        void DestroyScanner(void);
 };
 
-class I2_CONFIG_API ConfigFragmentRegistry : public Registry<String>
+class ConfigFragmentRegistry : public Registry<String>
 { };
 
 /**
index b966e4dc50d376034a121f572bd35f10854adba3..ece51dc80bc521df25d3558bb82c727bbc2f7f85 100644 (file)
  ******************************************************************************/
 
 #include "i2-config.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 
-recursive_mutex ConfigItem::m_Mutex;
+boost::mutex ConfigItem::m_Mutex;
 ConfigItem::ItemMap ConfigItem::m_Items;
 signals2::signal<void (const ConfigItem::Ptr&)> ConfigItem::OnCommitted;
 signals2::signal<void (const ConfigItem::Ptr&)> ConfigItem::OnRemoved;
@@ -184,7 +185,7 @@ DynamicObject::Ptr ConfigItem::Commit(void)
        ConfigItem::Ptr oldItem;
 
        {
-               recursive_mutex::scoped_lock lock(m_Mutex);
+               boost::mutex::scoped_lock lock(m_Mutex);
 
                ItemMap::iterator it = m_Items.find(ikey);
 
@@ -212,7 +213,7 @@ DynamicObject::Ptr ConfigItem::Commit(void)
        ConfigItem::Ptr self = GetSelf();
 
        {
-               recursive_mutex::scoped_lock lock(m_Mutex);
+               boost::mutex::scoped_lock lock(m_Mutex);
 
                /* Register this item. */
                m_Items[ikey] = self;
@@ -242,7 +243,7 @@ DynamicObject::Ptr ConfigItem::Commit(void)
 
                String key;
                Value data;
-               BOOST_FOREACH(tie(key, data), properties) {
+               BOOST_FOREACH(boost::tie(key, data), properties) {
                        Dictionary::Ptr attr = boost::make_shared<Dictionary>();
                        attr->Set("data", data);
                        attr->Set("type", Attribute_Config);
@@ -377,7 +378,7 @@ DynamicObject::Ptr ConfigItem::GetDynamicObject(void) const
  */
 ConfigItem::Ptr ConfigItem::GetObject(const String& type, const String& name)
 {
-       recursive_mutex::scoped_lock lock(m_Mutex);
+       boost::mutex::scoped_lock lock(m_Mutex);
 
        ConfigItem::ItemMap::iterator it;
 
@@ -425,20 +426,22 @@ void ConfigItem::Dump(ostream& fp) const
  */
 void ConfigItem::UnloadUnit(const String& unit)
 {
-       recursive_mutex::scoped_lock lock(m_Mutex);
+       vector<ConfigItem::Ptr> obsoleteItems;
 
-       Logger::Write(LogInformation, "config", "Unloading config items from compilation unit '" + unit + "'");
+       {
+               boost::mutex::scoped_lock lock(m_Mutex);
 
-       vector<ConfigItem::Ptr> obsoleteItems;
+               Logger::Write(LogInformation, "config", "Unloading config items from compilation unit '" + unit + "'");
 
-       ConfigItem::Ptr item;
-       BOOST_FOREACH(tie(tuples::ignore, item), m_Items) {
-               ObjectLock olock(item);
+               ConfigItem::Ptr item;
+               BOOST_FOREACH(boost::tie(boost::tuples::ignore, item), m_Items) {
+                       ObjectLock olock(item);
 
-               if (item->m_Unit != unit)
-                       continue;
+                       if (item->m_Unit != unit)
+                               continue;
 
-               obsoleteItems.push_back(item);
+                       obsoleteItems.push_back(item);
+               }
        }
 
        BOOST_FOREACH(const ConfigItem::Ptr& item, obsoleteItems) {
index 42c300af42266308d38c0f2bd908972d35a07ceb..73018d7e1bd80af63f6e62b6c45be533acf53175 100644 (file)
@@ -89,7 +89,7 @@ private:
         set<ConfigItem::WeakPtr> m_ChildObjects; /**< Instantiated items
                                                      * that inherit from this item */
 
-       static recursive_mutex m_Mutex;
+       static boost::mutex m_Mutex;
 
        typedef map<pair<String, String>, ConfigItem::Ptr> ItemMap;
        static ItemMap m_Items; /**< All registered configuration items. */
index 318c4a65c3f3e92500df87fea97f6d0dfceedc17..ec074cc5b6da1f5ddb94bf6728efdaf6bd15aba7 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-config.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 
@@ -141,7 +142,7 @@ void ConfigType::ValidateDictionary(const Dictionary::Ptr& dictionary,
 
        String key;
        Value value;
-       BOOST_FOREACH(tie(key, value), dictionary) {
+       BOOST_FOREACH(boost::tie(key, value), dictionary) {
                TypeValidationResult overallResult = ValidationUnknownField;
                vector<TypeRuleList::Ptr> subRuleLists;
 
index f3815bb619ec8d9c3b0cdef83a5ada03516491f3..6779ee76cb720097aab1991f79e511a0439c05ec 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-config.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 
@@ -89,7 +90,7 @@ void Expression::Execute(const Dictionary::Ptr& dictionary) const
 
                                String key;
                                Value value;
-                               BOOST_FOREACH(tie(key, value), valueDict) {
+                               BOOST_FOREACH(boost::tie(key, value), valueDict) {
                                        dict->Set(key, value);
                                }
                        } else {
@@ -134,7 +135,7 @@ void Expression::DumpValue(ostream& fp, int indent, const Value& value, bool inl
 
                String k;
                Value v;
-               BOOST_FOREACH(tie(k, v), static_cast<Dictionary::Ptr>(value)) {
+               BOOST_FOREACH(boost::tie(k, v), static_cast<Dictionary::Ptr>(value)) {
                        for (int i = 0; i < indent; i++)
                                fp << "\t";
 
index 728f9756872397204260128480baaceef55d5ddf..96751c109b91a085d48e8cd9c006ecc0afe8d514 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-icinga.h"
+#include <boost/algorithm/string/classification.hpp>
 
 using namespace icinga;
 
@@ -49,7 +50,7 @@ void ExternalCommandProcessor::Execute(const String& line)
        if (ts == 0)
                BOOST_THROW_EXCEPTION(invalid_argument("Invalid timestamp in command: " + line));
 
-       vector<String> argv = args.Split(is_any_of(";"));
+       vector<String> argv = args.Split(boost::is_any_of(";"));
 
        if (argv.empty())
                BOOST_THROW_EXCEPTION(invalid_argument("Missing arguments in command: " + line));
index db2ab65aaddb57c1e755dd78a8ff9b0ae9903f9d..f31ff4f3ce60c3dfdbfce089221e1b0b2071b416 100644 (file)
@@ -29,7 +29,7 @@ public:
        static void Execute(double time, const String& command, const vector<String>& arguments);
 
 private:
-       typedef function<void (double time, const vector<String>& arguments)> Callback;
+       typedef boost::function<void (double time, const vector<String>& arguments)> Callback;
 
        static boost::once_flag m_InitializeOnce;
        static boost::mutex m_Mutex;
index 53306b8bf68907a7f39c2ac1a5def82890f208d4..5b9ef6f41b7ca26bd6d27a8fe40a932d4926e458 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-icinga.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 
@@ -48,7 +49,7 @@ Host::~Host(void)
 
        if (m_SlaveServices) {
                ConfigItem::Ptr service;
-               BOOST_FOREACH(tie(tuples::ignore, service), m_SlaveServices) {
+               BOOST_FOREACH(boost::tie(boost::tuples::ignore, service), m_SlaveServices) {
                        service->Unregister();
                }
        }
@@ -225,7 +226,7 @@ void Host::UpdateSlaveServices(void)
                ObjectLock olock(serviceDescs);
                String svcname;
                Value svcdesc;
-               BOOST_FOREACH(tie(svcname, svcdesc), serviceDescs) {
+               BOOST_FOREACH(boost::tie(svcname, svcdesc), serviceDescs) {
                        if (svcdesc.IsScalar())
                                svcname = svcdesc;
 
@@ -270,7 +271,7 @@ void Host::UpdateSlaveServices(void)
                ObjectLock olock(oldServices);
 
                ConfigItem::Ptr service;
-               BOOST_FOREACH(tie(tuples::ignore, service), oldServices) {
+               BOOST_FOREACH(boost::tie(boost::tuples::ignore, service), oldServices) {
                        if (!service)
                                continue;
 
@@ -306,7 +307,7 @@ set<Service::Ptr> Host::GetServices(void) const
        boost::mutex::scoped_lock lock(m_ServiceMutex);
 
        Service::WeakPtr wservice;
-       BOOST_FOREACH(tie(tuples::ignore, wservice), m_ServicesCache[GetName()]) {
+       BOOST_FOREACH(boost::tie(boost::tuples::ignore, wservice), m_ServicesCache[GetName()]) {
                Service::Ptr service = wservice.lock();
 
                if (!service)
@@ -383,7 +384,7 @@ void Host::ValidateServiceDictionary(const ScriptTask::Ptr& task, const vector<V
 
        String key;
        Value value;
-       BOOST_FOREACH(tie(key, value), attrs) {
+       BOOST_FOREACH(boost::tie(key, value), attrs) {
                vector<String> templates;
 
                if (!value.IsObjectType<Dictionary>())
index 608ee821179751f00a2fd1a6bad1862218245d94..3a2010f11404aaa4a32516769daa15906d80445c 100644 (file)
@@ -31,9 +31,6 @@
 #include <i2-config.h>
 #include <i2-remoting.h>
 
-using boost::iterator_range;
-using boost::algorithm::is_any_of;
-
 #ifdef I2_ICINGA_BUILD
 #      define I2_ICINGA_API I2_EXPORT
 #else /* I2_ICINGA_BUILD */
index 902c062a434ea19fb7952e1cd6c354c6f4d58aa5..66b2941817876444d48aea2d57580f33bee9f413 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-icinga.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 
@@ -93,7 +94,7 @@ Dictionary::Ptr MacroProcessor::MergeMacroDicts(const vector<Dictionary::Ptr>& d
 
                String key;
                Value value;
-               BOOST_FOREACH(tie(key, value), dict) {
+               BOOST_FOREACH(boost::tie(key, value), dict) {
                        if (!value.IsScalar())
                                continue;
 
index 52827da8785511a3f0b331fd0a396a11aad997db..c02ff98527b8b4c6c498eb941319caea66c43d77 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-icinga.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 
@@ -88,13 +89,12 @@ set<User::Ptr> Notification::GetUsers(void) const
 {
        set<User::Ptr> result;
 
-       Dictionary::Ptr users = m_Users;
+       Array::Ptr users = m_Users;
 
        if (users) {
                ObjectLock olock(users);
 
-               String name;
-               BOOST_FOREACH(tie(tuples::ignore, name), users) {
+               BOOST_FOREACH(const String& name, users) {
                        User::Ptr user = User::GetByName(name);
 
                        if (!user)
@@ -114,13 +114,12 @@ set<UserGroup::Ptr> Notification::GetGroups(void) const
 {
        set<UserGroup::Ptr> result;
 
-       Dictionary::Ptr groups = m_Groups;
+       Array::Ptr groups = m_Groups;
 
        if (groups) {
                ObjectLock olock(groups);
 
-               String name;
-               BOOST_FOREACH(tie(tuples::ignore, name), groups) {
+               BOOST_FOREACH(const String& name, groups) {
                        UserGroup::Ptr ug = UserGroup::GetByName(name);
 
                        if (!ug)
index f6361a9074a95df7dbb28185da9b2f8e79173c02..a02f71802db101caa8e0bb494c9b59105215fc2b 100644 (file)
@@ -73,8 +73,8 @@ protected:
 private:
        Attribute<Value> m_NotificationCommand;
        Attribute<Dictionary::Ptr> m_Macros;
-       Attribute<Dictionary::Ptr> m_Users;
-       Attribute<Dictionary::Ptr> m_Groups;
+       Attribute<Array::Ptr> m_Users;
+       Attribute<Array::Ptr> m_Groups;
        Attribute<String> m_HostName;
        Attribute<String> m_Service;
 
index 88e0855f209dfe1e1caac35a32ea36f68b92868e..e46d5ac419d5007543f8219bca45ee4046f3835d 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-icinga.h"
+#include <boost/algorithm/string/classification.hpp>
 
 using namespace icinga;
 
@@ -104,7 +105,7 @@ Dictionary::Ptr PluginCheckTask::ParseCheckOutput(const String& output)
        String text;
        String perfdata;
 
-       vector<String> lines = output.Split(is_any_of("\r\n"));
+       vector<String> lines = output.Split(boost::is_any_of("\r\n"));
 
        BOOST_FOREACH (const String& line, lines) {
                size_t delim = line.FindFirstOf("|");
index 0ca50cb8b8bbd4d3dad2aca17cae7b4734d9973e..444f179c3fb6bcf04e5947441153b5a11c3364cd 100644 (file)
@@ -578,7 +578,7 @@ bool Service::IsAllowedChecker(const String& checker) const
 /**
  * @threadsafety Always.
  */
-void Service::BeginExecuteCheck(const function<void (void)>& callback)
+void Service::BeginExecuteCheck(const boost::function<void (void)>& callback)
 {
        ASSERT(!OwnsLock());
 
@@ -629,7 +629,7 @@ void Service::BeginExecuteCheck(const function<void (void)>& callback)
  * @threadsafety Always.
  */
 void Service::CheckCompletedHandler(const Dictionary::Ptr& checkInfo,
-    const ScriptTask::Ptr& task, const function<void (void)>& callback)
+    const ScriptTask::Ptr& task, const boost::function<void (void)>& callback)
 {
        ASSERT(!OwnsLock());
 
index 47a6a86c15b6b0074b3a4d3666089ec58b0bf1e4..d04176f74f77349f0520419bc5686e38554bda7c 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-icinga.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 
@@ -137,7 +138,7 @@ void Service::TriggerDowntimes(void)
        ObjectLock olock(downtimes);
 
        String id;
-       BOOST_FOREACH(tie(id, tuples::ignore), downtimes) {
+       BOOST_FOREACH(boost::tie(id, boost::tuples::ignore), downtimes) {
                TriggerDowntime(id);
        }
 }
@@ -165,7 +166,7 @@ void Service::TriggerDowntime(const String& id)
        Dictionary::Ptr triggers = downtime->Get("triggers");
        ObjectLock olock(triggers);
        String tid;
-       BOOST_FOREACH(tie(tid, tuples::ignore), triggers) {
+       BOOST_FOREACH(boost::tie(tid, boost::tuples::ignore), triggers) {
                TriggerDowntime(tid);
        }
 
@@ -295,7 +296,7 @@ void Service::RefreshDowntimesCache(void)
 
                String id;
                Dictionary::Ptr downtime;
-               BOOST_FOREACH(tie(id, downtime), downtimes) {
+               BOOST_FOREACH(boost::tie(id, downtime), downtimes) {
                        int legacy_id = downtime->Get("legacy_id");
 
                        if (legacy_id >= m_NextDowntimeID)
@@ -344,7 +345,7 @@ void Service::RemoveExpiredDowntimes(void)
 
                String id;
                Dictionary::Ptr downtime;
-               BOOST_FOREACH(tie(id, downtime), downtimes) {
+               BOOST_FOREACH(boost::tie(id, downtime), downtimes) {
                        if (IsDowntimeExpired(downtime))
                                expiredDowntimes.push_back(id);
                }
@@ -383,7 +384,7 @@ bool Service::IsInDowntime(void) const
        ObjectLock olock(downtimes);
 
        Dictionary::Ptr downtime;
-       BOOST_FOREACH(tie(tuples::ignore, downtime), downtimes) {
+       BOOST_FOREACH(boost::tie(boost::tuples::ignore, downtime), downtimes) {
                if (Service::IsDowntimeActive(downtime))
                        return true;
        }
index 138c2c4302cfa384218b330aa0c0227bcd29bdee..17795bd72c46855f98e68bebc8fa49e2dec807b8 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-icinga.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 
@@ -220,7 +221,7 @@ void Service::UpdateSlaveNotifications(void)
 
                String nfcname;
                Value nfcdesc;
-               BOOST_FOREACH(tie(nfcname, nfcdesc), notificationDescs) {
+               BOOST_FOREACH(boost::tie(nfcname, nfcdesc), notificationDescs) {
                        stringstream namebuf;
                        namebuf << GetName() << "-" << nfcname;
                        String name = namebuf.str();
@@ -261,7 +262,7 @@ void Service::UpdateSlaveNotifications(void)
                ObjectLock olock(oldNotifications);
 
                ConfigItem::Ptr notification;
-               BOOST_FOREACH(tie(tuples::ignore, notification), oldNotifications) {
+               BOOST_FOREACH(boost::tie(boost::tuples::ignore, notification), oldNotifications) {
                        if (!notification)
                                continue;
 
index 08ba0caeacf8156189579f10aa07727e2a75923c..9ee7a60edc5914f73d5dbd4a100ee8801e0017db 100644 (file)
@@ -167,7 +167,7 @@ public:
        void AcknowledgeProblem(AcknowledgementType type, double expiry = 0);
        void ClearAcknowledgement(void);
 
-       void BeginExecuteCheck(const function<void (void)>& callback);
+       void BeginExecuteCheck(const boost::function<void (void)>& callback);
        void ProcessCheckResult(const Dictionary::Ptr& cr);
 
        static double CalculateExecutionTime(const Dictionary::Ptr& cr);
@@ -288,7 +288,7 @@ private:
        long m_SchedulingOffset;
 
        void CheckCompletedHandler(const Dictionary::Ptr& checkInfo,
-           const ScriptTask::Ptr& task, const function<void (void)>& callback);
+           const ScriptTask::Ptr& task, const boost::function<void (void)>& callback);
 
        /* Downtimes */
        Attribute<Dictionary::Ptr> m_Downtimes;
index dc7cb06b513aa08db92fa5572bd332abb5154a9d..2df0a63df25cce4c214dc9fc171ee086acfbc9c1 100644 (file)
@@ -199,7 +199,7 @@ void Endpoint::SetSubscriptions(const Dictionary::Ptr& subscriptions)
        Touch("subscriptions");
 }
 
-void Endpoint::RegisterTopicHandler(const String& topic, const function<Endpoint::Callback>& callback)
+void Endpoint::RegisterTopicHandler(const String& topic, const boost::function<Endpoint::Callback>& callback)
 {
        ObjectLock olock(this);
 
@@ -222,7 +222,7 @@ void Endpoint::RegisterTopicHandler(const String& topic, const function<Endpoint
        RegisterSubscription(topic);
 }
 
-void Endpoint::UnregisterTopicHandler(const String&, const function<Endpoint::Callback>&)
+void Endpoint::UnregisterTopicHandler(const String&, const boost::function<Endpoint::Callback>&)
 {
        // TODO: implement
        //m_TopicHandlers[method] -= callback;
index 72d04a851ee3f8b28ec145572c9b3ab8917edbcc..b92cdf11f9b7c5948ee051145e7f4965be983cf9 100644 (file)
@@ -61,8 +61,8 @@ public:
 
        void ClearSubscriptions(void);
 
-       void RegisterTopicHandler(const String& topic, const function<Callback>& callback);
-       void UnregisterTopicHandler(const String& topic, const function<Callback>& callback);
+       void RegisterTopicHandler(const String& topic, const boost::function<Callback>& callback);
+       void UnregisterTopicHandler(const String& topic, const boost::function<Callback>& callback);
 
        String GetNode(void) const;
        String GetService(void) const;
index 008db7411f945ef55326e7b75dfd0bef239758a6..9739999bd0878bd025b2cde4c25a39cc00c09145 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "i2-remoting.h"
+#include <boost/tuple/tuple.hpp>
 
 using namespace icinga;
 
@@ -357,7 +358,7 @@ void EndpointManager::SubscriptionTimerHandler(void)
                        ObjectLock olock(endpointSubscriptions);
 
                        String topic;
-                       BOOST_FOREACH(tie(tuples::ignore, topic), endpointSubscriptions) {
+                       BOOST_FOREACH(boost::tie(boost::tuples::ignore, topic), endpointSubscriptions) {
                                subscriptions->Set(topic, topic);
                        }
                }
index adc2364244b85de9f3935ff45f1ff706fbee4656..95e7087be4da30acafc744de5d203a30c6dc1a7c 100644 (file)
@@ -53,7 +53,7 @@ public:
        void SendMulticastMessage(const RequestMessage& message);
        void SendMulticastMessage(const Endpoint::Ptr& sender, const RequestMessage& message);
 
-       typedef function<void(const Endpoint::Ptr, const RequestMessage&, const ResponseMessage&, bool TimedOut)> APICallback;
+       typedef boost::function<void(const Endpoint::Ptr, const RequestMessage&, const ResponseMessage&, bool TimedOut)> APICallback;
 
        void SendAPIMessage(const Endpoint::Ptr& sender, const Endpoint::Ptr& recipient, RequestMessage& message,
            const APICallback& callback, double timeout = 30);
@@ -84,7 +84,7 @@ private:
        {
                double Timeout;
                RequestMessage Request;
-               function<void(const Endpoint::Ptr, const RequestMessage&, const ResponseMessage&, bool TimedOut)> Callback;
+               boost::function<void(const Endpoint::Ptr, const RequestMessage&, const ResponseMessage&, bool TimedOut)> Callback;
 
                bool HasTimedOut(void) const
                {