]> granicus.if.org Git - icinga2/commitdiff
Replace boost::shared_ptr with boost::intrusive_ptr
authorGunnar Beutner <gunnar.beutner@netways.de>
Sat, 8 Nov 2014 20:17:16 +0000 (21:17 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Sun, 9 Nov 2014 15:54:41 +0000 (16:54 +0100)
refs #7622

169 files changed:
lib/base/CMakeLists.txt
lib/base/application.cpp
lib/base/application.hpp
lib/base/array.cpp
lib/base/console.hpp
lib/base/dictionary.cpp
lib/base/dynamicobject.cpp
lib/base/dynamicobject.hpp
lib/base/dynamictype.cpp
lib/base/dynamictype.hpp
lib/base/filelogger.cpp
lib/base/initialize.cpp [new file with mode: 0644]
lib/base/initialize.hpp
lib/base/json.cpp
lib/base/logger.cpp
lib/base/object.cpp
lib/base/object.hpp
lib/base/primitivetype.hpp
lib/base/process.cpp
lib/base/scriptfunction.cpp
lib/base/scriptutils.cpp
lib/base/scriptvariable.cpp
lib/base/scriptvariable.hpp
lib/base/serializer.cpp
lib/base/socket.cpp
lib/base/statsfunction.cpp
lib/base/streamlogger.cpp
lib/base/sysloglogger.cpp
lib/base/thinmutex.cpp
lib/base/timer.cpp
lib/base/tlsstream.cpp
lib/base/tlsstream.hpp
lib/base/tlsutility.cpp
lib/base/tlsutility.hpp
lib/base/type.hpp
lib/base/utility.hpp
lib/base/value-operators.cpp
lib/base/value.hpp
lib/base/visibility.hpp
lib/base/workqueue.cpp
lib/checker/checkercomponent.cpp
lib/cli/clicommand.hpp
lib/cli/daemoncommand.cpp
lib/cli/nodeblackandwhitelistcommand.cpp
lib/cli/nodeupdateconfigcommand.cpp
lib/cli/nodeutility.cpp
lib/cli/objectlistcommand.cpp
lib/cli/pkiutility.cpp
lib/cli/repositoryobjectcommand.cpp
lib/cli/repositoryutility.cpp
lib/cli/variableutility.cpp
lib/compat/checkresultreader.cpp
lib/compat/compatlogger.cpp
lib/compat/externalcommandlistener.cpp
lib/compat/statusdatawriter.cpp
lib/config/config_parser.yy
lib/config/configcompilercontext.cpp
lib/config/configitem.cpp
lib/config/configitembuilder.cpp
lib/config/configtype.cpp
lib/config/expression.cpp
lib/db_ido/commanddbobject.cpp
lib/db_ido/commanddbobject.hpp
lib/db_ido/dbconnection.cpp
lib/db_ido/dbconnection.ti
lib/db_ido/dbevents.cpp
lib/db_ido/dbobject.cpp
lib/db_ido/dbobject.hpp
lib/db_ido/dbquery.hpp
lib/db_ido/dbtype.cpp
lib/db_ido/dbtype.hpp
lib/db_ido/dbvalue.cpp
lib/db_ido/endpointdbobject.cpp
lib/db_ido/endpointdbobject.hpp
lib/db_ido/hostdbobject.cpp
lib/db_ido/hostgroupdbobject.cpp
lib/db_ido/servicedbobject.cpp
lib/db_ido/servicegroupdbobject.cpp
lib/db_ido/timeperioddbobject.cpp
lib/db_ido/userdbobject.cpp
lib/db_ido/usergroupdbobject.cpp
lib/db_ido_mysql/idomysqlconnection.cpp
lib/db_ido_mysql/idomysqlconnection.hpp
lib/db_ido_pgsql/idopgsqlconnection.cpp
lib/db_ido_pgsql/idopgsqlconnection.hpp
lib/demo/demo.cpp
lib/icinga/apievents.cpp
lib/icinga/checkable-check.cpp
lib/icinga/checkable-comment.cpp
lib/icinga/checkable-downtime.cpp
lib/icinga/checkable-event.cpp
lib/icinga/checkable-flapping.cpp
lib/icinga/checkable-notification.cpp
lib/icinga/checkable.cpp
lib/icinga/checkable.hpp
lib/icinga/checkable.ti
lib/icinga/cib.cpp
lib/icinga/command.cpp
lib/icinga/compatutility.cpp
lib/icinga/customvarobject.cpp
lib/icinga/dependency-apply.cpp
lib/icinga/dependency.cpp
lib/icinga/dependency.hpp
lib/icinga/downtime.ti
lib/icinga/externalcommandprocessor.cpp
lib/icinga/host.cpp
lib/icinga/host.hpp
lib/icinga/hostgroup.cpp
lib/icinga/icingaapplication.cpp
lib/icinga/icingastatuswriter.cpp
lib/icinga/legacytimeperiod.cpp
lib/icinga/macroprocessor.cpp
lib/icinga/notification-apply.cpp
lib/icinga/notification.cpp
lib/icinga/notification.hpp
lib/icinga/notificationcommand.hpp
lib/icinga/perfdatavalue.cpp
lib/icinga/pluginutility.cpp
lib/icinga/scheduleddowntime-apply.cpp
lib/icinga/scheduleddowntime.cpp
lib/icinga/service-apply.cpp
lib/icinga/service.cpp
lib/icinga/servicegroup.cpp
lib/icinga/timeperiod.cpp
lib/icinga/user.cpp
lib/icinga/user.ti
lib/icinga/usergroup.cpp
lib/livestatus/commandstable.cpp
lib/livestatus/contactgroupstable.cpp
lib/livestatus/contactstable.cpp
lib/livestatus/hostgroupstable.cpp
lib/livestatus/hoststable.cpp
lib/livestatus/livestatuslistener.cpp
lib/livestatus/livestatuslogutility.cpp
lib/livestatus/livestatusquery.cpp
lib/livestatus/servicegroupstable.cpp
lib/livestatus/servicestable.cpp
lib/livestatus/statehisttable.cpp
lib/livestatus/statustable.cpp
lib/livestatus/table.cpp
lib/livestatus/table.hpp
lib/methods/clrchecktask.cpp
lib/methods/icingachecktask.cpp
lib/methods/nullchecktask.cpp
lib/methods/pluginnotificationtask.cpp
lib/methods/randomchecktask.cpp
lib/methods/timeperiodtask.cpp
lib/notification/notificationcomponent.cpp
lib/perfdata/graphitewriter.cpp
lib/perfdata/perfdatawriter.cpp
lib/remote/apiclient.cpp
lib/remote/apifunction.cpp
lib/remote/apilistener-sync.cpp
lib/remote/apilistener.cpp
lib/remote/apilistener.hpp
lib/remote/authority.cpp
lib/remote/endpoint.cpp
lib/remote/endpoint.hpp
lib/remote/zone.cpp
lib/remote/zone.hpp
test/CMakeLists.txt
test/base-array.cpp
test/base-dictionary.cpp
test/base-fifo.cpp
test/base-netstring.cpp
test/base-object.cpp
test/base-serialize.cpp
test/base-stream.cpp
test/base-timer.cpp

index 1ae0f45543b2be9b2e95e63dedcf799b7c0f3634..e9f388f120cc6c563ce1fd0fb341e02616e1f088 100644 (file)
@@ -25,7 +25,7 @@ mkclass_target(sysloglogger.ti sysloglogger.thpp)
 set(base_SOURCES
   application.cpp application.thpp array.cpp configerror.cpp console.cpp context.cpp
   convert.cpp debuginfo.cpp dictionary.cpp dynamicobject.cpp dynamicobject.thpp dynamictype.cpp
-  exception.cpp fifo.cpp filelogger.cpp filelogger.thpp json.cpp logger.cpp logger.thpp
+  exception.cpp fifo.cpp filelogger.cpp filelogger.thpp initialize.cpp json.cpp logger.cpp logger.thpp
   netstring.cpp networkstream.cpp object.cpp objectlock.cpp primitivetype.cpp process.cpp
   ringbuffer.cpp scriptfunction.cpp scriptfunctionwrapper.cpp
   scriptutils.cpp scriptvariable.cpp serializer.cpp socket.cpp stacktrace.cpp
index 32b3c0162bcc24dbde87a8593dd197980976bab2..27be627919abc443085fb8175677fb1d4a31e47f 100644 (file)
@@ -44,7 +44,7 @@ using namespace icinga;
 REGISTER_TYPE(Application);
 
 boost::signals2::signal<void (void)> Application::OnReopenLogs;
-Application *Application::m_Instance = NULL;
+Application::Ptr Application::m_Instance = NULL;
 bool Application::m_ShuttingDown = false;
 bool Application::m_RequestRestart = false;
 bool Application::m_RequestReopenLogs = false;
@@ -153,10 +153,7 @@ void Application::InitializeBase(void)
  */
 Application::Ptr Application::GetInstance(void)
 {
-       if (!m_Instance)
-               return Application::Ptr();
-
-       return m_Instance->GetSelf();
+       return m_Instance;
 }
 
 void Application::SetResourceLimits(void)
@@ -341,7 +338,7 @@ pid_t Application::StartReloadProcess(void)
        Log(LogInformation, "Application", "Got reload command: Starting new instance.");
 
        // prepare arguments
-       Array::Ptr args = make_shared<Array>();
+       Array::Ptr args = new Array();
        args->Add(GetExePath(m_ArgV[0]));
 
        for (int i=1; i < Application::GetArgC(); i++) {
@@ -353,7 +350,7 @@ pid_t Application::StartReloadProcess(void)
        args->Add("--reload-internal");
        args->Add(Convert::ToString(Utility::GetPid()));
 
-       Process::Ptr process = make_shared<Process>(Process::PrepareCommand(args));
+       Process::Ptr process = new Process(Process::PrepareCommand(args));
        process->SetTimeout(300);
        process->Run(&ReloadProcessCallback);
 
index c346183cf561fdc038422eb77963e55037b19b15..42db856965357a99eec20906f0331d518f542f45 100644 (file)
@@ -144,7 +144,7 @@ protected:
        virtual void OnShutdown(void);
 
 private:
-       static Application *m_Instance; /**< The application instance. */
+       static Application::Ptr m_Instance; /**< The application instance. */
 
        static bool m_ShuttingDown; /**< Whether the application is in the process of
                                  shutting down. */
index 04760fa6be7e73f92fcfb9b7ed685ec5f7357619..c6a79bf4a94e004458b24bb578288c3992425221 100644 (file)
@@ -196,21 +196,21 @@ void Array::CopyTo(const Array::Ptr& dest) const
  */
 Array::Ptr Array::ShallowClone(void) const
 {
-       Array::Ptr clone = make_shared<Array>();
+       Array::Ptr clone = new Array();
        CopyTo(clone);
        return clone;
 }
 
 Array::Ptr icinga::MakeArray(const Value& val1)
 {
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
        result->Add(val1);
        return result;
 }
 
 Array::Ptr icinga::MakeArray(const Value& val1, const Value& val2)
 {
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
        result->Add(val1);
        result->Add(val2);
        return result;
@@ -218,7 +218,7 @@ Array::Ptr icinga::MakeArray(const Value& val1, const Value& val2)
 
 Array::Ptr icinga::MakeArray(const Value& val1, const Value& val2, const Value& val3)
 {
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
        result->Add(val1);
        result->Add(val2);
        result->Add(val3);
@@ -227,7 +227,7 @@ Array::Ptr icinga::MakeArray(const Value& val1, const Value& val2, const Value&
 
 Array::Ptr icinga::MakeArray(const Value& val1, const Value& val2, const Value& val3, const Value& val4)
 {
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
        result->Add(val1);
        result->Add(val2);
        result->Add(val3);
index cf9d7fd0a60902715e832bcdda1e9c6c89f7375d..3cf9a802a045bc225d80df7f8724309cf1a950e7 100644 (file)
@@ -75,6 +75,8 @@ private:
        int m_Color;
 };
 
+I2_BASE_API std::ostream& operator<<(std::ostream& fp, const ConsoleColorTag& cct);
+
 /**
  * Console utilities.
  *
index b87f1e64f097809be4a7adc48ca94fd05f8692cd..bf03c782c3e3182c6262dc48ee47be65dd650fe5 100644 (file)
@@ -211,7 +211,7 @@ void Dictionary::CopyTo(const Dictionary::Ptr& dest) const
  */
 Dictionary::Ptr Dictionary::ShallowClone(void) const
 {
-       Dictionary::Ptr clone = make_shared<Dictionary>();
+       Dictionary::Ptr clone = new Dictionary();
        CopyTo(clone);
        return clone;
 }
index 76e397dbc25643e2aaef90f66570b94e02bde8fa..77c4495c7c6492e7f9d56206dcbb8e61a37aa11a 100644 (file)
@@ -81,7 +81,7 @@ void DynamicObject::SetExtension(const String& key, const Object::Ptr& object)
        Dictionary::Ptr extensions = GetExtensions();
 
        if (!extensions) {
-               extensions = make_shared<Dictionary>();
+               extensions = new Dictionary();
                SetExtensions(extensions);
        }
 
@@ -113,7 +113,7 @@ void DynamicObject::Register(void)
        ASSERT(!OwnsLock());
 
        DynamicType::Ptr dtype = GetType();
-       dtype->RegisterObject(GetSelf());
+       dtype->RegisterObject(this);
 }
 
 void DynamicObject::Start(void)
@@ -140,7 +140,7 @@ void DynamicObject::Activate(void)
                SetActive(true);
        }
 
-       OnStarted(GetSelf());
+       OnStarted(this);
 
        SetAuthority(true);
 }
@@ -174,7 +174,7 @@ void DynamicObject::Deactivate(void)
 
        ASSERT(GetStopCalled());
 
-       OnStopped(GetSelf());
+       OnStopped(this);
 }
 
 void DynamicObject::OnConfigLoaded(void)
@@ -204,13 +204,13 @@ void DynamicObject::SetAuthority(bool authority)
                Resume();
                ASSERT(GetResumeCalled());
                SetPaused(false);
-               OnResumed(GetSelf());
+               OnResumed(this);
        } else if (!authority && !GetPaused()) {
                SetPauseCalled(false);
                Pause();
                ASSERT(GetPauseCalled());
                SetPaused(true);
-               OnPaused(GetSelf());
+               OnPaused(this);
        }
 }
 
@@ -256,11 +256,11 @@ void DynamicObject::DumpObjects(const String& filename, int attributeTypes)
        if (!fp)
                BOOST_THROW_EXCEPTION(std::runtime_error("Could not open '" + tempFilename + "' file"));
 
-       StdioStream::Ptr sfp = make_shared<StdioStream>(&fp, false);
+       StdioStream::Ptr sfp = new StdioStream(&fp, false);
 
        BOOST_FOREACH(const DynamicType::Ptr& type, DynamicType::GetTypes()) {
                BOOST_FOREACH(const DynamicObject::Ptr& object, type->GetObjects()) {
-                       Dictionary::Ptr persistentObject = make_shared<Dictionary>();
+                       Dictionary::Ptr persistentObject = new Dictionary();
 
                        persistentObject->Set("type", type->GetName());
                        persistentObject->Set("name", object->GetName());
@@ -331,7 +331,7 @@ void DynamicObject::RestoreObjects(const String& filename, int attributeTypes)
        std::fstream fp;
        fp.open(filename.CStr(), std::ios_base::in);
 
-       StdioStream::Ptr sfp = make_shared<StdioStream>(&fp, false);
+       StdioStream::Ptr sfp = new StdioStream (&fp, false);
 
        unsigned long restored = 0;
 
index 9b355bf4c46d94af3b7a6d7ec283215d8c0b21e3..46e3a24d6371d8396413fa579574feefb6206809 100644 (file)
@@ -52,7 +52,7 @@ public:
 
        Value InvokeMethod(const String& method, const std::vector<Value>& arguments);
 
-       shared_ptr<DynamicType> GetType(void) const;
+       intrusive_ptr<DynamicType> GetType(void) const;
 
        DebugInfo GetDebugInfo(void) const;
        void SetDebugInfo(const DebugInfo& di);
@@ -80,7 +80,7 @@ public:
        virtual void OnStateLoaded(void);
 
        template<typename T>
-       static shared_ptr<T> GetObject(const String& name)
+       static intrusive_ptr<T> GetObject(const String& name)
        {
                DynamicObject::Ptr object = GetObject(T::GetTypeName(), name);
 
@@ -101,15 +101,15 @@ private:
        DebugInfo m_DebugInfo;
 };
 
-#define DECLARE_OBJECTNAME(klass)                                      \
-       inline static String GetTypeName(void)                          \
-       {                                                               \
-               return #klass;                                          \
-       }                                                               \
-                                                                       \
-       inline static shared_ptr<klass> GetByName(const String& name)   \
-       {                                                               \
-               return DynamicObject::GetObject<klass>(name);           \
+#define DECLARE_OBJECTNAME(klass)                                              \
+       inline static String GetTypeName(void)                                  \
+       {                                                                       \
+               return #klass;                                                  \
+       }                                                                       \
+                                                                               \
+       inline static intrusive_ptr<klass> GetByName(const String& name)        \
+       {                                                                       \
+               return DynamicObject::GetObject<klass>(name);                   \
        }
 
 }
index a3449ce4f12e873b1102cc5935892a80fda0e0e8..d20d83de60b2c32138055c2a57f314cb7c9f02d4 100644 (file)
@@ -43,7 +43,7 @@ DynamicType::Ptr DynamicType::GetByName(const String& name)
                    || type->IsAbstract())
                        return DynamicType::Ptr();
 
-               DynamicType::Ptr dtype = make_shared<DynamicType>(name);
+               DynamicType::Ptr dtype = new DynamicType(name);
 
                InternalGetTypeMap()[type->GetName()] = dtype;
                InternalGetTypeVector().push_back(dtype);
@@ -78,8 +78,8 @@ DynamicType::TypeVector DynamicType::GetTypes(void)
 std::pair<DynamicTypeIterator<DynamicObject>, DynamicTypeIterator<DynamicObject> > DynamicType::GetObjects(void)
 {
        return std::make_pair(
-           DynamicTypeIterator<DynamicObject>(GetSelf(), 0),
-           DynamicTypeIterator<DynamicObject>(GetSelf(), -1)
+           DynamicTypeIterator<DynamicObject>(this, 0),
+           DynamicTypeIterator<DynamicObject>(this, -1)
        );
 }
 
index 6bac3d059e2076cf153496ad9234241e693f85ac..1896f6c92f97613256eb89868d9b040119287cc3 100644 (file)
@@ -81,7 +81,7 @@ private:
 };
 
 template<typename T>
-class DynamicTypeIterator : public boost::iterator_facade<DynamicTypeIterator<T>, const shared_ptr<T>, boost::forward_traversal_tag>
+class DynamicTypeIterator : public boost::iterator_facade<DynamicTypeIterator<T>, const intrusive_ptr<T>, boost::forward_traversal_tag>
 {
 public:
        DynamicTypeIterator(const DynamicType::Ptr& type, int index)
@@ -93,7 +93,7 @@ private:
 
        DynamicType::Ptr m_Type;
        DynamicType::ObjectVector::size_type m_Index;
-       mutable shared_ptr<T> m_Current;
+       mutable intrusive_ptr<T> m_Current;
 
        void increment(void)
        {
@@ -125,7 +125,7 @@ private:
                return (other.m_Index == m_Index);
        }
 
-       const shared_ptr<T>& dereference(void) const
+       const intrusive_ptr<T>& dereference(void) const
        {
                ObjectLock olock(m_Type);
                m_Current = static_pointer_cast<T>(*(m_Type->m_ObjectVector.begin() + m_Index));
index f92ced19861ea7723fac28548cccec144e351b1d..1b6b50a5a67a75d28a7846ae2d24d5b7be44a9fa 100644 (file)
@@ -31,7 +31,7 @@ REGISTER_STATSFUNCTION(FileLoggerStats, &FileLogger::StatsFunc);
 
 Value FileLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const FileLogger::Ptr& filelogger, DynamicType::GetObjectsByType<FileLogger>()) {
                nodes->Set(filelogger->GetName(), 1); //add more stats
diff --git a/lib/base/initialize.cpp b/lib/base/initialize.cpp
new file mode 100644 (file)
index 0000000..2de968a
--- /dev/null
@@ -0,0 +1,30 @@
+/******************************************************************************
+ * Icinga 2                                                                   *
+ * Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org)    *
+ *                                                                            *
+ * This program is free software; you can redistribute it and/or              *
+ * modify it under the terms of the GNU General Public License                *
+ * as published by the Free Software Foundation; either version 2             *
+ * of the License, or (at your option) any later version.                     *
+ *                                                                            *
+ * This program is distributed in the hope that it will be useful,            *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
+ * GNU General Public License for more details.                               *
+ *                                                                            *
+ * You should have received a copy of the GNU General Public License          *
+ * along with this program; if not, write to the Free Software Foundation     *
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
+ ******************************************************************************/
+
+#include "base/initialize.hpp"
+#include "base/utility.hpp"
+
+using namespace icinga;
+
+bool icinga::InitializeOnceHelper(void (*func)(void))
+{
+       Utility::AddDeferredInitializer(func);
+       return true;
+}
+
index 4e7319fdb6064e85ddfde5265977e7cb277d9a9c..27a71bd8fd619b43e071a42fe1d277c7e7eabdf9 100644 (file)
 #define INITIALIZE_H
 
 #include "base/i2-base.hpp"
-#include "base/utility.hpp"
 
 namespace icinga
 {
 
-typedef void (*InitializeFunc)(void);
+I2_BASE_API bool InitializeOnceHelper(void (*func)(void));
 
-inline bool InitializeOnceHelper(InitializeFunc func)
-{
-       Utility::AddDeferredInitializer(func);
-       return true;
-}
-
-#define INITIALIZE_ONCE(func) \
-       namespace { namespace UNIQUE_NAME(io) { \
-               I2_EXPORT bool l_InitializeOnce(icinga::InitializeOnceHelper(func)); \
+#define INITIALIZE_ONCE(func)                                                          \
+       namespace { namespace UNIQUE_NAME(io) {                                         \
+               I2_EXPORT bool l_InitializeOnce(icinga::InitializeOnceHelper(func));    \
        } }
 
 }
index a98949e82c4da7787138822265c467952b54e48f..fb72a57e753e2065e00ed8d4d8e8cd8de3d4da0f 100644 (file)
@@ -263,7 +263,7 @@ static int DecodeStartMap(void *ctx)
        JsonContext *context = static_cast<JsonContext *>(ctx);
 
        try {
-               context->Push(make_shared<Dictionary>());
+               context->Push(new Dictionary());
        } catch (...) {
                context->SaveException();
                return 0;
@@ -291,7 +291,7 @@ static int DecodeStartArray(void *ctx)
        JsonContext *context = static_cast<JsonContext *>(ctx);
        
        try {
-               context->Push(make_shared<Array>());
+               context->Push(new Array());
        } catch (...) {
                context->SaveException();
                return 0;
index c3ffb5ab61b0fea278aa223e611ccc09f638b4c1..de0e35133bfacc0d0e406ccf514c88b89b5c331d 100644 (file)
@@ -56,13 +56,13 @@ void Logger::Start(void)
        DynamicObject::Start();
 
        boost::mutex::scoped_lock lock(m_Mutex);
-       m_Loggers.insert(GetSelf());
+       m_Loggers.insert(this);
 }
 
 void Logger::Stop(void)
 {
        boost::mutex::scoped_lock lock(m_Mutex);
-       m_Loggers.erase(GetSelf());
+       m_Loggers.erase(this);
 }
 
 std::set<Logger::Ptr> Logger::GetLoggers(void)
index ad8ffa0f9a0a04352842baac67d499dd5aa427b7..eba735b37eede8e0fb9d384802173bd7564bb346 100644 (file)
@@ -33,8 +33,9 @@ boost::mutex Object::m_DebugMutex;
  * Default constructor for the Object class.
  */
 Object::Object(void)
+       : m_References(0)
 #ifdef _DEBUG
-       : m_Locked(false)
+       , m_Locked(false)
 #endif /* _DEBUG */
 { }
 
@@ -44,16 +45,6 @@ Object::Object(void)
 Object::~Object(void)
 { }
 
-/**
- * Returns a reference-counted pointer to this object.
- *
- * @returns A shared_ptr object that points to this object
- */
-Object::SharedPtrHolder Object::GetSelf(void)
-{
-       return Object::SharedPtrHolder(shared_from_this());
-}
-
 #ifdef _DEBUG
 /**
  * Checks if the calling thread owns the lock on this object.
@@ -68,11 +59,6 @@ bool Object::OwnsLock(void) const
 }
 #endif /* _DEBUG */
 
-Object::SharedPtrHolder::operator Value(void) const
-{
-       return m_Object;
-}
-
 void Object::SetField(int, const Value&)
 {
        BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
index 6ce60fd5ffdca367f359ffdc2b988726bd6a0531..bfb8fe5c4e77a020291baff1f0309f5634638450 100644 (file)
 #include <boost/thread/recursive_mutex.hpp>
 #endif /* _DEBUG */
 
-#ifndef _MSC_VER
-#include <boost/smart_ptr/shared_ptr.hpp>
-#include <boost/smart_ptr/weak_ptr.hpp>
-#include <boost/smart_ptr/enable_shared_from_this.hpp>
-#include <boost/smart_ptr/make_shared.hpp>
-
-using boost::shared_ptr;
-using boost::weak_ptr;
-using boost::enable_shared_from_this;
+#include <boost/smart_ptr/intrusive_ptr.hpp>
+
+using boost::intrusive_ptr;
 using boost::dynamic_pointer_cast;
 using boost::static_pointer_cast;
-using boost::make_shared;
-#else /* _MSC_VER */
-#include <memory>
-
-using std::shared_ptr;
-using std::weak_ptr;
-using std::enable_shared_from_this;
-using std::dynamic_pointer_cast;
-using std::static_pointer_cast;
-using std::make_shared;
-#endif /* _MSC_VER */
 
 #include <boost/tuple/tuple.hpp>
 using boost::tie;
@@ -65,14 +48,13 @@ class Object;
 class Type;
 
 #define DECLARE_PTR_TYPEDEFS(klass) \
-       typedef shared_ptr<klass> Ptr; \
-       typedef weak_ptr<klass> WeakPtr
-
-#define IMPL_TYPE_LOOKUP(klass) \
-       static shared_ptr<Type> TypeInstance; \
-       inline virtual shared_ptr<Type> GetReflectionType(void) const \
-       { \
-               return TypeInstance; \
+       typedef intrusive_ptr<klass> Ptr
+
+#define IMPL_TYPE_LOOKUP(klass)                                        \
+       static intrusive_ptr<Type> TypeInstance;                        \
+       virtual intrusive_ptr<Type> GetReflectionType(void) const       \
+       {                                                               \
+               return TypeInstance;                                    \
        }
 
 #define DECLARE_OBJECT(klass) \
@@ -80,12 +62,12 @@ class Type;
        IMPL_TYPE_LOOKUP(klass);
 
 template<typename T>
-shared_ptr<Object> DefaultObjectFactory(void)
+intrusive_ptr<Object> DefaultObjectFactory(void)
 {
-       return make_shared<T>();
+       return new T();
 }
 
-typedef shared_ptr<Object> (*ObjectFactory)(void);
+typedef intrusive_ptr<Object> (*ObjectFactory)(void);
 
 template<typename T>
 struct TypeHelper
@@ -102,7 +84,7 @@ struct TypeHelper
  *
  * @ingroup base
  */
-class I2_BASE_API Object : public enable_shared_from_this<Object>
+class I2_BASE_API Object
 {
 public:
        DECLARE_OBJECT(Object);
@@ -113,73 +95,15 @@ public:
        virtual void SetField(int id, const Value& value);
        virtual Value GetField(int id) const;
 
-       /**
-        * Holds a shared pointer and provides support for implicit upcasts.
-        *
-        * @ingroup base
-        */
-       class SharedPtrHolder
-       {
-       public:
-               /**
-                * Constructor for the SharedPtrHolder class.
-                *
-                * @param object The shared pointer that should be used to
-                *               construct this shared pointer holder.
-                */
-               explicit SharedPtrHolder(const Object::Ptr& object)
-                       : m_Object(object)
-               { }
-
-               /**
-                * Retrieves a shared pointer for the object that is associated
-                * this holder instance.
-                *
-                * @returns A shared pointer.
-                */
-               template<typename T>
-               operator shared_ptr<T>(void) const
-               {
-#ifdef _DEBUG
-                       shared_ptr<T> other = dynamic_pointer_cast<T>(m_Object);
-                       ASSERT(other);
-#else /* _DEBUG */
-                       shared_ptr<T> other = static_pointer_cast<T>(m_Object);
-#endif /* _DEBUG */
-
-                       return other;
-               }
-
-               /**
-                * Retrieves a weak pointer for the object that is associated
-                * with this holder instance.
-                *
-                * @returns A weak pointer.
-                */
-               template<typename T>
-               operator weak_ptr<T>(void) const
-               {
-                       return static_cast<shared_ptr<T> >(*this);
-               }
-
-               operator Value(void) const;
-
-       private:
-               Object::Ptr m_Object; /**< The object that belongs to this
-                                          holder instance */
-       };
-
 #ifdef _DEBUG
        bool OwnsLock(void) const;
 #endif /* _DEBUG */
 
-protected:
-       SharedPtrHolder GetSelf(void);
-
 private:
        Object(const Object& other);
        Object& operator=(const Object& rhs);
 
+       uintptr_t m_References;
        mutable ThinMutex m_Mutex;
 
 #ifdef _DEBUG
@@ -189,38 +113,32 @@ private:
 #endif /* _DEBUG */
 
        friend struct ObjectLock;
+
+       friend void intrusive_ptr_add_ref(Object *object);
+       friend void intrusive_ptr_release(Object *object);
 };
 
-/**
- * Compares a weak pointer with a raw pointer.
- *
- * @ingroup base
- */
-template<class T>
-struct WeakPtrEqual
+inline void intrusive_ptr_add_ref(Object *object)
 {
-private:
-       const void *m_Ref; /**< The object. */
+#ifdef _WIN32
+       InterlockedIncrement(&object->m_References);
+#else /* _WIN32 */
+       __sync_add_and_fetch(&object->m_References, 1);
+#endif /* _WIN32 */
+}
 
-public:
-       /**
-        * Constructor for the WeakPtrEqual class.
-        *
-        * @param ref The object that should be compared with the weak pointer.
-        */
-       WeakPtrEqual(const void *ref) : m_Ref(ref) { }
-
-       /**
-        * Compares the two pointers.
-        *
-        * @param wref The weak pointer.
-        * @returns true if the pointers point to the same object, false otherwise.
-        */
-       bool operator()(const weak_ptr<T>& wref) const
-       {
-               return (wref.lock().get() == static_cast<const T *>(m_Ref));
-       }
-};
+inline void intrusive_ptr_release(Object *object)
+{
+       uintptr_t refs;
+#ifdef _WIN32
+       refs = InterlockedDecrement(&object->m_References);
+#else /* _WIN32 */
+       refs = __sync_sub_and_fetch(&object->m_References, 1);
+#endif /* _WIN32 */
+
+       if (refs == 0)
+               delete object;
+}
 
 template<typename T>
 class ObjectImpl
@@ -230,3 +148,5 @@ class ObjectImpl
 }
 
 #endif /* OBJECT_H */
+
+#include "base/type.hpp"
index 0420331fc93f95e501e8ec5de2fe64c27f876343..02e52ecbeffe6d7feb0596b6c80a43957bf98711 100644 (file)
@@ -46,15 +46,14 @@ private:
        String m_Name;
 };
 
-#define REGISTER_BUILTIN_TYPE(type) \
-       namespace { namespace UNIQUE_NAME(prt) { namespace prt ## type { \
-               void RegisterPrimitiveType(void) \
-               { \
-                       icinga::Type::Ptr t = make_shared<PrimitiveType>(#type); \
-                       icinga::Type::Register(t); \
-               } \
-               \
-               INITIALIZE_ONCE(RegisterPrimitiveType); \
+#define REGISTER_BUILTIN_TYPE(type)                                            \
+       namespace { namespace UNIQUE_NAME(prt) { namespace prt ## type {        \
+               void RegisterPrimitiveType(void)                                \
+               {                                                               \
+                       icinga::Type::Ptr t = new PrimitiveType(#type);         \
+                       icinga::Type::Register(t);                              \
+               }                                                               \
+               INITIALIZE_ONCE(RegisterPrimitiveType);                         \
        } } }
 
 #define REGISTER_PRIMITIVE_TYPE(type) \
index 68fdfa468b5902d020768ad88c1854d3a24aae95..065d40e2bc8d7df905261e2fbdce3fda3d80c555 100644 (file)
@@ -586,7 +586,7 @@ void Process::Run(const boost::function<void(const ProcessResult&)>& callback)
 
        {
                boost::mutex::scoped_lock lock(l_ProcessMutex[tid]);
-               l_Processes[tid][m_Process] = GetSelf();
+               l_Processes[tid][m_Process] = this;
 #ifndef _WIN32
                l_FDs[tid][m_FD] = m_Process;
 #endif /* _WIN32 */
index 2852db422a9263462882a76d2c19b6a26abf994b..584e499194252063ae2a36867e935766d200993c 100644 (file)
@@ -54,6 +54,6 @@ void ScriptFunction::Unregister(const String& name)
 
 RegisterFunctionHelper::RegisterFunctionHelper(const String& name, const ScriptFunction::Callback& function)
 {
-       ScriptFunction::Register(name, make_shared<ScriptFunction>(function));
+       ScriptFunction::Register(name, new ScriptFunction(function));
 }
 
index 8f8823d0ba7dab06ca843d2a8f7a13bc1a0de4cd..9ad8200ef0af74703ea04512667aa1977dafa906 100644 (file)
@@ -82,7 +82,7 @@ Array::Ptr ScriptUtils::Union(const std::vector<Value>& arguments)
                }
        }
 
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
        BOOST_FOREACH(const Value& value, values) {
                result->Add(value);
        }
@@ -93,9 +93,9 @@ Array::Ptr ScriptUtils::Union(const std::vector<Value>& arguments)
 Array::Ptr ScriptUtils::Intersection(const std::vector<Value>& arguments)
 {
        if (arguments.size() == 0)
-               return make_shared<Array>();
+               return new Array();
 
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
 
        Array::Ptr arr1 = static_cast<Array::Ptr>(arguments[0])->ShallowClone();
 
@@ -164,7 +164,7 @@ Array::Ptr ScriptUtils::Range(const std::vector<Value>& arguments)
                        BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid number of arguments for range()"));
        }
 
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
 
        if ((start < end && increment <= 0) ||
            (start > end && increment >= 0))
@@ -200,7 +200,7 @@ Type::Ptr ScriptUtils::TypeOf(const Value& value)
 
 Array::Ptr ScriptUtils::Keys(const Dictionary::Ptr& dict)
 {
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
 
        ObjectLock olock(dict);
        BOOST_FOREACH(const Dictionary::Pair& kv, dict) {
index f730c1f93e667125e09297b248a0757e85950a2e..3fe1bfc5922ef26a7c72631fa0718ebe636423b7 100644 (file)
@@ -77,7 +77,7 @@ ScriptVariable::Ptr ScriptVariable::Set(const String& name, const Value& value,
        ScriptVariable::Ptr sv = GetByName(name);
 
        if (!sv) {
-               sv = make_shared<ScriptVariable>(value);
+               sv = new ScriptVariable(value);
                ScriptVariableRegistry::GetInstance()->Register(name, sv);
        } else if (overwrite) {
                if (sv->IsConstant())
@@ -110,10 +110,10 @@ void ScriptVariable::WriteVariablesFile(const String& filename)
        if (!fp)
                BOOST_THROW_EXCEPTION(std::runtime_error("Could not open '" + tempFilename + "' file"));
 
-       StdioStream::Ptr sfp = make_shared<StdioStream>(&fp, false);
+       StdioStream::Ptr sfp = new StdioStream(&fp, false);
 
        BOOST_FOREACH(const ScriptVariableRegistry::ItemMap::value_type& kv, ScriptVariableRegistry::GetInstance()->GetItems()) {
-               Dictionary::Ptr persistentVariable = make_shared<Dictionary>();
+               Dictionary::Ptr persistentVariable = new Dictionary();
 
                persistentVariable->Set("name", kv.first);
 
index 602c524c084a8354be003055aea2a92225b9d6af..6fc8f1f4e3efce03391b4d98a16c5837a6d8a5be 100644 (file)
@@ -29,7 +29,7 @@ namespace icinga
 
 class ScriptVariable;
 
-class I2_BASE_API ScriptVariableRegistry : public Registry<ScriptVariableRegistry, shared_ptr<ScriptVariable> >
+class I2_BASE_API ScriptVariableRegistry : public Registry<ScriptVariableRegistry, intrusive_ptr<ScriptVariable> >
 {
 public:
        static ScriptVariableRegistry *GetInstance(void);
index 2b3478fa525d1864f39288957334ea3dc2520920..4d714be5e9e4b670636568f3bd6cb3441018349e 100644 (file)
@@ -27,7 +27,7 @@ using namespace icinga;
 
 static Array::Ptr SerializeArray(const Array::Ptr& input, int attributeTypes)
 {
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
 
        ObjectLock olock(input);
 
@@ -40,7 +40,7 @@ static Array::Ptr SerializeArray(const Array::Ptr& input, int attributeTypes)
 
 static Dictionary::Ptr SerializeDictionary(const Dictionary::Ptr& input, int attributeTypes)
 {
-       Dictionary::Ptr result = make_shared<Dictionary>();
+       Dictionary::Ptr result = new Dictionary();
 
        ObjectLock olock(input);
 
@@ -57,7 +57,7 @@ static Object::Ptr SerializeObject(const Object::Ptr& input, int attributeTypes)
 
        VERIFY(type);
 
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
 
        for (int i = 0; i < type->GetFieldCount(); i++) {
                Field field = type->GetFieldInfo(i);
@@ -75,7 +75,7 @@ static Object::Ptr SerializeObject(const Object::Ptr& input, int attributeTypes)
 
 static Array::Ptr DeserializeArray(const Array::Ptr& input, bool safe_mode, int attributeTypes)
 {
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
 
        ObjectLock olock(input);
 
@@ -88,7 +88,7 @@ static Array::Ptr DeserializeArray(const Array::Ptr& input, bool safe_mode, int
 
 static Dictionary::Ptr DeserializeDictionary(const Dictionary::Ptr& input, bool safe_mode, int attributeTypes)
 {
-       Dictionary::Ptr result = make_shared<Dictionary>();
+       Dictionary::Ptr result = new Dictionary();
 
        ObjectLock olock(input);
 
index a82a028bb07acd1f08197164dece6820d8bc5169..044437b159f02afd925f3abb994052e47ba5840c 100644 (file)
@@ -341,7 +341,7 @@ Socket::Ptr Socket::Accept(void)
 #endif /* _WIN32 */
        }
 
-       return make_shared<Socket>(fd);
+       return new Socket(fd);
 }
 
 bool Socket::Poll(bool read, bool write)
index 42d12b9c4284df408284225be55ce3f99fbcf7b8..e36c6f700f9adb9e121340a81c0c73b9675202ff 100644 (file)
@@ -34,7 +34,7 @@ Value StatsFunction::Invoke(Dictionary::Ptr& status, Array::Ptr& perfdata)
 
 RegisterStatsFunctionHelper::RegisterStatsFunctionHelper(const String& name, const StatsFunction::Callback& function)
 {
-       StatsFunction::Ptr func = make_shared<StatsFunction>(function);
+       StatsFunction::Ptr func = new StatsFunction(function);
        StatsFunctionRegistry::GetInstance()->Register(name, func);
 }
 
index fbfb6c6177debb9eff345f027dc74df64ae7648e..e5ec78641b210fa6f6d9af92c09da61c6b126338 100644 (file)
@@ -80,7 +80,7 @@ void StreamLogger::BindStream(std::ostream *stream, bool ownsStream)
        m_Stream = stream;
        m_OwnsStream = ownsStream;
 
-       m_FlushLogTimer = make_shared<Timer>();
+       m_FlushLogTimer = new Timer();
        m_FlushLogTimer->SetInterval(1);
        m_FlushLogTimer->OnTimerExpired.connect(boost::bind(&StreamLogger::FlushLogTimerHandler, this));
        m_FlushLogTimer->Start();
index d0f26dddcf5790f4a819b1d1c4d34451fc9952ce..2790fe090dbcebf4523f756a227fd8a50983b530 100644 (file)
@@ -30,7 +30,7 @@ REGISTER_STATSFUNCTION(SyslogLoggerStats, &SyslogLogger::StatsFunc);
 
 Value SyslogLogger::StatsFunc(Dictionary::Ptr& status, Array::Ptr&)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const SyslogLogger::Ptr& sysloglogger, DynamicType::GetObjectsByType<SyslogLogger>()) {
                nodes->Set(sysloglogger->GetName(), 1); //add more stats
index e5307b75c9f6403eb99e7cbf8ee288312e9536a4..b2eedd430cddc2f1f927420be4d5fcdc94454fff 100644 (file)
@@ -43,7 +43,7 @@ void ThinMutex::DebugTimerHandler(void)
 
 static void InitThinMutex(void)
 {
-       l_Timer = make_shared<Timer>();
+       l_Timer = new Timer();
        l_Timer->SetInterval(10);
        l_Timer->OnTimerExpired.connect(boost::bind(&ThinMutex::DebugTimerHandler));
        l_Timer->Start();
index 2038827754fc62869e35f050300e916702536bf2..7538a16b307ec991b184edbf7c47207ff1382720 100644 (file)
@@ -91,10 +91,8 @@ void Timer::Call(void)
 {
        ASSERT(!OwnsLock());
 
-       Timer::Ptr self = GetSelf();
-
        try {
-               OnTimerExpired(self);
+               OnTimerExpired(Timer::Ptr(this));
        } catch (...) {
                Reschedule();
 
@@ -272,12 +270,12 @@ void Timer::TimerThreadProc(void)
                        continue;
                }
 
+               Timer::Ptr ptimer = timer;
+
                /* Remove the timer from the list so it doesn't get called again
                 * until the current call is completed. */
                l_Timers.erase(timer);
 
-               Timer::Ptr ptimer = timer->GetSelf();
-
                lock.unlock();
 
                /* Asynchronously call the timer. */
index 7d96fba8f7af2dd80784f9e1cc8e78436f0974f3..32f9324cf228b450f406e572c53d24baba23db2f 100644 (file)
@@ -35,13 +35,13 @@ bool I2_EXPORT TlsStream::m_SSLIndexInitialized = false;
  * @param role The role of the client.
  * @param sslContext The SSL context for the client.
  */
-TlsStream::TlsStream(const Socket::Ptr& socket, ConnectionRole role, const shared_ptr<SSL_CTX>& sslContext)
+TlsStream::TlsStream(const Socket::Ptr& socket, ConnectionRole role, const boost::shared_ptr<SSL_CTX>& sslContext)
        : m_Eof(false), m_VerifyOK(true), m_Socket(socket), m_Role(role)
 {
        std::ostringstream msgbuf;
        char errbuf[120];
 
-       m_SSL = shared_ptr<SSL>(SSL_new(sslContext.get()), SSL_free);
+       m_SSL = boost::shared_ptr<SSL>(SSL_new(sslContext.get()), SSL_free);
 
        if (!m_SSL) {
                msgbuf << "SSL_new() failed with code " << ERR_peek_error() << ", \"" << ERR_error_string(ERR_peek_error(), errbuf) << "\"";
@@ -90,10 +90,10 @@ bool TlsStream::IsVerifyOK(void) const
  *
  * @returns The X509 certificate.
  */
-shared_ptr<X509> TlsStream::GetClientCertificate(void) const
+boost::shared_ptr<X509> TlsStream::GetClientCertificate(void) const
 {
        boost::mutex::scoped_lock lock(m_SSLLock);
-       return shared_ptr<X509>(SSL_get_certificate(m_SSL.get()), &Utility::NullDeleter);
+       return boost::shared_ptr<X509>(SSL_get_certificate(m_SSL.get()), &Utility::NullDeleter);
 }
 
 /**
@@ -101,10 +101,10 @@ shared_ptr<X509> TlsStream::GetClientCertificate(void) const
  *
  * @returns The X509 certificate.
  */
-shared_ptr<X509> TlsStream::GetPeerCertificate(void) const
+boost::shared_ptr<X509> TlsStream::GetPeerCertificate(void) const
 {
        boost::mutex::scoped_lock lock(m_SSLLock);
-       return shared_ptr<X509>(SSL_get_peer_certificate(m_SSL.get()), X509_free);
+       return boost::shared_ptr<X509>(SSL_get_peer_certificate(m_SSL.get()), X509_free);
 }
 
 void TlsStream::Handshake(void)
index 00b24ce3b2f0779f90af037493660ddeffef0298..1014d81688e6dd6bbf94a9e00f1fb976b3d74e42 100644 (file)
@@ -38,10 +38,10 @@ class I2_BASE_API TlsStream : public Stream
 public:
        DECLARE_PTR_TYPEDEFS(TlsStream);
 
-       TlsStream(const Socket::Ptr& socket, ConnectionRole role, const shared_ptr<SSL_CTX>& sslContext);
+       TlsStream(const Socket::Ptr& socket, ConnectionRole role, const boost::shared_ptr<SSL_CTX>& sslContext);
 
-       shared_ptr<X509> GetClientCertificate(void) const;
-       shared_ptr<X509> GetPeerCertificate(void) const;
+       boost::shared_ptr<X509> GetClientCertificate(void) const;
+       boost::shared_ptr<X509> GetPeerCertificate(void) const;
 
        void Handshake(void);
 
@@ -55,7 +55,7 @@ public:
        bool IsVerifyOK(void) const;
 
 private:
-       shared_ptr<SSL> m_SSL;
+       boost::shared_ptr<SSL> m_SSL;
        bool m_Eof;
        mutable boost::mutex m_SSLLock;
        mutable boost::mutex m_IOActionLock;
index 1a902df82f6f85f03b56665aabb03e58a8dbaa19..e2978aa12dd6f80f5cda22a597af1d2ac4cccb5d 100644 (file)
@@ -75,14 +75,14 @@ void InitializeOpenSSL(void)
  * @param cakey CA certificate chain file.
  * @returns An SSL context.
  */
-shared_ptr<SSL_CTX> MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey)
+boost::shared_ptr<SSL_CTX> MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey)
 {
        std::ostringstream msgbuf;
        char errbuf[120];
 
        InitializeOpenSSL();
 
-       shared_ptr<SSL_CTX> sslContext = shared_ptr<SSL_CTX>(SSL_CTX_new(TLSv1_method()), SSL_CTX_free);
+       boost::shared_ptr<SSL_CTX> sslContext = boost::shared_ptr<SSL_CTX>(SSL_CTX_new(TLSv1_method()), SSL_CTX_free);
 
        SSL_CTX_set_mode(sslContext.get(), SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
 
@@ -146,7 +146,7 @@ shared_ptr<SSL_CTX> MakeSSLContext(const String& pubkey, const String& privkey,
  * @param context The SSL context.
  * @param crlPath The path to the CRL file.
  */
-void AddCRLToSSLContext(const shared_ptr<SSL_CTX>& context, const String& crlPath)
+void AddCRLToSSLContext(const boost::shared_ptr<SSL_CTX>& context, const String& crlPath)
 {
        char errbuf[120];
        X509_STORE *x509_store = SSL_CTX_get_cert_store(context.get());
@@ -183,7 +183,7 @@ void AddCRLToSSLContext(const shared_ptr<SSL_CTX>& context, const String& crlPat
  * @param certificate The X509 certificate.
  * @returns The common name.
  */
-String GetCertificateCN(const shared_ptr<X509>& certificate)
+String GetCertificateCN(const boost::shared_ptr<X509>& certificate)
 {
        char errbuf[120];
        char buffer[256];
@@ -208,7 +208,7 @@ String GetCertificateCN(const shared_ptr<X509>& certificate)
  * @param pemfile The filename.
  * @returns An X509 certificate.
  */
-shared_ptr<X509> GetX509Certificate(const String& pemfile)
+boost::shared_ptr<X509> GetX509Certificate(const String& pemfile)
 {
        char errbuf[120];
        X509 *cert;
@@ -243,7 +243,7 @@ shared_ptr<X509> GetX509Certificate(const String& pemfile)
 
        BIO_free(fpcert);
 
-       return shared_ptr<X509>(cert, X509_free);
+       return boost::shared_ptr<X509>(cert, X509_free);
 }
 
 int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile, const String& certfile, bool ca)
@@ -290,7 +290,7 @@ int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile,
                X509_NAME *subject = X509_NAME_new();
                X509_NAME_add_entry_by_txt(subject, "CN", MBSTRING_ASC, (unsigned char *)cn.CStr(), -1, -1, 0);
 
-               shared_ptr<X509> cert = CreateCert(key, subject, subject, key, ca);
+               boost::shared_ptr<X509> cert = CreateCert(key, subject, subject, key, ca);
 
                X509_NAME_free(subject);
 
@@ -367,7 +367,7 @@ int MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile,
        return 1;
 }
 
-shared_ptr<X509> CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca, const String& serialfile)
+boost::shared_ptr<X509> CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca, const String& serialfile)
 {
        X509 *cert = X509_new();
        X509_gmtime_adj(X509_get_notBefore(cert), 0);
@@ -414,7 +414,7 @@ shared_ptr<X509> CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *iss
 
        X509_sign(cert, cakey, NULL);
 
-       return shared_ptr<X509>(cert, X509_free);
+       return boost::shared_ptr<X509>(cert, X509_free);
 }
 
 String GetIcingaCADir(void)
@@ -422,7 +422,7 @@ String GetIcingaCADir(void)
        return Application::GetLocalStateDir() + "/lib/icinga2/ca";
 }
 
-shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject)
+boost::shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject)
 {
        char errbuf[120];
 
@@ -437,7 +437,7 @@ shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject)
        if (!cakeybio) {
                Log(LogCritical, "SSL")
                    << "Could not open CA key file '" << cakeyfile << "': " << ERR_peek_error() << ", \"" << ERR_error_string(ERR_peek_error(), errbuf) << "\"";
-               return shared_ptr<X509>();
+               return boost::shared_ptr<X509>();
        }
 
        rsa = PEM_read_bio_RSAPrivateKey(cakeybio, NULL, NULL, NULL);
@@ -445,14 +445,14 @@ shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject)
        if (!rsa) {
                Log(LogCritical, "SSL")
                    << "Could not read RSA key from CA key file '" << cakeyfile << "': " << ERR_peek_error() << ", \"" << ERR_error_string(ERR_peek_error(), errbuf) << "\"";
-               return shared_ptr<X509>();
+               return boost::shared_ptr<X509>();
        }
 
        BIO_free(cakeybio);
 
        String cacertfile = cadir + "/ca.crt";
 
-       shared_ptr<X509> cacert = GetX509Certificate(cacertfile);
+       boost::shared_ptr<X509> cacert = GetX509Certificate(cacertfile);
 
        EVP_PKEY *privkey = EVP_PKEY_new();
        EVP_PKEY_assign_RSA(privkey, rsa);
@@ -460,7 +460,7 @@ shared_ptr<X509> CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject)
        return CreateCert(pubkey, subject, X509_get_subject_name(cacert.get()), privkey, false, cadir + "/serial.txt");
 }
 
-String CertificateToString(const shared_ptr<X509>& cert)
+String CertificateToString(const boost::shared_ptr<X509>& cert)
 {
        BIO *mem = BIO_new(BIO_s_mem());
        PEM_write_bio_X509(mem, cert.get());
index fcd6af4224ddb6b61da9bf7dd464d332f2e9aeaf..a38bd3aa7cf4b053ff4a1ead0759e4d0f5ace0ef 100644 (file)
 #include <openssl/x509v3.h>
 #include <openssl/evp.h>
 #include <openssl/rand.h>
+#include <boost/smart_ptr/shared_ptr.hpp>
 
 namespace icinga
 {
 
 void I2_BASE_API InitializeOpenSSL(void);
-shared_ptr<SSL_CTX> I2_BASE_API MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey = String());
-void I2_BASE_API AddCRLToSSLContext(const shared_ptr<SSL_CTX>& context, const String& crlPath);
-String I2_BASE_API GetCertificateCN(const shared_ptr<X509>& certificate);
-shared_ptr<X509> I2_BASE_API GetX509Certificate(const String& pemfile);
+boost::shared_ptr<SSL_CTX> I2_BASE_API MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey = String());
+void I2_BASE_API AddCRLToSSLContext(const boost::shared_ptr<SSL_CTX>& context, const String& crlPath);
+String I2_BASE_API GetCertificateCN(const boost::shared_ptr<X509>& certificate);
+boost::shared_ptr<X509> I2_BASE_API GetX509Certificate(const String& pemfile);
 int I2_BASE_API MakeX509CSR(const String& cn, const String& keyfile, const String& csrfile = String(), const String& certfile = String(), bool ca = false);
-shared_ptr<X509> I2_BASE_API CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca, const String& serialfile = String());
+boost::shared_ptr<X509> I2_BASE_API CreateCert(EVP_PKEY *pubkey, X509_NAME *subject, X509_NAME *issuer, EVP_PKEY *cakey, bool ca, const String& serialfile = String());
 String I2_BASE_API GetIcingaCADir(void);
-String I2_BASE_API CertificateToString(const shared_ptr<X509>& cert);
-shared_ptr<X509> I2_BASE_API CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject);
+String I2_BASE_API CertificateToString(const boost::shared_ptr<X509>& cert);
+boost::shared_ptr<X509> I2_BASE_API CreateCertIcingaCA(EVP_PKEY *pubkey, X509_NAME *subject);
 String I2_BASE_API PBKDF2_SHA1(const String& password, const String& salt, int iterations);
 String I2_BASE_API SHA256(const String& s);
 String I2_BASE_API RandomString(int length);
index 47c3899ff36da42c2e89d9265c5f219cac7dcbe8..610a4939fbd049098bdf9d99c5ce9de79191afe3 100644 (file)
@@ -24,7 +24,6 @@
 #include "base/string.hpp"
 #include "base/object.hpp"
 #include "base/initialize.hpp"
-#include "base/utility.hpp"
 #include <boost/function.hpp>
 
 namespace icinga
@@ -42,11 +41,11 @@ class Type;
 struct Field
 {
        int ID;
-       shared_ptr<Type> FType;
+       intrusive_ptr<Type> FType;
        const char *Name;
        int Attributes;
 
-       Field(int id, const shared_ptr<Type>& type, const char *name, int attributes)
+       Field(int id, const intrusive_ptr<Type>& type, const char *name, int attributes)
                : ID(id), FType(type), Name(name), Attributes(attributes)
        { }
 };
@@ -95,7 +94,7 @@ class TypeImpl
        namespace { namespace UNIQUE_NAME(rt) { \
                void RegisterType ## type(void) \
                { \
-                       icinga::Type::Ptr t = make_shared<TypeImpl<type> >(); \
+                       icinga::Type::Ptr t = new TypeImpl<type>(); \
                        type::TypeInstance = t; \
                        icinga::Type::Register(t); \
                } \
@@ -105,7 +104,7 @@ class TypeImpl
        DEFINE_TYPE_INSTANCE(type)
 
 #define DEFINE_TYPE_INSTANCE(type) \
-       Type::Ptr type::TypeInstance;
+       Type::Ptr type::TypeInstance
 
 }
 
index ec435d7fc5dc0f19a653229dde674cb943620390..a944c049800b297511f461cf1c7cc95ac6aecba4 100644 (file)
 namespace icinga
 {
 
-#define TOKENPASTE(x, y) x ## y
-#define TOKENPASTE2(x, y) TOKENPASTE(x, y)
-
-#ifdef HAVE_COUNTER_MACRO
-#      define UNIQUE_NAME(prefix) TOKENPASTE2(prefix, __COUNTER__)
-#else /* HAVE_COUNTER_MACRO */
-#      define UNIQUE_NAME(prefix) prefix
-#endif /* HAVE_COUNTER_MACRO */
-
 #ifdef _WIN32
 #define MS_VC_EXCEPTION 0x406D1388
 
index 12e6f8f5caf25e3bbce3f37b0f77b30580d4a653..eb43582f701d926d1356e137a0c0c371269a055c 100644 (file)
@@ -203,14 +203,14 @@ Value icinga::operator+(const Value& lhs, const Value& rhs)
        else if ((lhs.IsNumber() || lhs.IsEmpty()) && (rhs.IsNumber() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty()))
                return static_cast<double>(lhs) + static_cast<double>(rhs);
        else if ((lhs.IsObjectType<Array>() || lhs.IsEmpty()) && (rhs.IsObjectType<Array>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) {
-               Array::Ptr result = make_shared<Array>();
+               Array::Ptr result = new Array();
                if (!lhs.IsEmpty())
                        static_cast<Array::Ptr>(lhs)->CopyTo(result);
                if (!rhs.IsEmpty())
                        static_cast<Array::Ptr>(rhs)->CopyTo(result);
                return result;
        } else if ((lhs.IsObjectType<Dictionary>() || lhs.IsEmpty()) && (rhs.IsObjectType<Dictionary>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) {
-               Dictionary::Ptr result = make_shared<Dictionary>();
+               Dictionary::Ptr result = new Dictionary();
                if (!lhs.IsEmpty())
                        static_cast<Dictionary::Ptr>(lhs)->CopyTo(result);
                if (!rhs.IsEmpty())
@@ -247,9 +247,9 @@ Value icinga::operator-(const Value& lhs, const Value& rhs)
                return static_cast<double>(lhs) - static_cast<double>(rhs);
        else if ((lhs.IsObjectType<Array>() || lhs.IsEmpty()) && (rhs.IsObjectType<Array>() || rhs.IsEmpty()) && !(lhs.IsEmpty() && rhs.IsEmpty())) {
                if (lhs.IsEmpty())
-                       return make_shared<Array>();
+                       return new Array();
 
-               Array::Ptr result = make_shared<Array>();
+               Array::Ptr result = new Array();
                Array::Ptr left = lhs;
                Array::Ptr right = rhs;
 
index 3326421dc578c5a06190f1f0721a7be2bdc4cc71..b890807ff3d3a0d9ef626bdd739502b1e0d18a2e 100644 (file)
@@ -58,8 +58,17 @@ public:
        Value(const String& value);
        Value(const char *value);
 
+       inline Value(Object *value)
+               : m_Value()
+       {
+               if (!value)
+                       return;
+
+               m_Value = Object::Ptr(value);
+       }
+
        template<typename T>
-       inline Value(const shared_ptr<T>& value)
+       inline Value(const intrusive_ptr<T>& value)
                : m_Value()
        {
                if (!value)
@@ -92,10 +101,10 @@ public:
        bool operator!=(const Value& rhs) const;
 
        template<typename T>
-       operator shared_ptr<T>(void) const
+       operator intrusive_ptr<T>(void) const
        {
                if (IsEmpty())
-                       return shared_ptr<T>();
+                       return intrusive_ptr<T>();
 
                if (!IsObject())
                        BOOST_THROW_EXCEPTION(std::runtime_error("Cannot convert value to object."));
@@ -104,7 +113,7 @@ public:
 
                ASSERT(object);
 
-               shared_ptr<T> tobject = dynamic_pointer_cast<T>(object);
+               intrusive_ptr<T> tobject = dynamic_pointer_cast<T>(object);
 
                if (!tobject)
                        BOOST_THROW_EXCEPTION(std::bad_cast());
index 9de87c160386c65b1fa858708152f2d55ae03549..c54a7e766866e7792d995361f3c7f28e50620e94 100644 (file)
 #      define I2_IMPORT __declspec(dllimport)
 #endif /* _WIN32 */
 
+#define TOKENPASTE(x, y) x ## y
+#define TOKENPASTE2(x, y) TOKENPASTE(x, y)
+
+#ifdef HAVE_COUNTER_MACRO
+#      define UNIQUE_NAME(prefix) TOKENPASTE2(prefix, __COUNTER__)
+#else /* HAVE_COUNTER_MACRO */
+#      define UNIQUE_NAME(prefix) prefix
+#endif /* HAVE_COUNTER_MACRO */
+
 #endif /* VISIBILITY_H */
index 39ca0cdbc371933d14d46300bd133d05b5ad4f1c..1d0256329d426773aa03b364b3d5c79eb60d8818 100644 (file)
@@ -32,7 +32,7 @@ WorkQueue::WorkQueue(size_t maxItems)
        : m_ID(m_NextID++), m_MaxItems(maxItems), m_Stopped(false),
          m_Processing(false), m_ExceptionCallback(WorkQueue::DefaultExceptionCallback)
 {
-       m_StatusTimer = make_shared<Timer>();
+       m_StatusTimer = new Timer();
        m_StatusTimer->SetInterval(10);
        m_StatusTimer->OnTimerExpired.connect(boost::bind(&WorkQueue::StatusTimerHandler, this));
        m_StatusTimer->Start();
index 8b0eabae963377956bc23141790978bb26aa308e..806a76687abd3bd4a6140073d86424a87b413032 100644 (file)
@@ -39,21 +39,21 @@ REGISTER_STATSFUNCTION(CheckerComponentStats, &CheckerComponent::StatsFunc);
 
 Value CheckerComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const CheckerComponent::Ptr& checker, DynamicType::GetObjectsByType<CheckerComponent>()) {
                unsigned long idle = checker->GetIdleCheckables();
                unsigned long pending = checker->GetPendingCheckables();
 
-               Dictionary::Ptr stats = make_shared<Dictionary>();
+               Dictionary::Ptr stats = new Dictionary();
                stats->Set("idle", idle);
                stats->Set("pending", pending);
 
                nodes->Set(checker->GetName(), stats);
 
                String perfdata_prefix = "checkercomponent_" + checker->GetName() + "_";
-               perfdata->Add(make_shared<PerfdataValue>(perfdata_prefix + "idle", Convert::ToDouble(idle)));
-               perfdata->Add(make_shared<PerfdataValue>(perfdata_prefix + "pending", Convert::ToDouble(pending)));
+               perfdata->Add(new PerfdataValue(perfdata_prefix + "idle", Convert::ToDouble(idle)));
+               perfdata->Add(new PerfdataValue(perfdata_prefix + "pending", Convert::ToDouble(pending)));
        }
 
        status->Set("checkercomponent", nodes);
@@ -79,7 +79,7 @@ void CheckerComponent::Start(void)
 
        m_Thread = boost::thread(boost::bind(&CheckerComponent::CheckThreadProc, this));
 
-       m_ResultTimer = make_shared<Timer>();
+       m_ResultTimer = new Timer();
        m_ResultTimer->SetInterval(5);
        m_ResultTimer->OnTimerExpired.connect(boost::bind(&CheckerComponent::ResultTimerHandler, this));
        m_ResultTimer->Start();
@@ -189,8 +189,7 @@ void CheckerComponent::CheckThreadProc(void)
                Log(LogDebug, "CheckerComponent")
                    << "Executing check for '" << checkable->GetName() << "'";
 
-               CheckerComponent::Ptr self = GetSelf();
-               Utility::QueueAsyncCallback(boost::bind(&CheckerComponent::ExecuteCheckHelper, self, checkable));
+               Utility::QueueAsyncCallback(boost::bind(&CheckerComponent::ExecuteCheckHelper, CheckerComponent::Ptr(this), checkable));
 
                lock.lock();
        }
@@ -201,7 +200,7 @@ void CheckerComponent::ExecuteCheckHelper(const Checkable::Ptr& checkable)
        try {
                checkable->ExecuteCheck();
        } catch (const std::exception& ex) {
-               CheckResult::Ptr cr = make_shared<CheckResult>();
+               CheckResult::Ptr cr = new CheckResult();
                cr->SetState(ServiceUnknown);
 
                String output = "Exception occured while checking '" + checkable->GetName() + "': " + DiagnosticInformation(ex);
index 985d5d4c9ed38d76c8f8feb27a833516edf4fc67..6deb0495e86a356019cbcac59c346cb37be59f8b 100644 (file)
@@ -97,7 +97,7 @@ public:
 
 #define REGISTER_CLICOMMAND(name, klass) \
        namespace { namespace UNIQUE_NAME(cli) { \
-               I2_EXPORT icinga::RegisterCLICommandHelper l_RegisterCLICommand(name, make_shared<klass>()); \
+               I2_EXPORT icinga::RegisterCLICommandHelper l_RegisterCLICommand(name, new klass()); \
        } }
 
 }
index 4dd8c856a263fe99ebc0e2c0c840122e09ea17eb..77eb811aabbac5853ce6703b359c09cc24b36652 100644 (file)
@@ -106,7 +106,7 @@ static bool LoadConfigFiles(const boost::program_options::variables_map& vm, con
                ConfigCompiler::CompileText(name, fragment);
        }
 
-       ConfigItemBuilder::Ptr builder = make_shared<ConfigItemBuilder>();
+       ConfigItemBuilder::Ptr builder = new ConfigItemBuilder();
        builder->SetType(appType);
        builder->SetName("application");
        ConfigItem::Ptr item = builder->Compile();
index 927f0ea583aa3be5972cc8838e10a59ebac41d64..f4954b67ee1ec7490c3adae52d38712a74a3d6bb 100644 (file)
@@ -43,13 +43,13 @@ RegisterBlackAndWhitelistCLICommandHelper::RegisterBlackAndWhitelistCLICommandHe
        name.push_back("node");
        name.push_back(ltype);
        name.push_back("add");
-       CLICommand::Register(name, make_shared<BlackAndWhitelistCommand>(type, BlackAndWhitelistCommandAdd));
+       CLICommand::Register(name, new BlackAndWhitelistCommand(type, BlackAndWhitelistCommandAdd));
 
        name[2] = "remove";
-       CLICommand::Register(name, make_shared<BlackAndWhitelistCommand>(type, BlackAndWhitelistCommandRemove));
+       CLICommand::Register(name, new BlackAndWhitelistCommand(type, BlackAndWhitelistCommandRemove));
 
        name[2] = "list";
-       CLICommand::Register(name, make_shared<BlackAndWhitelistCommand>(type, BlackAndWhitelistCommandList));
+       CLICommand::Register(name, new BlackAndWhitelistCommand(type, BlackAndWhitelistCommandList));
 }
 
 BlackAndWhitelistCommand::BlackAndWhitelistCommand(const String& type, BlackAndWhitelistCommandType command)
index 1a0d62b7ca9741e99355e17086585e8b7cf603ab..ed17c4d6f304276718b2e8c3ee4857eb02b31ace 100644 (file)
@@ -69,12 +69,12 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
 
        String inventory_path = NodeUtility::GetRepositoryPath() + "/inventory.index";
 
-       Dictionary::Ptr old_inventory = make_shared<Dictionary>();
+       Dictionary::Ptr old_inventory = new Dictionary();
        if (Utility::PathExists(inventory_path)) {
                old_inventory = Utility::LoadJsonFile(inventory_path);
        }
 
-       Dictionary::Ptr inventory = make_shared<Dictionary>();
+       Dictionary::Ptr inventory = new Dictionary();
 
        Log(LogInformation, "cli")
            << "Updating node configuration for ";
@@ -94,16 +94,16 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
                /* store existing structure in index */
                inventory->Set(endpoint, node);
 
-               Dictionary::Ptr host_services = make_shared<Dictionary>();
+               Dictionary::Ptr host_services = new Dictionary();
 
                Log(LogInformation, "cli")
                    << "Adding host '" << zone << "' to the repository.";
 
-               Dictionary::Ptr host_attrs = make_shared<Dictionary>();
+               Dictionary::Ptr host_attrs = new Dictionary();
                host_attrs->Set("__name", zone);
                host_attrs->Set("name", zone);
                host_attrs->Set("check_command", "cluster-zone");
-               Array::Ptr host_imports = make_shared<Array>();
+               Array::Ptr host_imports = new Array();
                host_imports->Add("satellite-host"); //default host node template
                host_attrs->Set("import", host_imports);
 
@@ -148,7 +148,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
 
                        if (!skip_host) {
                                /* add a new host to the config repository */
-                               Dictionary::Ptr host_attrs = make_shared<Dictionary>();
+                               Dictionary::Ptr host_attrs = new Dictionary();
                                host_attrs->Set("__name", host);
                                host_attrs->Set("name", host);
 
@@ -159,7 +159,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
                                        host_attrs->Set("zone", zone);
                                }
 
-                               Array::Ptr host_imports = make_shared<Array>();
+                               Array::Ptr host_imports = new Array();
                                host_imports->Add("satellite-host"); //default host node template
                                host_attrs->Set("import", host_imports);
 
@@ -209,7 +209,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
                                        continue;
 
                                /* add a new service for this host to the config repository */
-                               Dictionary::Ptr service_attrs = make_shared<Dictionary>();
+                               Dictionary::Ptr service_attrs = new Dictionary();
                                String long_name = host + "!" + service; //use NameComposer?
                                service_attrs->Set("__name", long_name);
                                service_attrs->Set("name", service);
@@ -217,7 +217,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
                                service_attrs->Set("check_command", "dummy");
                                service_attrs->Set("zone", zone);
 
-                               Array::Ptr service_imports = make_shared<Array>();
+                               Array::Ptr service_imports = new Array();
                                service_imports->Add("satellite-service"); //default service node template
                                service_attrs->Set("import", service_imports);
 
@@ -227,7 +227,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
                }
 
                /* write a new zone and endpoint for the node */
-               Dictionary::Ptr endpoint_attrs = make_shared<Dictionary>();
+               Dictionary::Ptr endpoint_attrs = new Dictionary();
                endpoint_attrs->Set("__name", endpoint);
                endpoint_attrs->Set("name", endpoint);
 
@@ -245,8 +245,8 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
                            << "Cannot add node endpoint '" << endpoint << "' to the config repository!\n";
                }
 
-               Dictionary::Ptr zone_attrs = make_shared<Dictionary>();
-               Array::Ptr zone_members = make_shared<Array>();
+               Dictionary::Ptr zone_attrs = new Dictionary();
+               Array::Ptr zone_members = new Array();
 
                zone_members->Add(endpoint);
                zone_attrs->Set("__name", zone);
@@ -296,7 +296,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
                        BOOST_FOREACH(const Dictionary::Pair& kv, old_node_repository) {
                                String host = kv.first;
 
-                               Dictionary::Ptr host_attrs = make_shared<Dictionary>();
+                               Dictionary::Ptr host_attrs = new Dictionary();
                                host_attrs->Set("name", host);
                                RepositoryUtility::RemoveObject(host, "Host", host_attrs); //this removes all services for this host as well
                        }
@@ -304,11 +304,11 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
                        String zone = old_node->Get("zone");
                        String endpoint = old_node->Get("endpoint");
 
-                       Dictionary::Ptr zone_attrs = make_shared<Dictionary>();
+                       Dictionary::Ptr zone_attrs = new Dictionary();
                        zone_attrs->Set("name", zone);
                        RepositoryUtility::RemoveObject(zone, "Zone", zone_attrs);
 
-                       Dictionary::Ptr endpoint_attrs = make_shared<Dictionary>();
+                       Dictionary::Ptr endpoint_attrs = new Dictionary();
                        endpoint_attrs->Set("name", endpoint);
                        RepositoryUtility::RemoveObject(endpoint, "Endpoint", endpoint_attrs);
                } else {
@@ -341,7 +341,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
                                        Log(LogInformation, "cli")
                                            << "Node update found old host '" << old_host << "' on node '" << old_node_name << "'. Removing it.";
 
-                                       Dictionary::Ptr host_attrs = make_shared<Dictionary>();
+                                       Dictionary::Ptr host_attrs = new Dictionary();
                                        host_attrs->Set("name", old_host);
                                        RepositoryUtility::RemoveObject(old_host, "Host", host_attrs); //this will remove all services for this host too
                                } else {
@@ -365,7 +365,7 @@ int NodeUpdateConfigCommand::Run(const boost::program_options::variables_map& vm
                                                            << "Node update found old service '" << old_service << "' on host '" << old_host
                                                            << "' on node '" << old_node_name << "'. Removing it.";
 
-                                                       Dictionary::Ptr service_attrs = make_shared<Dictionary>();
+                                                       Dictionary::Ptr service_attrs = new Dictionary();
                                                        service_attrs->Set("name", old_service);
                                                        service_attrs->Set("host_name", old_host);
                                                        RepositoryUtility::RemoveObject(old_service, "Service", service_attrs);
index f7cab6d40b500c1b83dd32a50f097bae7e1b64b5..c5291689e9d46b53d05ea2c213618a04f2d413d8 100644 (file)
@@ -122,7 +122,7 @@ void NodeUtility::PrintNodeRepository(std::ostream& fp, const Dictionary::Ptr& r
 
 void NodeUtility::PrintNodesJson(std::ostream& fp)
 {
-       Dictionary::Ptr result = make_shared<Dictionary>();
+       Dictionary::Ptr result = new Dictionary();
 
        BOOST_FOREACH(const Dictionary::Ptr& node, GetNodes()) {
                result->Set(node->Get("endpoint"), node);
@@ -140,7 +140,7 @@ void NodeUtility::AddNode(const String& name)
                    << "Node '" << name << "' exists already.";
        }
 
-       Dictionary::Ptr node = make_shared<Dictionary>();
+       Dictionary::Ptr node = new Dictionary();
 
        node->Set("seen", Utility::GetTime());
        node->Set("endpoint", name);
@@ -153,7 +153,7 @@ void NodeUtility::AddNode(const String& name)
 void NodeUtility::AddNodeSettings(const String& name, const String& host,
     const String& port, double log_duration)
 {
-       Dictionary::Ptr settings = make_shared<Dictionary>();
+       Dictionary::Ptr settings = new Dictionary();
 
        settings->Set("host", host);
        settings->Set("port", port);
@@ -237,10 +237,10 @@ void NodeUtility::CollectNodes(const String& node_file, std::vector<Dictionary::
 
 int NodeUtility::GenerateNodeIcingaConfig(const std::vector<std::string>& endpoints, const String& nodename, const String& zonename)
 {
-       Array::Ptr my_config = make_shared<Array>();
+       Array::Ptr my_config = new Array();
 
-       Dictionary::Ptr my_master_zone = make_shared<Dictionary>();
-       Array::Ptr my_master_zone_members = make_shared<Array>();
+       Dictionary::Ptr my_master_zone = new Dictionary();
+       Array::Ptr my_master_zone_members = new Array();
 
        String master_zone_name = "master"; //TODO: Find a better name.
 
@@ -250,7 +250,7 @@ int NodeUtility::GenerateNodeIcingaConfig(const std::vector<std::string>& endpoi
                std::vector<String> tokens;
                boost::algorithm::split(tokens, endpoint, boost::is_any_of(","));
 
-               Dictionary::Ptr my_master_endpoint = make_shared<Dictionary>();
+               Dictionary::Ptr my_master_endpoint = new Dictionary();
 
                if (tokens.size() > 1) {
                        String host = tokens[1];
@@ -283,13 +283,13 @@ int NodeUtility::GenerateNodeIcingaConfig(const std::vector<std::string>& endpoi
        my_config->Add(my_master_zone);
 
        /* store the local generated node configuration */
-       Dictionary::Ptr my_endpoint = make_shared<Dictionary>();
-       Dictionary::Ptr my_zone = make_shared<Dictionary>();
+       Dictionary::Ptr my_endpoint = new Dictionary();
+       Dictionary::Ptr my_zone = new Dictionary();
 
        my_endpoint->Set("__name", nodename);
        my_endpoint->Set("__type", "Endpoint");
 
-       Array::Ptr my_zone_members = make_shared<Array>();
+       Array::Ptr my_zone_members = new Array();
        my_zone_members->Add(nodename);
 
        my_zone->Set("__name", nodename);
@@ -312,12 +312,12 @@ int NodeUtility::GenerateNodeIcingaConfig(const std::vector<std::string>& endpoi
 
 int NodeUtility::GenerateNodeMasterIcingaConfig(const String& nodename)
 {
-       Array::Ptr my_config = make_shared<Array>();
+       Array::Ptr my_config = new Array();
 
        /* store the local generated node master configuration */
-       Dictionary::Ptr my_master_endpoint = make_shared<Dictionary>();
-       Dictionary::Ptr my_master_zone = make_shared<Dictionary>();
-       Array::Ptr my_master_zone_members = make_shared<Array>();
+       Dictionary::Ptr my_master_endpoint = new Dictionary();
+       Dictionary::Ptr my_master_zone = new Dictionary();
+       Array::Ptr my_master_zone_members = new Array();
 
        my_master_endpoint->Set("__name", nodename);
        my_master_endpoint->Set("__type", "Endpoint");
@@ -402,7 +402,7 @@ Array::Ptr NodeUtility::GetBlackAndWhiteList(const String& type)
 {
        String list_path = GetBlackAndWhiteListPath(type);
 
-       Array::Ptr lists = make_shared<Array>();
+       Array::Ptr lists = new Array();
 
        if (Utility::PathExists(list_path)) {
                lists = Utility::LoadJsonFile(list_path);
@@ -435,7 +435,7 @@ int NodeUtility::UpdateBlackAndWhiteList(const String& type, const String& zone_
                }
        }
 
-       Dictionary::Ptr new_filter = make_shared<Dictionary>();
+       Dictionary::Ptr new_filter = new Dictionary();
 
        new_filter->Set("zone", zone_filter);
        new_filter->Set("host", host_filter);
index 6c7c99b90813cf86c9cda068a52f4134a06fd103..0e36ba9d12de4e299f7da88efd31f1cfb9379b78 100644 (file)
@@ -78,7 +78,7 @@ int ObjectListCommand::Run(const boost::program_options::variables_map& vm, cons
        std::fstream fp;
        fp.open(objectfile.CStr(), std::ios_base::in);
 
-       StdioStream::Ptr sfp = make_shared<StdioStream>(&fp, false);
+       StdioStream::Ptr sfp = new StdioStream(&fp, false);
        unsigned long objects_count = 0;
        std::map<String, int> type_count;
 
index 842b5554388b81ebdd538f90b8e5ae2297ee6a98..478fdd8c232168c52ca64bf4935102afa0c6f553 100644 (file)
@@ -108,7 +108,7 @@ int PkiUtility::SignCsr(const String& csrfile, const String& certfile)
 
        BIO_free(csrbio);
 
-       shared_ptr<X509> cert = CreateCertIcingaCA(X509_REQ_get_pubkey(req), X509_REQ_get_subject_name(req));
+       boost::shared_ptr<X509> cert = CreateCertIcingaCA(X509_REQ_get_pubkey(req), X509_REQ_get_subject_name(req));
 
        X509_REQ_free(req);
 
@@ -129,13 +129,13 @@ int PkiUtility::SignCsr(const String& csrfile, const String& certfile)
 
 int PkiUtility::SaveCert(const String& host, const String& port, const String& keyfile, const String& certfile, const String& trustedfile)
 {
-       TcpSocket::Ptr client = make_shared<TcpSocket>();
+       TcpSocket::Ptr client = new TcpSocket();
 
        client->Connect(host, port);
 
-       shared_ptr<SSL_CTX> sslContext = MakeSSLContext(certfile, keyfile);
+       boost::shared_ptr<SSL_CTX> sslContext = MakeSSLContext(certfile, keyfile);
 
-       TlsStream::Ptr stream = make_shared<TlsStream>(client, RoleClient, sslContext);
+       TlsStream::Ptr stream = new TlsStream(client, RoleClient, sslContext);
 
        try {
                stream->Handshake();
@@ -143,7 +143,7 @@ int PkiUtility::SaveCert(const String& host, const String& port, const String& k
 
        }
 
-       shared_ptr<X509> cert = stream->GetPeerCertificate();
+       boost::shared_ptr<X509> cert = stream->GetPeerCertificate();
 
        std::ofstream fpcert;
        fpcert.open(trustedfile.CStr());
@@ -172,7 +172,7 @@ int PkiUtility::GenTicket(const String& cn, const String& salt, std::ostream& ti
 int PkiUtility::RequestCertificate(const String& host, const String& port, const String& keyfile,
     const String& certfile, const String& cafile, const String& trustedfile, const String& ticket)
 {
-       TcpSocket::Ptr client = make_shared<TcpSocket>();
+       TcpSocket::Ptr client = new TcpSocket();
 
        try {
                client->Connect(host, port);
@@ -184,7 +184,7 @@ int PkiUtility::RequestCertificate(const String& host, const String& port, const
                return 1;
        }
 
-       shared_ptr<SSL_CTX> sslContext;
+       boost::shared_ptr<SSL_CTX> sslContext;
 
        try {
                sslContext = MakeSSLContext(certfile, keyfile);
@@ -194,7 +194,7 @@ int PkiUtility::RequestCertificate(const String& host, const String& port, const
                return 1;
        }
 
-       TlsStream::Ptr stream = make_shared<TlsStream>(client, RoleClient, sslContext);
+       TlsStream::Ptr stream = new TlsStream(client, RoleClient, sslContext);
 
        try {
                stream->Handshake();
@@ -203,9 +203,9 @@ int PkiUtility::RequestCertificate(const String& host, const String& port, const
                return 1;
        }
 
-       shared_ptr<X509> peerCert = stream->GetPeerCertificate();
+       boost::shared_ptr<X509> peerCert = stream->GetPeerCertificate();
 
-       shared_ptr<X509> trustedCert;
+       boost::shared_ptr<X509> trustedCert;
 
        try {
                trustedCert = GetX509Certificate(trustedfile);
@@ -220,7 +220,7 @@ int PkiUtility::RequestCertificate(const String& host, const String& port, const
                return 1;
        }
 
-       Dictionary::Ptr request = make_shared<Dictionary>();
+       Dictionary::Ptr request = new Dictionary();
 
        String msgid = Utility::NewUniqueID();
 
@@ -228,7 +228,7 @@ int PkiUtility::RequestCertificate(const String& host, const String& port, const
        request->Set("id", msgid);
        request->Set("method", "pki::RequestCertificate");
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("ticket", String(ticket));
 
        request->Set("params", params);
index a3bbba435812183bd93822e3345b59b5a53bcceb..35ab319e3a204e644a8308a153b1bf940d5815f5 100644 (file)
@@ -45,13 +45,13 @@ RegisterRepositoryCLICommandHelper::RegisterRepositoryCLICommandHelper(const Str
        name.push_back("repository");
        name.push_back(ltype);
        name.push_back("add");
-       CLICommand::Register(name, make_shared<RepositoryObjectCommand>(type, RepositoryCommandAdd));
+       CLICommand::Register(name, new RepositoryObjectCommand(type, RepositoryCommandAdd));
 
        name[2] = "remove";
-       CLICommand::Register(name, make_shared<RepositoryObjectCommand>(type, RepositoryCommandRemove));
+       CLICommand::Register(name, new RepositoryObjectCommand(type, RepositoryCommandRemove));
 
        name[2] = "list";
-       CLICommand::Register(name, make_shared<RepositoryObjectCommand>(type, RepositoryCommandList));
+       CLICommand::Register(name, new RepositoryObjectCommand(type, RepositoryCommandList));
 }
 
 RepositoryObjectCommand::RepositoryObjectCommand(const String& type, RepositoryCommandType command)
@@ -183,7 +183,7 @@ int RepositoryObjectCommand::Run(const boost::program_options::variables_map& vm
        String name = attrs->Get("name");
 
        if (vm.count("import")) {
-               Array::Ptr imports = make_shared<Array>();
+               Array::Ptr imports = new Array();
 
                BOOST_FOREACH(const String& import, vm["import"].as<std::vector<std::string> >()) {
                        imports->Add(import);
index b9c64b91ebf59142362be53fccaea9b74e8c52e3..a02b024b9a5c37b7ff21a9a5fdfd8d354be174bc 100644 (file)
@@ -46,7 +46,7 @@ using namespace icinga;
 
 Dictionary::Ptr RepositoryUtility::GetArgumentAttributes(const std::vector<std::string>& arguments)
 {
-       Dictionary::Ptr attrs = make_shared<Dictionary>();
+       Dictionary::Ptr attrs = new Dictionary();
 
        BOOST_FOREACH(const String& kv, arguments) {
                std::vector<String> tokens;
@@ -160,7 +160,7 @@ void RepositoryUtility::PrintObjects(std::ostream& fp, const String& type)
 
 void RepositoryUtility::PrintChangeLog(std::ostream& fp)
 {
-       Array::Ptr changelog = make_shared<Array>();
+       Array::Ptr changelog = new Array();
 
        GetChangeLog(boost::bind(RepositoryUtility::CollectChange, _1, changelog));
 
@@ -204,7 +204,7 @@ bool RepositoryUtility::AddObject(const String& name, const String& type, const
        /* add a new changelog entry by timestamp */
        String path = GetRepositoryChangeLogPath() + "/" + Convert::ToString(Utility::GetTime()) + "-" + type + "-" + SHA256(name) + ".change";
 
-       Dictionary::Ptr change = make_shared<Dictionary>();
+       Dictionary::Ptr change = new Dictionary();
 
        change->Set("timestamp", Utility::GetTime());
        change->Set("name", name);
@@ -269,7 +269,7 @@ bool RepositoryUtility::RemoveObject(const String& name, const String& type, con
        /* add a new changelog entry by timestamp */
        String path = GetRepositoryChangeLogPath() + "/" + Convert::ToString(Utility::GetTime()) + "-" + type + "-" + SHA256(name) + ".change";
 
-       Dictionary::Ptr change = make_shared<Dictionary>();
+       Dictionary::Ptr change = new Dictionary();
 
        change->Set("timestamp", Utility::GetTime());
        change->Set("name", name);
@@ -299,7 +299,7 @@ bool RepositoryUtility::CheckChangeExists(const Dictionary::Ptr& change)
 {
        Dictionary::Ptr attrs = change->Get("attrs");
 
-       Array::Ptr changelog = make_shared<Array>();
+       Array::Ptr changelog = new Array();
 
        GetChangeLog(boost::bind(RepositoryUtility::CollectChange, _1, changelog));
 
@@ -336,7 +336,7 @@ bool RepositoryUtility::ClearChangeLog(void)
 
 bool RepositoryUtility::ChangeLogHasPendingChanges(void)
 {
-       Array::Ptr changelog = make_shared<Array>();
+       Array::Ptr changelog = new Array();
        GetChangeLog(boost::bind(RepositoryUtility::CollectChange, _1, changelog));
 
        return changelog->GetLength() > 0;
index 2919cb7969f6e10c86e92e4d4c79ead9bfc99710..5d85496f44f06593d3960ce5c349fb4c778f3e02 100644 (file)
@@ -36,7 +36,7 @@ Value VariableUtility::GetVariable(const String& name)
        std::fstream fp;
        fp.open(varsfile.CStr(), std::ios_base::in);
 
-       StdioStream::Ptr sfp = make_shared<StdioStream>(&fp, false);
+       StdioStream::Ptr sfp = new StdioStream(&fp, false);
 
        String message;
 
@@ -58,7 +58,7 @@ void VariableUtility::PrintVariables(std::ostream& outfp)
        std::fstream fp;
        fp.open(varsfile.CStr(), std::ios_base::in);
 
-       StdioStream::Ptr sfp = make_shared<StdioStream>(&fp, false);
+       StdioStream::Ptr sfp = new StdioStream(&fp, false);
        unsigned long variables_count = 0;
 
        String message;
index 4e9c688103120402a6cf9c2df4656244d0840bfe..25cabc37b0750c9770f9e3abf57f0919d0aec0c5 100644 (file)
@@ -40,7 +40,7 @@ REGISTER_STATSFUNCTION(CheckResultReaderStats, &CheckResultReader::StatsFunc);
 
 Value CheckResultReader::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const CheckResultReader::Ptr& checkresultreader, DynamicType::GetObjectsByType<CheckResultReader>()) {
                nodes->Set(checkresultreader->GetName(), 1); //add more stats
@@ -56,7 +56,7 @@ Value CheckResultReader::StatsFunc(const Dictionary::Ptr& status, const Array::P
  */
 void CheckResultReader::Start(void)
 {
-       m_ReadTimer = make_shared<Timer>();
+       m_ReadTimer = new Timer();
        m_ReadTimer->OnTimerExpired.connect(boost::bind(&CheckResultReader::ReadTimerHandler, this));
        m_ReadTimer->SetInterval(5);
        m_ReadTimer->Start();
@@ -134,7 +134,7 @@ void CheckResultReader::ProcessCheckResultFile(const String& path) const
                return;
        }
 
-       CheckResult::Ptr result = make_shared<CheckResult>();
+       CheckResult::Ptr result = new CheckResult();
        std::pair<String, Value> co = PluginUtility::ParseCheckOutput(attrs["output"]);
        result->SetOutput(co.first);
        result->SetPerformanceData(PluginUtility::SplitPerfdata(co.second));
index bb8a9e3bfb8f68de44fa5e6dac0073ab4ad2911b..1c3a3f0769c160868deb8682bc939e09fd0259e6 100644 (file)
@@ -47,7 +47,7 @@ REGISTER_STATSFUNCTION(CompatLoggerStats, &CompatLogger::StatsFunc);
 
 Value CompatLogger::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const CompatLogger::Ptr& compat_logger, DynamicType::GetObjectsByType<CompatLogger>()) {
                nodes->Set(compat_logger->GetName(), 1); //add more stats
@@ -73,7 +73,7 @@ void CompatLogger::Start(void)
        Checkable::OnEventCommandExecuted.connect(bind(&CompatLogger::EventCommandHandler, this, _1));
        ExternalCommandProcessor::OnNewExternalCommand.connect(boost::bind(&CompatLogger::ExternalCommandHandler, this, _2, _3));
 
-       m_RotationTimer = make_shared<Timer>();
+       m_RotationTimer = new Timer();
        m_RotationTimer->OnTimerExpired.connect(boost::bind(&CompatLogger::RotationTimerHandler, this));
        m_RotationTimer->Start();
 
index 6cdd4a5d763706a6e7d5d774cbafb5581542b33a..95be3715045f7a85155676f35ac380142cc625b9 100644 (file)
@@ -33,7 +33,7 @@ REGISTER_STATSFUNCTION(ExternalCommandListenerStats, &ExternalCommandListener::S
 
 Value ExternalCommandListener::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const ExternalCommandListener::Ptr& externalcommandlistener, DynamicType::GetObjectsByType<ExternalCommandListener>()) {
                nodes->Set(externalcommandlistener->GetName(), 1); //add more stats
index df57ce355dfad5bb730a0c2d427d1ee8d8d5700f..57efb57db583b1d18dd162cbe36d15bfcca6b7d8 100644 (file)
@@ -51,7 +51,7 @@ REGISTER_STATSFUNCTION(StatusDataWriterStats, &StatusDataWriter::StatsFunc);
 
 Value StatusDataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const StatusDataWriter::Ptr& statusdatawriter, DynamicType::GetObjectsByType<StatusDataWriter>()) {
                nodes->Set(statusdatawriter->GetName(), 1); //add more stats
@@ -75,7 +75,7 @@ void StatusDataWriter::Start(void)
 {
        DynamicObject::Start();
 
-       m_StatusTimer = make_shared<Timer>();
+       m_StatusTimer = new Timer();
        m_StatusTimer->SetInterval(GetUpdateInterval());
        m_StatusTimer->OnTimerExpired.connect(boost::bind(&StatusDataWriter::StatusTimerHandler, this));
        m_StatusTimer->Start();
index 0b801f5f18e163557546bfb9c47ed713dab87830..22fcc22a9bd3d7a3cf3b0a3e84694c2c4360f91c 100644 (file)
@@ -75,7 +75,7 @@ int ignore_newlines = 0;
 
 static void MakeRBinaryOp(Value** result, Expression::OpCallback& op, Value *left, Value *right, DebugInfo& diLeft, DebugInfo& diRight)
 {
-       *result = new Value(make_shared<Expression>(op, *left, *right, DebugInfoRange(diLeft, diRight)));
+       *result = new Value(new Expression(op, *left, *right, DebugInfoRange(diLeft, diRight)));
        delete left;
        delete right;
 }
@@ -231,7 +231,7 @@ static std::stack<Expression::Ptr> m_FTerm;
 
 void ConfigCompiler::Compile(void)
 {
-       m_ModuleScope = make_shared<Dictionary>();
+       m_ModuleScope = new Dictionary();
 
        m_Abstract = std::stack<bool>();
        m_RuleLists = std::stack<TypeRuleList::Ptr>();
@@ -343,7 +343,7 @@ type: T_TYPE identifier
                m_Type = ConfigType::GetByName(name);
 
                if (!m_Type) {
-                       m_Type = make_shared<ConfigType>(name, DebugInfoRange(@1, @2));
+                       m_Type = new ConfigType(name, DebugInfoRange(@1, @2));
                        m_Type->Register();
                }
        }
@@ -363,7 +363,7 @@ type: T_TYPE identifier
 
 typerulelist: '{'
        {
-               m_RuleLists.push(make_shared<TypeRuleList>());
+               m_RuleLists.push(new TypeRuleList());
        }
        typerules
        '}'
@@ -447,7 +447,7 @@ object:
        {
                m_ObjectAssign.pop();
 
-               Array::Ptr args = make_shared<Array>();
+               Array::Ptr args = new Array();
                
                args->Add(m_Abstract.top());
                m_Abstract.pop();
@@ -468,17 +468,17 @@ object:
 
                m_SeenAssign.pop();
 
-               Expression::Ptr rex = make_shared<Expression>(&Expression::OpLogicalNegate, m_Ignore.top(), DebugInfoRange(@2, @5));
+               Expression::Ptr rex = new Expression(&Expression::OpLogicalNegate, m_Ignore.top(), DebugInfoRange(@2, @5));
                m_Ignore.pop();
 
-               Expression::Ptr filter = make_shared<Expression>(&Expression::OpLogicalAnd, m_Assign.top(), rex, DebugInfoRange(@2, @5));
+               Expression::Ptr filter = new Expression(&Expression::OpLogicalAnd, m_Assign.top(), rex, DebugInfoRange(@2, @5));
                m_Assign.pop();
 
                args->Add(filter);
 
                args->Add(context->GetZone());
 
-               $$ = new Value(make_shared<Expression>(&Expression::OpObject, args, exprl, DebugInfoRange(@2, @5)));
+               $$ = new Value(new Expression(&Expression::OpObject, args, exprl, DebugInfoRange(@2, @5)));
        }
        ;
 
@@ -602,13 +602,13 @@ lterm_items_inner: lterm
 
 lterm: indexer combined_set_op rterm
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpSet, MakeArray(Array::Ptr($1), $2), *$3, DebugInfoRange(@1, @3)));
+               $$ = new Value(new Expression(&Expression::OpSet, MakeArray(Array::Ptr($1), $2), *$3, DebugInfoRange(@1, @3)));
                delete $3;
        }
        | T_IMPORT rterm
        {
-               Expression::Ptr avar = make_shared<Expression>(&Expression::OpVariable, "type", DebugInfoRange(@1, @2));
-               $$ = new Value(make_shared<Expression>(&Expression::OpImport, avar, *$2, DebugInfoRange(@1, @2)));
+               Expression::Ptr avar = new Expression(&Expression::OpVariable, "type", DebugInfoRange(@1, @2));
+               $$ = new Value(new Expression(&Expression::OpImport, avar, *$2, DebugInfoRange(@1, @2)));
                delete $2;
        }
        | T_ASSIGN T_WHERE rterm
@@ -618,7 +618,7 @@ lterm: indexer combined_set_op rterm
 
                m_SeenAssign.top() = true;
 
-               m_Assign.top() = make_shared<Expression>(&Expression::OpLogicalOr, m_Assign.top(), *$3, DebugInfoRange(@1, @3));
+               m_Assign.top() = new Expression(&Expression::OpLogicalOr, m_Assign.top(), *$3, DebugInfoRange(@1, @3));
                delete $3;
 
                $$ = new Value(MakeLiteral());
@@ -628,7 +628,7 @@ lterm: indexer combined_set_op rterm
                if ((m_Apply.empty() || !m_Apply.top()) && (m_ObjectAssign.empty() || !m_ObjectAssign.top()))
                        BOOST_THROW_EXCEPTION(ConfigError("'ignore' keyword not valid in this context."));
 
-               m_Ignore.top() = make_shared<Expression>(&Expression::OpLogicalOr, m_Ignore.top(), *$3, DebugInfoRange(@1, @3));
+               m_Ignore.top() = new Expression(&Expression::OpLogicalOr, m_Ignore.top(), *$3, DebugInfoRange(@1, @3));
                delete $3;
 
                $$ = new Value(MakeLiteral());
@@ -636,7 +636,7 @@ lterm: indexer combined_set_op rterm
        | T_RETURN rterm
        {
                Expression::Ptr aname = MakeLiteral("__result");
-               $$ = new Value(make_shared<Expression>(&Expression::OpSet, MakeArray(MakeArray(MakeLiteral(aname)), OpSetLiteral), *$2, DebugInfoRange(@1, @2)));
+               $$ = new Value(new Expression(&Expression::OpSet, MakeArray(MakeArray(MakeLiteral(aname)), OpSetLiteral), *$2, DebugInfoRange(@1, @2)));
                delete $2;
 
        }
@@ -684,37 +684,37 @@ rterm_items_inner: rterm
 
 rterm_array: '[' newlines rterm_items newlines ']'
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpArray, Array::Ptr($3), DebugInfoRange(@1, @5)));
+               $$ = new Value(new Expression(&Expression::OpArray, Array::Ptr($3), DebugInfoRange(@1, @5)));
        }
        | '[' newlines rterm_items ']'
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpArray, Array::Ptr($3), DebugInfoRange(@1, @4)));
+               $$ = new Value(new Expression(&Expression::OpArray, Array::Ptr($3), DebugInfoRange(@1, @4)));
        }
        | '[' rterm_items newlines ']'
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpArray, Array::Ptr($2), DebugInfoRange(@1, @4)));
+               $$ = new Value(new Expression(&Expression::OpArray, Array::Ptr($2), DebugInfoRange(@1, @4)));
        }
        | '[' rterm_items ']'
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpArray, Array::Ptr($2), DebugInfoRange(@1, @3)));
+               $$ = new Value(new Expression(&Expression::OpArray, Array::Ptr($2), DebugInfoRange(@1, @3)));
        }
        ;
 
 rterm_scope: '{' newlines lterm_items newlines '}'
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpDict, Array::Ptr($3), DebugInfoRange(@1, @5)));
+               $$ = new Value(new Expression(&Expression::OpDict, Array::Ptr($3), DebugInfoRange(@1, @5)));
        }
        | '{' newlines lterm_items '}'
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpDict, Array::Ptr($3), DebugInfoRange(@1, @4)));
+               $$ = new Value(new Expression(&Expression::OpDict, Array::Ptr($3), DebugInfoRange(@1, @4)));
        }
        | '{' lterm_items newlines '}'
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpDict, Array::Ptr($2), DebugInfoRange(@1, @4)));
+               $$ = new Value(new Expression(&Expression::OpDict, Array::Ptr($2), DebugInfoRange(@1, @4)));
        }
        | '{' lterm_items '}'
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpDict, Array::Ptr($2), DebugInfoRange(@1, @3)));
+               $$ = new Value(new Expression(&Expression::OpDict, Array::Ptr($2), DebugInfoRange(@1, @3)));
        }
        ;
 
@@ -733,33 +733,33 @@ rterm: T_STRING
        }
        | rterm '.' T_IDENTIFIER
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpIndexer, *$1, MakeLiteral($3), DebugInfoRange(@1, @3)));
+               $$ = new Value(new Expression(&Expression::OpIndexer, *$1, MakeLiteral($3), DebugInfoRange(@1, @3)));
                delete $1;
                free($3);
        }
        | rterm '(' rterm_items ')'
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpFunctionCall, *$1, MakeLiteral(Array::Ptr($3)), DebugInfoRange(@1, @4)));
+               $$ = new Value(new Expression(&Expression::OpFunctionCall, *$1, MakeLiteral(Array::Ptr($3)), DebugInfoRange(@1, @4)));
                delete $1;
        }
        | T_IDENTIFIER
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpVariable, $1, @1));
+               $$ = new Value(new Expression(&Expression::OpVariable, $1, @1));
                free($1);
        }
        | '!' rterm
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpLogicalNegate, *$2, DebugInfoRange(@1, @2)));
+               $$ = new Value(new Expression(&Expression::OpLogicalNegate, *$2, DebugInfoRange(@1, @2)));
                delete $2;
        }
        | '~' rterm
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpNegate, *$2, DebugInfoRange(@1, @2)));
+               $$ = new Value(new Expression(&Expression::OpNegate, *$2, DebugInfoRange(@1, @2)));
                delete $2;
        }
        | rterm '[' rterm ']'
        {
-               $$ = new Value(make_shared<Expression>(&Expression::OpIndexer, *$1, *$3, DebugInfoRange(@1, @4)));
+               $$ = new Value(new Expression(&Expression::OpIndexer, *$1, *$3, DebugInfoRange(@1, @4)));
                delete $1;
                delete $3;
        }
@@ -804,7 +804,7 @@ rterm: T_STRING
                delete $6;
                aexpr->MakeInline();
 
-               $$ = new Value(make_shared<Expression>(&Expression::OpFunction, MakeArray($2, aexpr), Array::Ptr($4), DebugInfoRange(@1, @6)));
+               $$ = new Value(new Expression(&Expression::OpFunction, MakeArray($2, aexpr), Array::Ptr($4), DebugInfoRange(@1, @6)));
                free($2);
        }
        | T_FUNCTION '(' identifier_items ')' rterm_scope
@@ -813,7 +813,7 @@ rterm: T_STRING
                delete $5;
                aexpr->MakeInline();
 
-               $$ = new Value(make_shared<Expression>(&Expression::OpFunction, MakeArray(Empty, aexpr), Array::Ptr($3), DebugInfoRange(@1, @5)));
+               $$ = new Value(new Expression(&Expression::OpFunction, MakeArray(Empty, aexpr), Array::Ptr($3), DebugInfoRange(@1, @5)));
        }
        | T_FOR '(' identifier T_FOLLOWS identifier T_IN rterm ')' rterm_scope
        {
@@ -823,7 +823,7 @@ rterm: T_STRING
                Expression::Ptr ascope = *$9;
                delete $9;
 
-               $$ = new Value(make_shared<Expression>(&Expression::OpFor, MakeArray($3, $5, aexpr), ascope, DebugInfoRange(@1, @9)));
+               $$ = new Value(new Expression(&Expression::OpFor, MakeArray($3, $5, aexpr), ascope, DebugInfoRange(@1, @9)));
                free($3);
                free($5);
        }
@@ -835,7 +835,7 @@ rterm: T_STRING
                Expression::Ptr ascope = *$7;
                delete $7;
 
-               $$ = new Value(make_shared<Expression>(&Expression::OpFor, MakeArray($3, Empty, aexpr), ascope, DebugInfoRange(@1, @7)));
+               $$ = new Value(new Expression(&Expression::OpFor, MakeArray($3, Empty, aexpr), ascope, DebugInfoRange(@1, @7)));
                free($3);
        }
        ;
@@ -940,10 +940,10 @@ apply:
 
                m_SeenAssign.pop();
 
-               Expression::Ptr rex = make_shared<Expression>(&Expression::OpLogicalNegate, m_Ignore.top(), DebugInfoRange(@2, @5));
+               Expression::Ptr rex = new Expression(&Expression::OpLogicalNegate, m_Ignore.top(), DebugInfoRange(@2, @5));
                m_Ignore.pop();
 
-               Expression::Ptr filter = make_shared<Expression>(&Expression::OpLogicalAnd, m_Assign.top(), rex, DebugInfoRange(@2, @5));
+               Expression::Ptr filter = new Expression(&Expression::OpLogicalAnd, m_Assign.top(), rex, DebugInfoRange(@2, @5));
                m_Assign.pop();
 
                String fkvar = m_FKVar.top();
@@ -955,7 +955,7 @@ apply:
                Expression::Ptr fterm = m_FTerm.top();
                m_FTerm.pop();
 
-               Array::Ptr args = make_shared<Array>();
+               Array::Ptr args = new Array();
                args->Add(type);
                args->Add(target);
                args->Add(aname);
@@ -964,7 +964,7 @@ apply:
                args->Add(fvvar);
                args->Add(fterm);
 
-               $$ = new Value(make_shared<Expression>(&Expression::OpApply, args, exprl, DebugInfoRange(@2, @5)));
+               $$ = new Value(new Expression(&Expression::OpApply, args, exprl, DebugInfoRange(@2, @5)));
        }
        ;
 
index e5b95ce2573ead79a20d0757267bce53e9a03a77..d688f87e119b0b91830a0a9299050eee9701786b 100644 (file)
@@ -76,7 +76,7 @@ void ConfigCompilerContext::OpenObjectsFile(const String& filename)
        if (!*fp)
                BOOST_THROW_EXCEPTION(std::runtime_error("Could not open '" + tempFilename + "' file"));
 
-       m_ObjectsFP = make_shared<StdioStream>(fp, true);
+       m_ObjectsFP = new StdioStream(fp, true);
 }
 
 void ConfigCompilerContext::WriteObject(const Dictionary::Ptr& object)
index cf287933d362774f98eab222fc9702e076537e7a..65c1da06392c539f99311d31b0533a7ea27d2421 100644 (file)
@@ -150,7 +150,7 @@ DynamicObject::Ptr ConfigItem::Commit(bool discard)
        dobj->SetTypeName(m_Type);
        dobj->SetZone(m_Zone);
 
-       Dictionary::Ptr locals = make_shared<Dictionary>();
+       Dictionary::Ptr locals = new Dictionary();
        locals->Set("__parent", m_Scope);
        m_Scope.reset();
        locals->Set("name", m_Name);
@@ -175,7 +175,7 @@ DynamicObject::Ptr ConfigItem::Commit(bool discard)
 
        String name = m_Name;
 
-       shared_ptr<NameComposer> nc = dynamic_pointer_cast<NameComposer>(type);
+       NameComposer *nc = dynamic_cast<NameComposer *>(type.get());
 
        if (nc) {
                name = nc->MakeName(m_Name, dobj);
@@ -191,7 +191,7 @@ DynamicObject::Ptr ConfigItem::Commit(bool discard)
 
        Dictionary::Ptr attrs = Serialize(dobj, FAConfig);
 
-       Dictionary::Ptr persistentItem = make_shared<Dictionary>();
+       Dictionary::Ptr persistentItem = new Dictionary();
 
        persistentItem->Set("type", GetType());
        persistentItem->Set("name", GetName());
@@ -230,18 +230,18 @@ DynamicObject::Ptr ConfigItem::Commit(bool discard)
  */
 void ConfigItem::Register(void)
 {
-       ConfigItem::Ptr self = GetSelf();
+       Type::Ptr type = Type::GetByName(m_Type);
 
        /* If this is a non-abstract object with a composite name
         * we register it in m_UnnamedItems instead of m_Items. */
-       if (!m_Abstract && dynamic_pointer_cast<NameComposer>(Type::GetByName(m_Type))) {
+       if (!m_Abstract && dynamic_cast<NameComposer *>(type.get())) {
                boost::mutex::scoped_lock lock(m_Mutex);
-               m_UnnamedItems.push_back(self);
+               m_UnnamedItems.push_back(this);
        } else {
                std::pair<String, String> key = std::make_pair(m_Type, m_Name);
 
                boost::mutex::scoped_lock lock(m_Mutex);
-               m_Items[key] = self;
+               m_Items[key] = this;
        }
 }
 
index c843c9cb6893e00a4aceeef551da97774f059aa0..7820aedf26cf9456a4914022004eb3c753e26203 100644 (file)
@@ -25,7 +25,7 @@
 using namespace icinga;
 
 ConfigItemBuilder::ConfigItemBuilder(void)
-       : m_Abstract(false), m_Expressions(make_shared<Array>())
+       : m_Abstract(false), m_Expressions(new Array())
 {
        m_DebugInfo.FirstLine = 0;
        m_DebugInfo.FirstColumn = 0;
@@ -34,7 +34,7 @@ ConfigItemBuilder::ConfigItemBuilder(void)
 }
 
 ConfigItemBuilder::ConfigItemBuilder(const DebugInfo& debugInfo)
-       : m_Abstract(false), m_Expressions(make_shared<Array>())
+       : m_Abstract(false), m_Expressions(new Array())
 {
        m_DebugInfo = debugInfo;
 }
@@ -89,19 +89,19 @@ ConfigItem::Ptr ConfigItemBuilder::Compile(void)
                BOOST_THROW_EXCEPTION(std::invalid_argument(msgbuf.str()));
        }
 
-       Array::Ptr exprs = make_shared<Array>();
-       Array::Ptr templateArray = make_shared<Array>();
+       Array::Ptr exprs = new Array();
+       Array::Ptr templateArray = new Array();
        templateArray->Add(m_Name);
 
-       exprs->Add(make_shared<Expression>(&Expression::OpSet,
+       exprs->Add(new Expression(&Expression::OpSet,
            MakeArray(MakeArray(MakeLiteral("templates")), OpSetAdd),
-           make_shared<Expression>(&Expression::OpLiteral, templateArray, m_DebugInfo),
+           new Expression(&Expression::OpLiteral, templateArray, m_DebugInfo),
            m_DebugInfo));
 
-       exprs->Add(make_shared<Expression>(&Expression::OpDict, m_Expressions, true, m_DebugInfo));
+       exprs->Add(new Expression(&Expression::OpDict, m_Expressions, true, m_DebugInfo));
        
-       Expression::Ptr exprl = make_shared<Expression>(&Expression::OpDict, exprs, true, m_DebugInfo);
+       Expression::Ptr exprl = new Expression(&Expression::OpDict, exprs, true, m_DebugInfo);
 
-       return make_shared<ConfigItem>(m_Type, m_Name, m_Abstract, exprl,
+       return new ConfigItem(m_Type, m_Name, m_Abstract, exprl,
            m_DebugInfo, m_Scope, m_Zone);
 }
index fb28c654e4e6f12d4d410d59845024db7a9eb6be..235331245c7d667176264d9fea25672cf1a3a57b 100644 (file)
@@ -28,7 +28,7 @@
 using namespace icinga;
 
 ConfigType::ConfigType(const String& name, const DebugInfo& debuginfo)
-       : m_Name(name), m_RuleList(make_shared<TypeRuleList>()), m_DebugInfo(debuginfo)
+       : m_Name(name), m_RuleList(new TypeRuleList()), m_DebugInfo(debuginfo)
 { }
 
 String ConfigType::GetName(void) const
@@ -85,7 +85,7 @@ void ConfigType::ValidateItem(const String& name, const Dictionary::Ptr& attrs,
        locations.push_back(location);
 
        std::vector<TypeRuleList::Ptr> ruleLists;
-       AddParentRules(ruleLists, GetSelf());
+       AddParentRules(ruleLists, this);
        ruleLists.push_back(m_RuleList);
 
        ValidateDictionary(attrs, ruleLists, locations, utils);
@@ -278,7 +278,7 @@ void ConfigType::ValidateArray(const Array::Ptr& array,
 
 void ConfigType::Register(void)
 {
-       ConfigTypeRegistry::GetInstance()->Register(GetName(), GetSelf());
+       ConfigTypeRegistry::GetInstance()->Register(GetName(), this);
 }
 
 ConfigType::Ptr ConfigType::GetByName(const String& name)
index dab19f251d5362497826dc781b3f85cfb366b9a8..6143354ed5f7a2cb8b060ec152d85aa0383a4067 100644 (file)
@@ -275,7 +275,7 @@ Value Expression::OpFunctionCall(const Expression *expr, const Object::Ptr& cont
 Value Expression::OpArray(const Expression *expr, const Object::Ptr& context, DebugHint *dhint)
 {
        Array::Ptr arr = expr->m_Operand1;
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
 
        if (arr) {
                for (Array::SizeType index = 0; index < arr->GetLength(); index++) {
@@ -291,7 +291,7 @@ Value Expression::OpDict(const Expression *expr, const Object::Ptr& context, Deb
 {
        Array::Ptr arr = expr->m_Operand1;
        bool in_place = expr->m_Operand2;
-       Dictionary::Ptr result = make_shared<Dictionary>();
+       Dictionary::Ptr result = new Dictionary();
 
        result->Set("__parent", context);
 
@@ -335,10 +335,10 @@ Value Expression::OpSet(const Expression *expr, const Object::Ptr& context, Debu
                } else {
                        parent = object;
 
-                       Expression::Ptr eparent = make_shared<Expression>(&Expression::OpLiteral, parent, expr->m_DebugInfo);
-                       Expression::Ptr eindex = make_shared<Expression>(&Expression::OpLiteral, tempindex, expr->m_DebugInfo);
+                       Expression::Ptr eparent = new Expression(&Expression::OpLiteral, parent, expr->m_DebugInfo);
+                       Expression::Ptr eindex = new Expression(&Expression::OpLiteral, tempindex, expr->m_DebugInfo);
 
-                       Expression::Ptr eip = make_shared<Expression>(&Expression::OpIndexer, eparent, eindex, expr->m_DebugInfo);
+                       Expression::Ptr eip = new Expression(&Expression::OpIndexer, eparent, eindex, expr->m_DebugInfo);
                        object = eip->Evaluate(context, dhint);
                }
 
@@ -346,7 +346,7 @@ Value Expression::OpSet(const Expression *expr, const Object::Ptr& context, Debu
                        sdhint = sdhint->GetChild(index);
 
                if (i != indexer->GetLength() - 1 && object.IsEmpty()) {
-                       object = make_shared<Dictionary>();
+                       object = new Dictionary();
 
                        SetField(parent, tempindex, object);
                }
@@ -374,9 +374,9 @@ Value Expression::OpSet(const Expression *expr, const Object::Ptr& context, Debu
                                VERIFY(!"Invalid opcode.");
                }
 
-               Expression::Ptr ecp = make_shared<Expression>(op,
-                   make_shared<Expression>(&Expression::OpLiteral, object, expr->m_DebugInfo),
-                   make_shared<Expression>(&Expression::OpLiteral, right, expr->m_DebugInfo),
+               Expression::Ptr ecp = new Expression(op,
+                   new Expression(&Expression::OpLiteral, object, expr->m_DebugInfo),
+                   new Expression(&Expression::OpLiteral, right, expr->m_DebugInfo),
                    expr->m_DebugInfo);
 
                right = ecp->Evaluate(context, dhint);
@@ -441,7 +441,7 @@ Value Expression::FunctionWrapper(const std::vector<Value>& arguments, const Arr
        if (arguments.size() < funcargs->GetLength())
                BOOST_THROW_EXCEPTION(ConfigError("Too few arguments for function"));
 
-       Dictionary::Ptr context = make_shared<Dictionary>();
+       Dictionary::Ptr context = new Dictionary();
        context->Set("__parent", scope);
 
        for (std::vector<Value>::size_type i = 0; i < std::min(arguments.size(), funcargs->GetLength()); i++)
@@ -458,7 +458,7 @@ Value Expression::OpFunction(const Expression* expr, const Object::Ptr& context,
        String name = left->Get(0);
 
        Array::Ptr funcargs = expr->m_Operand2;
-       ScriptFunction::Ptr func = make_shared<ScriptFunction>(boost::bind(&Expression::FunctionWrapper, _1, funcargs, aexpr, context));
+       ScriptFunction::Ptr func = new ScriptFunction(boost::bind(&Expression::FunctionWrapper, _1, funcargs, aexpr, context));
 
        if (!name.IsEmpty())
                ScriptFunction::Register(name, func);
@@ -497,12 +497,14 @@ Value Expression::OpObject(const Expression* expr, const Object::Ptr& context, D
 
        String name = aname->Evaluate(context, dhint);
 
-       ConfigItemBuilder::Ptr item = make_shared<ConfigItemBuilder>(expr->m_DebugInfo);
+       ConfigItemBuilder::Ptr item = new ConfigItemBuilder(expr->m_DebugInfo);
 
        String checkName = name;
 
        if (!abstract) {
-               shared_ptr<NameComposer> nc = dynamic_pointer_cast<NameComposer>(Type::GetByName(type));
+               Type::Ptr ptype = Type::GetByName(type);
+
+               NameComposer *nc = dynamic_cast<NameComposer *>(ptype.get());
 
                if (nc)
                        checkName = nc->MakeName(name, Dictionary::Ptr());
@@ -557,7 +559,7 @@ Value Expression::OpFor(const Expression* expr, const Object::Ptr& context, Debu
 
                ObjectLock olock(arr);
                BOOST_FOREACH(const Value& value, arr) {
-                       Dictionary::Ptr xcontext = make_shared<Dictionary>();
+                       Dictionary::Ptr xcontext = new Dictionary();
                        xcontext->Set("__parent", context);
                        xcontext->Set(kvar, value);
 
@@ -571,7 +573,7 @@ Value Expression::OpFor(const Expression* expr, const Object::Ptr& context, Debu
 
                ObjectLock olock(dict);
                BOOST_FOREACH(const Dictionary::Pair& kv, dict) {
-                       Dictionary::Ptr xcontext = make_shared<Dictionary>();
+                       Dictionary::Ptr xcontext = new Dictionary();
                        xcontext->Set("__parent", context);
                        xcontext->Set(kvar, kv.first);
                        xcontext->Set(vvar, kv.second);
@@ -586,12 +588,12 @@ Value Expression::OpFor(const Expression* expr, const Object::Ptr& context, Debu
 
 Dictionary::Ptr DebugHint::ToDictionary(void) const
 {
-       Dictionary::Ptr result = make_shared<Dictionary>();
+       Dictionary::Ptr result = new Dictionary();
 
-       Array::Ptr messages = make_shared<Array>();
+       Array::Ptr messages = new Array();
        typedef std::pair<String, DebugInfo> MessageType;
        BOOST_FOREACH(const MessageType& message, Messages) {
-               Array::Ptr amsg = make_shared<Array>();
+               Array::Ptr amsg = new Array();
                amsg->Add(message.first);
                amsg->Add(message.second.Path);
                amsg->Add(message.second.FirstLine);
@@ -603,7 +605,7 @@ Dictionary::Ptr DebugHint::ToDictionary(void) const
 
        result->Set("messages", messages);
 
-       Dictionary::Ptr properties = make_shared<Dictionary>();
+       Dictionary::Ptr properties = new Dictionary();
 
        typedef std::map<String, DebugHint>::value_type ChildType;
        BOOST_FOREACH(const ChildType& kv, Children) {
@@ -617,7 +619,7 @@ Dictionary::Ptr DebugHint::ToDictionary(void) const
 
 Expression::Ptr icinga::MakeLiteral(const Value& lit)
 {
-       return make_shared<Expression>(&Expression::OpLiteral, lit, DebugInfo());
+       return new Expression(&Expression::OpLiteral, lit, DebugInfo());
 }
 
 bool Expression::HasField(const Object::Ptr& context, const String& field)
index eb4ba237f8b9b03883da3d29d1ab8a5f3a8c60f0..97a6f3310f23bca466206be4607858f1360521a8 100644 (file)
@@ -38,7 +38,7 @@ CommandDbObject::CommandDbObject(const DbType::Ptr& type, const String& name1, c
 
 Dictionary::Ptr CommandDbObject::GetConfigFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        Command::Ptr command = static_pointer_cast<Command>(GetObject());
 
        fields->Set("command_line", CompatUtility::GetCommandLine(command));
index c414b6cd73e12af203664a4b7550bb27d11832fc..34be08ca7f33ae1560eadb77761dc9bb0e86d44b 100644 (file)
@@ -36,7 +36,7 @@ class CommandDbObject : public DbObject
 public:
        DECLARE_PTR_TYPEDEFS(CommandDbObject);
 
-       CommandDbObject(const shared_ptr<DbType>& type, const String& name1, const String& name2);
+       CommandDbObject(const DbType::Ptr& type, const String& name1, const String& name2);
 
        virtual Dictionary::Ptr GetConfigFields(void) const;
        virtual Dictionary::Ptr GetStatusFields(void) const;
index 60af3a7bffa2bcb7a969cfc8fff0545e763a78fc..e8c2e1435abc64bb424410028c29f081e1a8bbaf 100644 (file)
@@ -67,7 +67,7 @@ void DbConnection::Resume(void)
        Log(LogInformation, "DbConnection")
            << "Resuming IDO connection: " << GetName();
 
-       m_CleanUpTimer = make_shared<Timer>();
+       m_CleanUpTimer = new Timer();
        m_CleanUpTimer->SetInterval(60);
        m_CleanUpTimer->OnTimerExpired.connect(boost::bind(&DbConnection::CleanUpHandler, this));
        m_CleanUpTimer->Start();
@@ -85,7 +85,7 @@ void DbConnection::Pause(void)
 
 void DbConnection::StaticInitialize(void)
 {
-       m_ProgramStatusTimer = make_shared<Timer>();
+       m_ProgramStatusTimer = new Timer();
        m_ProgramStatusTimer->SetInterval(10);
        m_ProgramStatusTimer->OnTimerExpired.connect(boost::bind(&DbConnection::ProgramStatusHandler));
        m_ProgramStatusTimer->Start();
@@ -97,7 +97,7 @@ void DbConnection::InsertRuntimeVariable(const String& key, const Value& value)
        query.Table = "runtimevariables";
        query.Type = DbQueryInsert;
        query.Category = DbCatProgramStatus;
-       query.Fields = make_shared<Dictionary>();
+       query.Fields = new Dictionary();
        query.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
        query.Fields->Set("varname", key);
        query.Fields->Set("varvalue", value);
@@ -110,7 +110,7 @@ void DbConnection::ProgramStatusHandler(void)
        query1.Table = "programstatus";
        query1.Type = DbQueryDelete;
        query1.Category = DbCatProgramStatus;
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        query1.WhereCriteria->Set("instance_id", 0);  /* DbConnection class fills in real ID */
        DbObject::OnQuery(query1);
 
@@ -120,7 +120,7 @@ void DbConnection::ProgramStatusHandler(void)
        query2.Type = DbQueryInsert;
        query2.Category = DbCatProgramStatus;
 
-       query2.Fields = make_shared<Dictionary>();
+       query2.Fields = new Dictionary();
        query2.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
        query2.Fields->Set("program_version", Application::GetVersion());
        query2.Fields->Set("status_update_time", DbValue::FromTimestamp(Utility::GetTime()));
@@ -144,7 +144,7 @@ void DbConnection::ProgramStatusHandler(void)
        query3.Table = "runtimevariables";
        query3.Type = DbQueryDelete;
        query3.Category = DbCatProgramStatus;
-       query3.WhereCriteria = make_shared<Dictionary>();
+       query3.WhereCriteria = new Dictionary();
        query3.WhereCriteria->Set("instance_id", 0);  /* DbConnection class fills in real ID */
        DbObject::OnQuery(query3);
 
@@ -167,7 +167,7 @@ void DbConnection::ProgramStatusHandler(void)
                        Log(LogDebug, "DbConnection")
                            << "icinga application customvar key: '" << kv.first << "' value: '" << kv.second << "'";
 
-                       Dictionary::Ptr fields4 = make_shared<Dictionary>();
+                       Dictionary::Ptr fields4 = new Dictionary();
                        fields4->Set("varname", Convert::ToString(kv.first));
                        fields4->Set("varvalue", Convert::ToString(kv.second));
                        fields4->Set("config_type", 1);
index 135f3dc5aa3cf72c2ac4a6eccc3f611548d27b63..b47069c9030add7bb713151de5b049d3f72fb0bd 100644 (file)
@@ -30,7 +30,7 @@ abstract class DbConnection : DynamicObject
        };
 
        [config] Dictionary::Ptr cleanup {
-               default {{{ return make_shared<Dictionary>(); }}}
+               default {{{ return new Dictionary(); }}}
        };
 
        [config] int categories {
index 40bf896d23365b9c971b89aa846268c69aa591ad..08cf55cc68fc2411cbb313520819674195b6944c 100644 (file)
@@ -99,12 +99,12 @@ void DbEvents::NextCheckChangedHandler(const Checkable::Ptr& checkable, double n
 
        query1.Type = DbQueryUpdate;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("next_check", DbValue::FromTimestamp(nextCheck));
 
        query1.Fields = fields1;
 
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        if (service)
                query1.WhereCriteria->Set("service_object_id", service);
        else
@@ -129,13 +129,13 @@ void DbEvents::FlappingChangedHandler(const Checkable::Ptr& checkable, FlappingS
 
        query1.Type = DbQueryUpdate;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("is_flapping", CompatUtility::GetCheckableIsFlapping(checkable));
        fields1->Set("percent_state_change", CompatUtility::GetCheckablePercentStateChange(checkable));
 
        query1.Fields = fields1;
 
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        if (service)
                query1.WhereCriteria->Set("service_object_id", service);
        else
@@ -164,14 +164,14 @@ void DbEvents::LastNotificationChangedHandler(const Notification::Ptr& notificat
 
        query1.Type = DbQueryUpdate;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("last_notification", DbValue::FromTimestamp(now_bag.first));
        fields1->Set("next_notification", DbValue::FromTimestamp(time_bag.first));
        fields1->Set("current_notification_number", notification->GetNotificationNumber());
 
        query1.Fields = fields1;
 
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        if (service)
                query1.WhereCriteria->Set("service_object_id", service);
        else
@@ -222,7 +222,7 @@ void DbEvents::EnableChangedHandlerInternal(const Checkable::Ptr& checkable, boo
 
        query1.Type = DbQueryUpdate;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
 
        if (type == EnableActiveChecks) {
                fields1->Set("active_checks_enabled", enabled ? 1 : 0);
@@ -238,7 +238,7 @@ void DbEvents::EnableChangedHandlerInternal(const Checkable::Ptr& checkable, boo
 
        query1.Fields = fields1;
 
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        if (service)
                query1.WhereCriteria->Set("service_object_id", service);
        else
@@ -294,7 +294,7 @@ void DbEvents::AddCommentByType(const DynamicObject::Ptr& object, const Comment:
        unsigned long entry_time = static_cast<long>(comment->GetEntryTime());
        unsigned long entry_time_usec = (comment->GetEntryTime() - entry_time) * 1000 * 1000;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("entry_time", DbValue::FromTimestamp(entry_time));
        fields1->Set("entry_time_usec", entry_time_usec);
        fields1->Set("entry_type", comment->GetEntryType());
@@ -348,7 +348,7 @@ void DbEvents::RemoveComments(const Checkable::Ptr& checkable)
        query1.Table = "comments";
        query1.Type = DbQueryDelete;
        query1.Category = DbCatComment;
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        query1.WhereCriteria->Set("object_id", checkable);
        DbObject::OnQuery(query1);
 }
@@ -368,7 +368,7 @@ void DbEvents::RemoveComment(const Checkable::Ptr& checkable, const Comment::Ptr
        query1.Table = "comments";
        query1.Type = DbQueryDelete;
        query1.Category = DbCatComment;
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        query1.WhereCriteria->Set("object_id", checkable);
        query1.WhereCriteria->Set("internal_comment_id", comment->GetLegacyId());
        DbObject::OnQuery(query1);
@@ -384,12 +384,12 @@ void DbEvents::RemoveComment(const Checkable::Ptr& checkable, const Comment::Ptr
        query2.Type = DbQueryUpdate;
        query2.Category = DbCatComment;
 
-       Dictionary::Ptr fields2 = make_shared<Dictionary>();
+       Dictionary::Ptr fields2 = new Dictionary();
        fields2->Set("deletion_time", DbValue::FromTimestamp(time_bag.first));
        fields2->Set("deletion_time_usec", time_bag.second);
        query2.Fields = fields2;
 
-       query2.WhereCriteria = make_shared<Dictionary>();
+       query2.WhereCriteria = new Dictionary();
        query2.WhereCriteria->Set("internal_comment_id", comment->GetLegacyId());
        query2.WhereCriteria->Set("comment_time", DbValue::FromTimestamp(entry_time));
        query2.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
@@ -438,7 +438,7 @@ void DbEvents::AddDowntimeInternal(const Checkable::Ptr& checkable, const Downti
 
 void DbEvents::AddDowntimeByType(const Checkable::Ptr& checkable, const Downtime::Ptr& downtime, bool historical)
 {
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("entry_time", DbValue::FromTimestamp(downtime->GetEntryTime()));
        fields1->Set("object_id", checkable);
 
@@ -496,7 +496,7 @@ void DbEvents::RemoveDowntimes(const Checkable::Ptr& checkable)
        query1.Table = "scheduleddowntime";
        query1.Type = DbQueryDelete;
        query1.Category = DbCatDowntime;
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        query1.WhereCriteria->Set("object_id", checkable);
        DbObject::OnQuery(query1);
 }
@@ -516,7 +516,7 @@ void DbEvents::RemoveDowntime(const Checkable::Ptr& checkable, const Downtime::P
        query1.Table = "scheduleddowntime";
        query1.Type = DbQueryDelete;
        query1.Category = DbCatDowntime;
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        query1.WhereCriteria->Set("object_id", checkable);
        query1.WhereCriteria->Set("internal_downtime_id", downtime->GetLegacyId());
        DbObject::OnQuery(query1);
@@ -530,13 +530,13 @@ void DbEvents::RemoveDowntime(const Checkable::Ptr& checkable, const Downtime::P
        query3.Type = DbQueryUpdate;
        query3.Category = DbCatDowntime;
 
-       Dictionary::Ptr fields3 = make_shared<Dictionary>();
+       Dictionary::Ptr fields3 = new Dictionary();
        fields3->Set("was_cancelled", downtime->GetWasCancelled() ? 1 : 0);
        fields3->Set("actual_end_time", DbValue::FromTimestamp(time_bag.first));
        fields3->Set("actual_end_time_usec", time_bag.second);
        query3.Fields = fields3;
 
-       query3.WhereCriteria = make_shared<Dictionary>();
+       query3.WhereCriteria = new Dictionary();
        query3.WhereCriteria->Set("internal_downtime_id", downtime->GetLegacyId());
        query3.WhereCriteria->Set("entry_time", DbValue::FromTimestamp(downtime->GetEntryTime()));
        query3.WhereCriteria->Set("scheduled_start_time", DbValue::FromTimestamp(downtime->GetStartTime()));
@@ -565,7 +565,7 @@ void DbEvents::TriggerDowntime(const Checkable::Ptr& checkable, const Downtime::
        query1.Type = DbQueryUpdate;
        query1.Category = DbCatDowntime;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("was_started", 1);
        fields1->Set("actual_start_time", DbValue::FromTimestamp(time_bag.first));
        fields1->Set("actual_start_time_usec", time_bag.second);
@@ -573,7 +573,7 @@ void DbEvents::TriggerDowntime(const Checkable::Ptr& checkable, const Downtime::
        fields1->Set("trigger_time", DbValue::FromTimestamp(downtime->GetTriggerTime()));
        fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
 
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        query1.WhereCriteria->Set("object_id", checkable);
        query1.WhereCriteria->Set("internal_downtime_id", downtime->GetLegacyId());
 
@@ -586,7 +586,7 @@ void DbEvents::TriggerDowntime(const Checkable::Ptr& checkable, const Downtime::
        query3.Type = DbQueryUpdate;
        query3.Category = DbCatDowntime;
 
-       Dictionary::Ptr fields3 = make_shared<Dictionary>();
+       Dictionary::Ptr fields3 = new Dictionary();
        fields3->Set("was_started", 1);
        fields3->Set("is_in_effect", 1);
        fields3->Set("actual_start_time", DbValue::FromTimestamp(time_bag.first));
@@ -594,7 +594,7 @@ void DbEvents::TriggerDowntime(const Checkable::Ptr& checkable, const Downtime::
        fields3->Set("trigger_time", DbValue::FromTimestamp(downtime->GetTriggerTime()));
        query3.Fields = fields3;
 
-       query3.WhereCriteria = make_shared<Dictionary>();
+       query3.WhereCriteria = new Dictionary();
        query3.WhereCriteria->Set("internal_downtime_id", downtime->GetLegacyId());
        query3.WhereCriteria->Set("entry_time", DbValue::FromTimestamp(downtime->GetEntryTime()));
        query3.WhereCriteria->Set("scheduled_start_time", DbValue::FromTimestamp(downtime->GetStartTime()));
@@ -616,12 +616,12 @@ void DbEvents::TriggerDowntime(const Checkable::Ptr& checkable, const Downtime::
 
        query4.Type = DbQueryUpdate;
 
-       Dictionary::Ptr fields4 = make_shared<Dictionary>();
+       Dictionary::Ptr fields4 = new Dictionary();
        fields4->Set("scheduled_downtime_depth", checkable->GetDowntimeDepth());
 
        query4.Fields = fields4;
 
-       query4.WhereCriteria = make_shared<Dictionary>();
+       query4.WhereCriteria = new Dictionary();
        if (service)
                query4.WhereCriteria->Set("service_object_id", service);
        else
@@ -653,7 +653,7 @@ void DbEvents::AddAcknowledgementHistory(const Checkable::Ptr& checkable, const
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("entry_time", DbValue::FromTimestamp(time_bag.first));
        fields1->Set("entry_time_usec", time_bag.second);
        fields1->Set("acknowledgement_type", type);
@@ -706,12 +706,12 @@ void DbEvents::AddAcknowledgementInternal(const Checkable::Ptr& checkable, Ackno
        query1.Type = DbQueryUpdate;
        query1.Category = DbCatAcknowledgement;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("acknowledgement_type", type);
        fields1->Set("problem_has_been_acknowledged", add ? 1 : 0);
        query1.Fields = fields1;
 
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        if (service)
                query1.WhereCriteria->Set("service_object_id", service);
        else
@@ -744,7 +744,7 @@ void DbEvents::AddNotificationHistory(const Notification::Ptr& notification, con
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("notification_type", 1); /* service */
        fields1->Set("notification_reason", CompatUtility::MapNotificationReasonType(type));
        fields1->Set("object_id", checkable);
@@ -782,7 +782,7 @@ void DbEvents::AddNotificationHistory(const Notification::Ptr& notification, con
                Log(LogDebug, "DbEvents")
                    << "add contact notification history for service '" << checkable->GetName() << "' and user '" << user->GetName() << "'.";
 
-               Dictionary::Ptr fields2 = make_shared<Dictionary>();
+               Dictionary::Ptr fields2 = new Dictionary();
                fields2->Set("contact_object_id", user);
                fields2->Set("start_time", DbValue::FromTimestamp(time_bag.first));
                fields2->Set("start_time_usec", time_bag.second);
@@ -815,7 +815,7 @@ void DbEvents::AddStateChangeHistory(const Checkable::Ptr& checkable, const Chec
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("state_time", DbValue::FromTimestamp(time_bag.first));
        fields1->Set("state_time_usec", time_bag.second);
        fields1->Set("object_id", checkable);
@@ -1133,7 +1133,7 @@ void DbEvents::AddLogHistory(const Checkable::Ptr& checkable, String buffer, Log
        query1.Type = DbQueryInsert;
        query1.Category = DbCatLog;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("logentry_time", DbValue::FromTimestamp(time_bag.first));
        fields1->Set("entry_time", DbValue::FromTimestamp(time_bag.first));
        fields1->Set("entry_time_usec", time_bag.second);
@@ -1167,7 +1167,7 @@ void DbEvents::AddFlappingHistory(const Checkable::Ptr& checkable, FlappingState
        query1.Type = DbQueryInsert;
        query1.Category = DbCatFlapping;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
 
        fields1->Set("event_time", DbValue::FromTimestamp(time_bag.first));
        fields1->Set("event_time_usec", time_bag.second);
@@ -1232,7 +1232,7 @@ void DbEvents::AddServiceCheckHistory(const Checkable::Ptr& checkable, const Che
        query1.Type = DbQueryInsert;
        query1.Category = DbCatCheck;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        double execution_time = Service::CalculateExecutionTime(cr);
 
        fields1->Set("check_type", CompatUtility::GetCheckableCheckType(checkable));
@@ -1294,7 +1294,7 @@ void DbEvents::AddEventHandlerHistory(const Checkable::Ptr& checkable)
        query1.Type = DbQueryInsert;
        query1.Category = DbCatEventHandler;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
 
        Host::Ptr host;
        Service::Ptr service;
@@ -1333,7 +1333,7 @@ void DbEvents::AddExternalCommandHistory(double time, const String& command, con
        query1.Type = DbQueryInsert;
        query1.Category = DbCatExternalCommand;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
 
        fields1->Set("entry_time", DbValue::FromTimestamp(static_cast<long>(time)));
        fields1->Set("command_type", CompatUtility::MapExternalCommandType(command));
index 181ac000deb3e1e56f4b3d10a793feb04083c59a..28fbf8aee6992633a3aaa9fa0944499189b48745 100644 (file)
@@ -40,7 +40,7 @@ boost::signals2::signal<void (const DbQuery&)> DbObject::OnQuery;
 
 INITIALIZE_ONCE(&DbObject::StaticInitialize);
 
-DbObject::DbObject(const shared_ptr<DbType>& type, const String& name1, const String& name2)
+DbObject::DbObject(const intrusive_ptr<DbType>& type, const String& name1, const String& name2)
        : m_Name1(name1), m_Name2(name2), m_Type(type), m_LastConfigUpdate(0), m_LastStatusUpdate(0)
 { }
 
@@ -95,9 +95,9 @@ void DbObject::SendConfigUpdate(void)
        query.Fields->Set(GetType()->GetIDColumn(), GetObject());
        query.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
        query.Fields->Set("config_type", 1);
-       query.WhereCriteria = make_shared<Dictionary>();
+       query.WhereCriteria = new Dictionary();
        query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject());
-       query.Object = GetSelf();
+       query.Object = this;
        query.ConfigUpdate = true;
        OnQuery(query);
 
@@ -139,9 +139,9 @@ void DbObject::SendStatusUpdate(void)
        query.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
 
        query.Fields->Set("status_update_time", DbValue::FromTimestamp(Utility::GetTime()));
-       query.WhereCriteria = make_shared<Dictionary>();
+       query.WhereCriteria = new Dictionary();
        query.WhereCriteria->Set(GetType()->GetIDColumn(), GetObject());
-       query.Object = GetSelf();
+       query.Object = this;
        query.StatusUpdate = true;
        OnQuery(query);
 
@@ -186,7 +186,7 @@ void DbObject::SendVarsConfigUpdate(void)
                            << "object customvar key: '" << kv.first << "' value: '" << kv.second
                            << "' overridden: " << overridden;
 
-                       Dictionary::Ptr fields = make_shared<Dictionary>();
+                       Dictionary::Ptr fields = new Dictionary();
                        fields->Set("varname", kv.first);
                        fields->Set("varvalue", value);
                        fields->Set("is_json", is_json);
@@ -241,7 +241,7 @@ void DbObject::SendVarsStatusUpdate(void)
                            << "object customvar key: '" << kv.first << "' value: '" << kv.second
                            << "' overridden: " << overridden;
 
-                       Dictionary::Ptr fields = make_shared<Dictionary>();
+                       Dictionary::Ptr fields = new Dictionary();
                        fields->Set("varname", kv.first);
                        fields->Set("varvalue", value);
                        fields->Set("is_json", is_json);
@@ -256,10 +256,10 @@ void DbObject::SendVarsStatusUpdate(void)
                        query.Category = DbCatState;
                        query.Fields = fields;
 
-                       query.WhereCriteria = make_shared<Dictionary>();
+                       query.WhereCriteria = new Dictionary();
                        query.WhereCriteria->Set("object_id", obj);
                        query.WhereCriteria->Set("varname", Convert::ToString(kv.first));
-                       query.Object = GetSelf();
+                       query.Object = this;
 
                        OnQuery(query);
                }
index 80f85bbd2d0abc20a26b2888be33a908a9503c65..4b96e2a9b3ae8f27fe7748b8ee6d9d04bffc78ee 100644 (file)
@@ -70,7 +70,7 @@ public:
 
        String GetName1(void) const;
        String GetName2(void) const;
-       shared_ptr<DbType> GetType(void) const;
+       intrusive_ptr<DbType> GetType(void) const;
 
        virtual Dictionary::Ptr GetConfigFields(void) const = 0;
        virtual Dictionary::Ptr GetStatusFields(void) const = 0;
@@ -88,7 +88,7 @@ public:
        double GetLastStatusUpdate(void) const;
 
 protected:
-       DbObject(const shared_ptr<DbType>& type, const String& name1, const String& name2);
+       DbObject(const intrusive_ptr<DbType>& type, const String& name1, const String& name2);
 
        virtual bool IsStatusAttribute(const String& attribute) const;
 
@@ -98,7 +98,7 @@ protected:
 private:
        String m_Name1;
        String m_Name2;
-       shared_ptr<DbType> m_Type;
+       intrusive_ptr<DbType> m_Type;
        DynamicObject::Ptr m_Object;
        double m_LastConfigUpdate;
        double m_LastStatusUpdate;
index 4d5faa03a5fde9296f9ca89c70d7e0dcf4ca78a3..e67add37c7c58cbc0f35b43fd6ad62d9eb7c2c00 100644 (file)
@@ -66,8 +66,8 @@ struct I2_DB_IDO_API DbQuery
        String IdColumn;
        Dictionary::Ptr Fields;
        Dictionary::Ptr WhereCriteria;
-       shared_ptr<DbObject> Object;
-       shared_ptr<CustomVarObject> NotificationObject;
+       intrusive_ptr<DbObject> Object;
+       intrusive_ptr<CustomVarObject> NotificationObject;
        bool ConfigUpdate;
        bool StatusUpdate;
 
@@ -81,3 +81,5 @@ struct I2_DB_IDO_API DbQuery
 }
 
 #endif /* DBQUERY_H */
+
+#include "db_ido/dbobject.hpp"
index 2f197e618fb2b24a305a78d6b33931519303dec0..f7d248032435eb8b3309a52bcb73aae0044e4d07 100644 (file)
@@ -92,7 +92,7 @@ DbObject::Ptr DbType::GetOrCreateObjectByName(const String& name1, const String&
        if (it != m_Objects.end())
                return it->second;
 
-       DbObject::Ptr dbobj = m_ObjectFactory(GetSelf(), name1, name2);
+       DbObject::Ptr dbobj = m_ObjectFactory(this, name1, name2);
        m_Objects[std::make_pair(name1, name2)] = dbobj;
 
        return dbobj;
index fda97ffc7663ce7e6eeddafecd6f98a5d00c5427..9f7544a2fdc61e560c9d05a396c82ade1ff25110 100644 (file)
@@ -41,9 +41,9 @@ class I2_DB_IDO_API DbType : public Object
 public:
        DECLARE_PTR_TYPEDEFS(DbType);
 
-       typedef boost::function<shared_ptr<DbObject> (const shared_ptr<DbType>&, const String&, const String&)> ObjectFactory;
+       typedef boost::function<intrusive_ptr<DbObject> (const intrusive_ptr<DbType>&, const String&, const String&)> ObjectFactory;
        typedef std::map<String, DbType::Ptr> TypeMap;
-       typedef std::map<std::pair<String, String>, shared_ptr<DbObject> > ObjectMap;
+       typedef std::map<std::pair<String, String>, intrusive_ptr<DbObject> > ObjectMap;
 
        DbType(const String& table, long tid, const String& idcolumn, const ObjectFactory& factory);
 
@@ -57,7 +57,7 @@ public:
        static DbType::Ptr GetByName(const String& name);
        static DbType::Ptr GetByID(long tid);
 
-       shared_ptr<DbObject> GetOrCreateObjectByName(const String& name1, const String& name2);
+       intrusive_ptr<DbObject> GetOrCreateObjectByName(const String& name1, const String& name2);
 
        static std::set<DbType::Ptr> GetAllTypes(void);
 
@@ -100,7 +100,7 @@ public:
                dbtype = DbType::GetByID(tid);
 
                if (!dbtype)
-                       dbtype = make_shared<DbType>(table, tid, idcolumn, factory);
+                       dbtype = new DbType(table, tid, idcolumn, factory);
 
                DbType::RegisterType(name, dbtype);
        }
@@ -112,9 +112,9 @@ public:
  * @ingroup ido
  */
 template<typename T>
-shared_ptr<T> DbObjectFactory(const DbType::Ptr& type, const String& name1, const String& name2)
+intrusive_ptr<T> DbObjectFactory(const DbType::Ptr& type, const String& name1, const String& name2)
 {
-       return make_shared<T>(type, name1, name2);
+       return new T(type, name1, name2);
 }
 
 #define REGISTER_DBTYPE(name, table, tid, idcolumn, type) \
index a1b4242ded5fba96b771a2d2b7e7460c91319bce..2508736265f861340154712748f1924408299e5b 100644 (file)
@@ -30,12 +30,12 @@ Value DbValue::FromTimestamp(const Value& ts)
        if (ts.IsEmpty() || ts == 0)
                return Empty;
 
-       return make_shared<DbValue>(DbValueTimestamp, ts);
+       return new DbValue(DbValueTimestamp, ts);
 }
 
 Value DbValue::FromTimestampNow(void)
 {
-       return make_shared<DbValue>(DbValueTimestampNow, Empty);
+       return new DbValue(DbValueTimestampNow, Empty);
 }
 
 Value DbValue::FromValue(const Value& value)
@@ -45,7 +45,7 @@ Value DbValue::FromValue(const Value& value)
 
 Value DbValue::FromObjectInsertID(const Value& value)
 {
-       return make_shared<DbValue>(DbValueObjectInsertID, value);
+       return new DbValue(DbValueObjectInsertID, value);
 }
 
 bool DbValue::IsTimestamp(const Value& value)
index 39ec869b3b8aa4e187e768df3f078c5291ee27be..98d7e73b80da976cceb7fb512d73ae73f8654b53 100644 (file)
@@ -48,7 +48,7 @@ EndpointDbObject::EndpointDbObject(const DbType::Ptr& type, const String& name1,
 
 Dictionary::Ptr EndpointDbObject::GetConfigFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        Endpoint::Ptr endpoint = static_pointer_cast<Endpoint>(GetObject());
 
        fields->Set("identity", endpoint->GetName());
@@ -59,7 +59,7 @@ Dictionary::Ptr EndpointDbObject::GetConfigFields(void) const
 
 Dictionary::Ptr EndpointDbObject::GetStatusFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        Endpoint::Ptr endpoint = static_pointer_cast<Endpoint>(GetObject());
 
        Log(LogDebug, "EndpointDbObject")
@@ -83,12 +83,12 @@ void EndpointDbObject::UpdateConnectedStatus(const Endpoint::Ptr& endpoint)
        query1.Table = "endpointstatus";
        query1.Type = DbQueryUpdate;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("is_connected", (connected ? 1 : 0));
        fields1->Set("status_update_time", DbValue::FromTimestamp(Utility::GetTime()));
        query1.Fields = fields1;
 
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        query1.WhereCriteria->Set("endpoint_object_id", endpoint);
        query1.WhereCriteria->Set("instance_id", 0); /* DbConnection class fills in real ID */
 
@@ -115,7 +115,7 @@ void EndpointDbObject::OnConfigUpdate(void)
        query1.Table = "endpointstatus";
        query1.Type = DbQueryInsert;
 
-       Dictionary::Ptr fields1 = make_shared<Dictionary>();
+       Dictionary::Ptr fields1 = new Dictionary();
        fields1->Set("identity", endpoint->GetName());
        fields1->Set("node", IcingaApplication::GetInstance()->GetNodeName());
        fields1->Set("is_connected", EndpointIsConnected(endpoint));
index e11fe1b85cd97b9770f910f73b35e1dccca79597..72458806b0c503bcb8a1c353f8dcb62a5934eedb 100644 (file)
@@ -37,7 +37,7 @@ class EndpointDbObject : public DbObject
 public:
        DECLARE_PTR_TYPEDEFS(EndpointDbObject);
 
-       EndpointDbObject(const shared_ptr<DbType>& type, const String& name1, const String& name2);
+       EndpointDbObject(const intrusive_ptr<DbType>& type, const String& name1, const String& name2);
 
        static void StaticInitialize(void);
 
index fda26ae26f505218902a6eddc1363bc4859bb6d3..5b39ac7e13a558f05df79ff8316a5aebae4fe8b9 100644 (file)
@@ -43,7 +43,7 @@ HostDbObject::HostDbObject(const DbType::Ptr& type, const String& name1, const S
 
 Dictionary::Ptr HostDbObject::GetConfigFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        Host::Ptr host = static_pointer_cast<Host>(GetObject());
 
        fields->Set("alias", CompatUtility::GetHostAlias(host));
@@ -110,7 +110,7 @@ Dictionary::Ptr HostDbObject::GetConfigFields(void) const
 
 Dictionary::Ptr HostDbObject::GetStatusFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        Host::Ptr host = static_pointer_cast<Host>(GetObject());
 
        CheckResult::Ptr cr = host->GetLastCheckResult();
@@ -188,7 +188,7 @@ void HostDbObject::OnConfigUpdate(void)
                    << "host parents: " << parent->GetName();
 
                /* parents: host_id, parent_host_object_id */
-               Dictionary::Ptr fields1 = make_shared<Dictionary>();
+               Dictionary::Ptr fields1 = new Dictionary();
                fields1->Set(GetType()->GetTable() + "_id", DbValue::FromObjectInsertID(GetObject()));
                fields1->Set("parent_host_object_id", parent);
                fields1->Set("instance_id", 0); /* DbConnection class fills in real ID */
@@ -219,7 +219,7 @@ void HostDbObject::OnConfigUpdate(void)
                Log(LogDebug, "HostDbObject")
                    << "parent host: " << parent->GetName();
 
-               Dictionary::Ptr fields2 = make_shared<Dictionary>();
+               Dictionary::Ptr fields2 = new Dictionary();
                fields2->Set("host_object_id", parent);
                fields2->Set("dependent_host_object_id", host);
                fields2->Set("inherits_parent", 1);
@@ -243,7 +243,7 @@ void HostDbObject::OnConfigUpdate(void)
                Log(LogDebug, "HostDbObject")
                    << "host contacts: " << user->GetName();
 
-               Dictionary::Ptr fields_contact = make_shared<Dictionary>();
+               Dictionary::Ptr fields_contact = new Dictionary();
                fields_contact->Set("host_id", DbValue::FromObjectInsertID(host));
                fields_contact->Set("contact_object_id", user);
                fields_contact->Set("instance_id", 0); /* DbConnection class fills in real ID */
@@ -263,7 +263,7 @@ void HostDbObject::OnConfigUpdate(void)
                Log(LogDebug, "HostDbObject")
                    << "host contactgroups: " << usergroup->GetName();
 
-               Dictionary::Ptr fields_contact = make_shared<Dictionary>();
+               Dictionary::Ptr fields_contact = new Dictionary();
                fields_contact->Set("host_id", DbValue::FromObjectInsertID(host));
                fields_contact->Set("contactgroup_object_id", usergroup);
                fields_contact->Set("instance_id", 0); /* DbConnection class fills in real ID */
index b99fa89b0e20005fddbb07d16126a9ef381346fb..ec861a4cdece5a78c86e705006c1a58486c90200 100644 (file)
@@ -35,7 +35,7 @@ HostGroupDbObject::HostGroupDbObject(const DbType::Ptr& type, const String& name
 
 Dictionary::Ptr HostGroupDbObject::GetConfigFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        HostGroup::Ptr group = static_pointer_cast<HostGroup>(GetObject());
 
        fields->Set("alias", group->GetDisplayName());
@@ -60,7 +60,7 @@ void HostGroupDbObject::OnConfigUpdate(void)
                query1.Table = DbType::GetByName("HostGroup")->GetTable() + "_members";
                query1.Type = DbQueryInsert;
                query1.Category = DbCatConfig;
-               query1.Fields = make_shared<Dictionary>();
+               query1.Fields = new Dictionary();
                query1.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
                query1.Fields->Set("hostgroup_id", DbValue::FromObjectInsertID(group));
                query1.Fields->Set("host_object_id", host);
index 9a114fa71ac45925019a9708ece0bcfc7f9da034..d5ecfc7113d47b5e92ad6e13312df6dae638585c 100644 (file)
@@ -48,7 +48,7 @@ ServiceDbObject::ServiceDbObject(const DbType::Ptr& type, const String& name1, c
 
 Dictionary::Ptr ServiceDbObject::GetConfigFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        Service::Ptr service = static_pointer_cast<Service>(GetObject());
        Host::Ptr host = service->GetHost();
 
@@ -106,7 +106,7 @@ Dictionary::Ptr ServiceDbObject::GetConfigFields(void) const
 
 Dictionary::Ptr ServiceDbObject::GetStatusFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        Service::Ptr service = static_pointer_cast<Service>(GetObject());
        CheckResult::Ptr cr = service->GetLastCheckResult();
 
@@ -195,7 +195,7 @@ void ServiceDbObject::OnConfigUpdate(void)
                int state_filter = dep->GetStateFilter();
 
                /* service dependencies */
-               Dictionary::Ptr fields1 = make_shared<Dictionary>();
+               Dictionary::Ptr fields1 = new Dictionary();
                fields1->Set("service_object_id", parent);
                fields1->Set("dependent_service_object_id", service);
                fields1->Set("inherits_parent", 1);
@@ -222,7 +222,7 @@ void ServiceDbObject::OnConfigUpdate(void)
                Log(LogDebug, "ServiceDbObject")
                    << "service contacts: " << user->GetName();
 
-               Dictionary::Ptr fields_contact = make_shared<Dictionary>();
+               Dictionary::Ptr fields_contact = new Dictionary();
                fields_contact->Set("service_id", DbValue::FromObjectInsertID(service));
                fields_contact->Set("contact_object_id", user);
                fields_contact->Set("instance_id", 0); /* DbConnection class fills in real ID */
@@ -242,7 +242,7 @@ void ServiceDbObject::OnConfigUpdate(void)
                Log(LogDebug, "ServiceDbObject")
                    << "service contactgroups: " << usergroup->GetName();
 
-               Dictionary::Ptr fields_contact = make_shared<Dictionary>();
+               Dictionary::Ptr fields_contact = new Dictionary();
                fields_contact->Set("service_id", DbValue::FromObjectInsertID(service));
                fields_contact->Set("contactgroup_object_id", usergroup);
                fields_contact->Set("instance_id", 0); /* DbConnection class fills in real ID */
index b2cd0673f6a382c3c9f0151e9bda3e0ea0f42750..b970f12001d99cb3d49a0b2185304779b3cdf984 100644 (file)
@@ -34,7 +34,7 @@ ServiceGroupDbObject::ServiceGroupDbObject(const DbType::Ptr& type, const String
 
 Dictionary::Ptr ServiceGroupDbObject::GetConfigFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        ServiceGroup::Ptr group = static_pointer_cast<ServiceGroup>(GetObject());
 
        fields->Set("alias", group->GetDisplayName());
@@ -59,7 +59,7 @@ void ServiceGroupDbObject::OnConfigUpdate(void)
                query1.Table = DbType::GetByName("ServiceGroup")->GetTable() + "_members";
                query1.Type = DbQueryInsert;
                query1.Category = DbCatConfig;
-               query1.Fields = make_shared<Dictionary>();
+               query1.Fields = new Dictionary();
                query1.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
                query1.Fields->Set("servicegroup_id", DbValue::FromObjectInsertID(group));
                query1.Fields->Set("service_object_id", service);
index 810b38a8462886ac7c72570e72ec4b8a9f191d1c..cb762c10a66bb9fbb7c5c18df7e61f2bef230eed 100644 (file)
@@ -37,7 +37,7 @@ TimePeriodDbObject::TimePeriodDbObject(const DbType::Ptr& type, const String& na
 
 Dictionary::Ptr TimePeriodDbObject::GetConfigFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        TimePeriod::Ptr tp = static_pointer_cast<TimePeriod>(GetObject());
 
        fields->Set("alias", tp->GetDisplayName());
@@ -58,7 +58,7 @@ void TimePeriodDbObject::OnConfigUpdate(void)
        query_del1.Table = GetType()->GetTable() + "_timeranges";
        query_del1.Type = DbQueryDelete;
        query_del1.Category = DbCatConfig;
-       query_del1.WhereCriteria = make_shared<Dictionary>();
+       query_del1.WhereCriteria = new Dictionary();
        query_del1.WhereCriteria->Set("timeperiod_id", DbValue::FromObjectInsertID(tp));
        OnQuery(query_del1);
 
@@ -77,7 +77,7 @@ void TimePeriodDbObject::OnConfigUpdate(void)
 
                tm reference = Utility::LocalTime(refts);
 
-               Array::Ptr segments = make_shared<Array>();
+               Array::Ptr segments = new Array();
                LegacyTimePeriod::ProcessTimeRanges(kv.second, &reference, segments);
 
                ObjectLock olock(segments);
@@ -90,7 +90,7 @@ void TimePeriodDbObject::OnConfigUpdate(void)
                        query.Table = GetType()->GetTable() + "_timeranges";
                        query.Type = DbQueryInsert;
                        query.Category = DbCatConfig;
-                       query.Fields = make_shared<Dictionary>();
+                       query.Fields = new Dictionary();
                        query.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
                        query.Fields->Set("timeperiod_id", DbValue::FromObjectInsertID(tp));
                        query.Fields->Set("day", wday);
index 4e7027983b93bbbef78a40d5fbaaeee8affe7009..4bbe2e659b320b5d4ead7ab3b53110567d74309f 100644 (file)
@@ -37,7 +37,7 @@ UserDbObject::UserDbObject(const DbType::Ptr& type, const String& name1, const S
 
 Dictionary::Ptr UserDbObject::GetConfigFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        User::Ptr user = static_pointer_cast<User>(GetObject());
 
        fields->Set("alias", user->GetDisplayName());
@@ -65,7 +65,7 @@ Dictionary::Ptr UserDbObject::GetConfigFields(void) const
 
 Dictionary::Ptr UserDbObject::GetStatusFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        User::Ptr user = static_pointer_cast<User>(GetObject());
 
        fields->Set("host_notifications_enabled", user->GetEnableNotifications());
@@ -81,7 +81,7 @@ Dictionary::Ptr UserDbObject::GetStatusFields(void) const
 
 void UserDbObject::OnConfigUpdate(void)
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        User::Ptr user = static_pointer_cast<User>(GetObject());
 
        /* contact addresses */
index 7e993b07623004dd241248222239db6b9b71f115..c5c853afd62c88231bce187d474d7ae92c329128 100644 (file)
@@ -35,7 +35,7 @@ UserGroupDbObject::UserGroupDbObject(const DbType::Ptr& type, const String& name
 
 Dictionary::Ptr UserGroupDbObject::GetConfigFields(void) const
 {
-       Dictionary::Ptr fields = make_shared<Dictionary>();
+       Dictionary::Ptr fields = new Dictionary();
        UserGroup::Ptr group = static_pointer_cast<UserGroup>(GetObject());
 
        fields->Set("alias", group->GetDisplayName());
@@ -56,7 +56,7 @@ void UserGroupDbObject::OnConfigUpdate(void)
        query1.Table = DbType::GetByName("UserGroup")->GetTable() + "_members";
        query1.Type = DbQueryDelete;
        query1.Category = DbCatConfig;
-       query1.WhereCriteria = make_shared<Dictionary>();
+       query1.WhereCriteria = new Dictionary();
        query1.WhereCriteria->Set("instance_id", 0);
        query1.WhereCriteria->Set("contactgroup_id", DbValue::FromObjectInsertID(group));
        OnQuery(query1);
@@ -66,7 +66,7 @@ void UserGroupDbObject::OnConfigUpdate(void)
                query2.Table = DbType::GetByName("UserGroup")->GetTable() + "_members";
                query2.Type = DbQueryInsert;
                query2.Category = DbCatConfig;
-               query2.Fields = make_shared<Dictionary>();
+               query2.Fields = new Dictionary();
                query2.Fields->Set("instance_id", 0); /* DbConnection class fills in real ID */
                query2.Fields->Set("contactgroup_id", DbValue::FromObjectInsertID(group));
                query2.Fields->Set("contact_object_id", user);
index 733953b56906db0a38684fe7ee247189a4e4f991..e7b90e8700366f6576d81147c98386d192df82e8 100644 (file)
@@ -41,19 +41,19 @@ REGISTER_STATSFUNCTION(IdoMysqlConnectionStats, &IdoMysqlConnection::StatsFunc);
 
 Value IdoMysqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const IdoMysqlConnection::Ptr& idomysqlconnection, DynamicType::GetObjectsByType<IdoMysqlConnection>()) {
                size_t items = idomysqlconnection->m_QueryQueue.GetLength();
 
-               Dictionary::Ptr stats = make_shared<Dictionary>();
+               Dictionary::Ptr stats = new Dictionary();
                stats->Set("version", SCHEMA_VERSION);
                stats->Set("instance_name", idomysqlconnection->GetInstanceName());
                stats->Set("query_queue_items", items);
 
                nodes->Set(idomysqlconnection->GetName(), stats);
 
-               perfdata->Add(make_shared<PerfdataValue>("idomysqlconnection_" + idomysqlconnection->GetName() + "_query_queue_items", items));
+               perfdata->Add(new PerfdataValue("idomysqlconnection_" + idomysqlconnection->GetName() + "_query_queue_items", items));
        }
 
        status->Set("idomysqlconnection", nodes);
@@ -69,12 +69,12 @@ void IdoMysqlConnection::Resume(void)
 
        m_QueryQueue.SetExceptionCallback(boost::bind(&IdoMysqlConnection::ExceptionHandler, this, _1));
 
-       m_TxTimer = make_shared<Timer>();
+       m_TxTimer = new Timer();
        m_TxTimer->SetInterval(1);
        m_TxTimer->OnTimerExpired.connect(boost::bind(&IdoMysqlConnection::TxTimerHandler, this));
        m_TxTimer->Start();
 
-       m_ReconnectTimer = make_shared<Timer>();
+       m_ReconnectTimer = new Timer();
        m_ReconnectTimer->SetInterval(10);
        m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&IdoMysqlConnection::ReconnectTimerHandler, this));
        m_ReconnectTimer->Start();
@@ -444,7 +444,7 @@ Dictionary::Ptr IdoMysqlConnection::FetchRow(const IdoMysqlResult& result)
        if (!lengths)
                return Dictionary::Ptr();
 
-       Dictionary::Ptr dict = make_shared<Dictionary>();
+       Dictionary::Ptr dict = new Dictionary();
 
        mysql_field_seek(result.get(), 0);
        for (field = mysql_fetch_field(result.get()), i = 0; field; field = mysql_fetch_field(result.get()), i++)
index 5e383921eacd07cd3c4bc65b82597ba9cbaceacd..6f7b81d8d5e90e5e8b4300b5b2af532b0fb5aab8 100644 (file)
@@ -29,7 +29,7 @@
 namespace icinga
 {
 
-typedef shared_ptr<MYSQL_RES> IdoMysqlResult;
+typedef boost::shared_ptr<MYSQL_RES> IdoMysqlResult;
 
 /**
  * An IDO MySQL database connection.
index ad89aaed5611815a8bf60f3eaa1208193e3d26d4..6a52fe862aef0bc5411a5aca18a4626a0252b4ad 100644 (file)
@@ -43,19 +43,19 @@ REGISTER_STATSFUNCTION(IdoPgsqlConnectionStats, &IdoPgsqlConnection::StatsFunc);
 
 Value IdoPgsqlConnection::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const IdoPgsqlConnection::Ptr& idopgsqlconnection, DynamicType::GetObjectsByType<IdoPgsqlConnection>()) {
                size_t items = idopgsqlconnection->m_QueryQueue.GetLength();
 
-               Dictionary::Ptr stats = make_shared<Dictionary>();
+               Dictionary::Ptr stats = new Dictionary();
                stats->Set("version", SCHEMA_VERSION);
                stats->Set("instance_name", idopgsqlconnection->GetInstanceName());
                stats->Set("query_queue_items", items);
 
                nodes->Set(idopgsqlconnection->GetName(), stats);
 
-               perfdata->Add(make_shared<PerfdataValue>("idopgsqlconnection_" + idopgsqlconnection->GetName() + "_query_queue_items", items));
+               perfdata->Add(new PerfdataValue("idopgsqlconnection_" + idopgsqlconnection->GetName() + "_query_queue_items", items));
        }
 
        status->Set("idopgsqlconnection", nodes);
@@ -71,12 +71,12 @@ void IdoPgsqlConnection::Resume(void)
 
        m_QueryQueue.SetExceptionCallback(boost::bind(&IdoPgsqlConnection::ExceptionHandler, this, _1));
 
-       m_TxTimer = make_shared<Timer>();
+       m_TxTimer = new Timer();
        m_TxTimer->SetInterval(1);
        m_TxTimer->OnTimerExpired.connect(boost::bind(&IdoPgsqlConnection::TxTimerHandler, this));
        m_TxTimer->Start();
 
-       m_ReconnectTimer = make_shared<Timer>();
+       m_ReconnectTimer = new Timer();
        m_ReconnectTimer->SetInterval(10);
        m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&IdoPgsqlConnection::ReconnectTimerHandler, this));
        m_ReconnectTimer->Start();
@@ -443,7 +443,7 @@ Dictionary::Ptr IdoPgsqlConnection::FetchRow(const IdoPgsqlResult& result, int r
 
        int columns = PQnfields(result.get());
 
-       Dictionary::Ptr dict = make_shared<Dictionary>();
+       Dictionary::Ptr dict = new Dictionary();
 
        for (int column = 0; column < columns; column++) {
                Value value;
index 00ed97198ea10d90a3cfb8b6ae0fd5c2ac4b8f0f..ea9dbd62fbc5392edcdfa3ece91aa6515abce8a2 100644 (file)
@@ -29,7 +29,7 @@
 namespace icinga
 {
 
-typedef shared_ptr<PGresult> IdoPgsqlResult;
+typedef boost::shared_ptr<PGresult> IdoPgsqlResult;
 
 /**
  * An IDO pgSQL database connection.
index 5a82138a7a288cd557697e0053e588bf8c8e324f..38b70f58ebde2236909e3ae99239dac4caa0f2f7 100644 (file)
@@ -36,7 +36,7 @@ void Demo::Start(void)
 {
        DynamicObject::Start();
 
-       m_DemoTimer = make_shared<Timer>();
+       m_DemoTimer = new Timer();
        m_DemoTimer->SetInterval(5);
        m_DemoTimer->OnTimerExpired.connect(boost::bind(&Demo::DemoTimerHandler, this));
        m_DemoTimer->Start();
@@ -47,7 +47,7 @@ void Demo::Start(void)
  */
 void Demo::DemoTimerHandler(void)
 {
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("method", "demo::HelloWorld");
 
        ApiListener::Ptr listener = ApiListener::GetInstance();
index d13276a5ad7cef9dc83705cb3943e9ac28ac781b..dc354199a4a549b52b62aaf4c9367f2cddabf115 100644 (file)
@@ -93,7 +93,7 @@ void ApiEvents::StaticInitialize(void)
        Checkable::OnAcknowledgementSet.connect(&ApiEvents::AcknowledgementSetHandler);
        Checkable::OnAcknowledgementCleared.connect(&ApiEvents::AcknowledgementClearedHandler);
 
-       l_RepositoryTimer = make_shared<Timer>();
+       l_RepositoryTimer = new Timer();
        l_RepositoryTimer->SetInterval(30);
        l_RepositoryTimer->OnTimerExpired.connect(boost::bind(&ApiEvents::RepositoryTimerHandler));
        l_RepositoryTimer->Start();
@@ -107,7 +107,7 @@ void ApiEvents::CheckResultHandler(const Checkable::Ptr& checkable, const CheckR
        if (!listener)
                return;
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::CheckResult");
 
@@ -115,7 +115,7 @@ void ApiEvents::CheckResultHandler(const Checkable::Ptr& checkable, const CheckR
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
@@ -134,7 +134,7 @@ Value ApiEvents::CheckResultAPIHandler(const MessageOrigin& origin, const Dictio
        if (!params)
                return Empty;
 
-       CheckResult::Ptr cr = make_shared<CheckResult>();
+       CheckResult::Ptr cr = new CheckResult();
 
        Dictionary::Ptr vcr = params->Get("cr");
        Array::Ptr vperf = vcr->Get("performance_data");
@@ -142,7 +142,7 @@ Value ApiEvents::CheckResultAPIHandler(const MessageOrigin& origin, const Dictio
 
        Deserialize(cr, params->Get("cr"), true);
 
-       Array::Ptr rperf = make_shared<Array>();
+       Array::Ptr rperf = new Array();
 
        if (vperf) {
                ObjectLock olock(vperf);
@@ -150,7 +150,7 @@ Value ApiEvents::CheckResultAPIHandler(const MessageOrigin& origin, const Dictio
                        Value p;
 
                        if (vp.IsObjectType<Dictionary>()) {
-                               PerfdataValue::Ptr val = make_shared<PerfdataValue>();
+                               PerfdataValue::Ptr val = new PerfdataValue();
                                Deserialize(val, vp, true);
                                rperf->Add(val);
                        } else
@@ -194,13 +194,13 @@ void ApiEvents::NextCheckChangedHandler(const Checkable::Ptr& checkable, double
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("next_check", nextCheck);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetNextCheck");
        message->Set("params", params);
@@ -246,11 +246,11 @@ void ApiEvents::NextNotificationChangedHandler(const Notification::Ptr& notifica
        if (!listener)
                return;
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("notification", notification->GetName());
        params->Set("next_notification", nextNotification);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetNextNotification");
        message->Set("params", params);
@@ -290,13 +290,13 @@ void ApiEvents::ForceNextCheckChangedHandler(const Checkable::Ptr& checkable, bo
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("forced", forced);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetForceNextCheck");
        message->Set("params", params);
@@ -346,13 +346,13 @@ void ApiEvents::ForceNextNotificationChangedHandler(const Checkable::Ptr& checka
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("forced", forced);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetForceNextNotification");
        message->Set("params", params);
@@ -402,13 +402,13 @@ void ApiEvents::EnableActiveChecksChangedHandler(const Checkable::Ptr& checkable
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("enabled", enabled);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetEnableActiveChecks");
        message->Set("params", params);
@@ -458,13 +458,13 @@ void ApiEvents::EnablePassiveChecksChangedHandler(const Checkable::Ptr& checkabl
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("enabled", enabled);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetEnablePassiveChecks");
        message->Set("params", params);
@@ -514,13 +514,13 @@ void ApiEvents::EnableNotificationsChangedHandler(const Checkable::Ptr& checkabl
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("enabled", enabled);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetEnableNotifications");
        message->Set("params", params);
@@ -570,13 +570,13 @@ void ApiEvents::EnableFlappingChangedHandler(const Checkable::Ptr& checkable, bo
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("enabled", enabled);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetEnableFlapping");
        message->Set("params", params);
@@ -626,13 +626,13 @@ void ApiEvents::EnableEventHandlerChangedHandler(const Checkable::Ptr& checkable
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("enabled", enabled);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetEnableEventHandler");
        message->Set("params", params);
@@ -682,13 +682,13 @@ void ApiEvents::EnablePerfdataChangedHandler(const Checkable::Ptr& checkable, bo
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("enabled", enabled);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetEnablePerfdata");
        message->Set("params", params);
@@ -738,13 +738,13 @@ void ApiEvents::CheckIntervalChangedHandler(const Checkable::Ptr& checkable, dou
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("interval", interval);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetCheckInterval");
        message->Set("params", params);
@@ -794,13 +794,13 @@ void ApiEvents::RetryIntervalChangedHandler(const Checkable::Ptr& checkable, dou
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("interval", interval);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetRetryInterval");
        message->Set("params", params);
@@ -850,13 +850,13 @@ void ApiEvents::MaxCheckAttemptsChangedHandler(const Checkable::Ptr& checkable,
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("attempts", attempts);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetMaxCheckAttempts");
        message->Set("params", params);
@@ -906,13 +906,13 @@ void ApiEvents::EventCommandChangedHandler(const Checkable::Ptr& checkable, cons
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("command", command->GetName());
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetEventCommand");
        message->Set("params", params);
@@ -967,13 +967,13 @@ void ApiEvents::CheckCommandChangedHandler(const Checkable::Ptr& checkable, cons
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("command", command->GetName());
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetCheckCommand");
        message->Set("params", params);
@@ -1028,13 +1028,13 @@ void ApiEvents::CheckPeriodChangedHandler(const Checkable::Ptr& checkable, const
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("timeperiod", timeperiod->GetName());
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetCheckPeriod");
        message->Set("params", params);
@@ -1085,11 +1085,11 @@ void ApiEvents::VarsChangedHandler(const CustomVarObject::Ptr& object, const Dic
        if (!listener)
                return;
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("object", object->GetName());
        params->Set("vars", Serialize(vars));
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetVars");
        message->Set("params", params);
@@ -1151,13 +1151,13 @@ void ApiEvents::CommentAddedHandler(const Checkable::Ptr& checkable, const Comme
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("comment", Serialize(comment));
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::AddComment");
        message->Set("params", params);
@@ -1191,7 +1191,7 @@ Value ApiEvents::CommentAddedAPIHandler(const MessageOrigin& origin, const Dicti
        if (origin.FromZone && !origin.FromZone->CanAccessObject(checkable))
                return Empty;
 
-       Comment::Ptr comment = make_shared<Comment>();
+       Comment::Ptr comment = new Comment();
        Deserialize(comment, params->Get("comment"), true);
 
        checkable->AddComment(comment->GetEntryType(), comment->GetAuthor(),
@@ -1211,13 +1211,13 @@ void ApiEvents::CommentRemovedHandler(const Checkable::Ptr& checkable, const Com
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("id", comment->GetId());
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::RemoveComment");
        message->Set("params", params);
@@ -1267,13 +1267,13 @@ void ApiEvents::DowntimeAddedHandler(const Checkable::Ptr& checkable, const Down
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("downtime", Serialize(downtime));
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::AddDowntime");
        message->Set("params", params);
@@ -1307,7 +1307,7 @@ Value ApiEvents::DowntimeAddedAPIHandler(const MessageOrigin& origin, const Dict
        if (origin.FromZone && !origin.FromZone->CanAccessObject(checkable))
                return Empty;
 
-       Downtime::Ptr downtime = make_shared<Downtime>();
+       Downtime::Ptr downtime = new Downtime();
        Deserialize(downtime, params->Get("downtime"), true);
 
        checkable->AddDowntime(downtime->GetAuthor(), downtime->GetComment(),
@@ -1330,13 +1330,13 @@ void ApiEvents::DowntimeRemovedHandler(const Checkable::Ptr& checkable, const Do
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
        params->Set("id", downtime->GetId());
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::RemoveDowntime");
        message->Set("params", params);
@@ -1388,7 +1388,7 @@ void ApiEvents::AcknowledgementSetHandler(const Checkable::Ptr& checkable,
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
@@ -1397,7 +1397,7 @@ void ApiEvents::AcknowledgementSetHandler(const Checkable::Ptr& checkable,
        params->Set("acktype", type);
        params->Set("expiry", expiry);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::SetAcknowledgement");
        message->Set("params", params);
@@ -1449,12 +1449,12 @@ void ApiEvents::AcknowledgementClearedHandler(const Checkable::Ptr& checkable, c
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("host", host->GetName());
        if (service)
                params->Set("service", service->GetShortName());
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::ClearAcknowledgement");
        message->Set("params", params);
@@ -1500,10 +1500,10 @@ void ApiEvents::RepositoryTimerHandler(void)
        if (!listener)
                return;
 
-       Dictionary::Ptr repository = make_shared<Dictionary>();
+       Dictionary::Ptr repository = new Dictionary();
 
        BOOST_FOREACH(const Host::Ptr& host, DynamicType::GetObjectsByType<Host>()) {
-               Array::Ptr services = make_shared<Array>();
+               Array::Ptr services = new Array();
 
                BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
                        services->Add(service->GetShortName());
@@ -1521,7 +1521,7 @@ void ApiEvents::RepositoryTimerHandler(void)
 
        Zone::Ptr my_zone = my_endpoint->GetZone();
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("seen", Utility::GetTime());
        params->Set("endpoint", my_endpoint->GetName());
 
@@ -1532,7 +1532,7 @@ void ApiEvents::RepositoryTimerHandler(void)
        params->Set("zone", my_zone->GetName());
        params->Set("repository", repository);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::UpdateRepository");
        message->Set("params", params);
@@ -1577,7 +1577,7 @@ Value ApiEvents::UpdateRepositoryAPIHandler(const MessageOrigin& origin, const D
        if (!listener)
                return Empty;
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "event::UpdateRepository");
        message->Set("params", params);
index 1290c1b343392e094a39c5351aaf5e445bfd1d06..77c4cd46524ce17c6612df21b53057c4ac9111d7 100644 (file)
@@ -66,7 +66,7 @@ void Checkable::SetCheckCommand(const CheckCommand::Ptr& command, const MessageO
 {
        SetOverrideCheckCommand(command->GetName());
 
-       OnCheckCommandChanged(GetSelf(), command, origin);
+       OnCheckCommandChanged(this, command, origin);
 }
 
 TimePeriod::Ptr Checkable::GetCheckPeriod(void) const
@@ -85,7 +85,7 @@ void Checkable::SetCheckPeriod(const TimePeriod::Ptr& tp, const MessageOrigin& o
 {
        SetOverrideCheckPeriod(tp->GetName());
 
-       OnCheckPeriodChanged(GetSelf(), tp, origin);
+       OnCheckPeriodChanged(this, tp, origin);
 }
 
 double Checkable::GetCheckInterval(void) const
@@ -100,7 +100,7 @@ void Checkable::SetCheckInterval(double interval, const MessageOrigin& origin)
 {
        SetOverrideCheckInterval(interval);
 
-       OnCheckIntervalChanged(GetSelf(), interval, origin);
+       OnCheckIntervalChanged(this, interval, origin);
 }
 
 double Checkable::GetRetryInterval(void) const
@@ -115,7 +115,7 @@ void Checkable::SetRetryInterval(double interval, const MessageOrigin& origin)
 {
        SetOverrideRetryInterval(interval);
 
-       OnRetryIntervalChanged(GetSelf(), interval, origin);
+       OnRetryIntervalChanged(this, interval, origin);
 }
 
 void Checkable::SetSchedulingOffset(long offset)
@@ -132,7 +132,7 @@ void Checkable::SetNextCheck(double nextCheck, const MessageOrigin& origin)
 {
        SetNextCheckRaw(nextCheck);
 
-       OnNextCheckChanged(GetSelf(), nextCheck, origin);
+       OnNextCheckChanged(this, nextCheck, origin);
 }
 
 double Checkable::GetNextCheck(void)
@@ -186,7 +186,7 @@ void Checkable::SetEnableActiveChecks(bool enabled, const MessageOrigin& origin)
 {
        SetOverrideEnableActiveChecks(enabled);
 
-       OnEnableActiveChecksChanged(GetSelf(), enabled, origin);
+       OnEnableActiveChecksChanged(this, enabled, origin);
 }
 
 bool Checkable::GetEnablePassiveChecks(void) const
@@ -201,7 +201,7 @@ void Checkable::SetEnablePassiveChecks(bool enabled, const MessageOrigin& origin
 {
        SetOverrideEnablePassiveChecks(enabled);
 
-       OnEnablePassiveChecksChanged(GetSelf(), enabled, origin);
+       OnEnablePassiveChecksChanged(this, enabled, origin);
 }
 
 bool Checkable::GetForceNextCheck(void) const
@@ -213,7 +213,7 @@ void Checkable::SetForceNextCheck(bool forced, const MessageOrigin& origin)
 {
        SetForceNextCheckRaw(forced);
 
-       OnForceNextCheckChanged(GetSelf(), forced, origin);
+       OnForceNextCheckChanged(this, forced, origin);
 }
 
 int Checkable::GetMaxCheckAttempts(void) const
@@ -228,7 +228,7 @@ void Checkable::SetMaxCheckAttempts(int attempts, const MessageOrigin& origin)
 {
        SetOverrideMaxCheckAttempts(attempts);
 
-       OnMaxCheckAttemptsChanged(GetSelf(), attempts, origin);
+       OnMaxCheckAttemptsChanged(this, attempts, origin);
 }
 
 void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrigin& origin)
@@ -368,7 +368,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 
        Host::Ptr host;
        Service::Ptr service;
-       tie(host, service) = GetHostService(GetSelf());
+       tie(host, service) = GetHostService(this);
 
        CheckableType checkable_type = CheckableHost;
        if (service)
@@ -394,7 +394,7 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
        if (remove_acknowledgement_comments)
                RemoveCommentsByType(CommentAcknowledgement);
 
-       Dictionary::Ptr vars_after = make_shared<Dictionary>();
+       Dictionary::Ptr vars_after = new Dictionary();
        vars_after->Set("state", new_state);
        vars_after->Set("state_type", GetStateType());
        vars_after->Set("attempt", GetCheckAttempt());
@@ -424,20 +424,20 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
 //         << " threshold: " << GetFlappingThreshold()
 //         << "% current: " + GetFlappingCurrent()) << "%.";
 
-       OnNewCheckResult(GetSelf(), cr, origin);
+       OnNewCheckResult(this, cr, origin);
 
        /* signal status updates to for example db_ido */
-       OnStateChanged(GetSelf());
+       OnStateChanged(this);
 
        String old_state_str = (service ? Service::StateToString(old_state) : Host::StateToString(Host::CalculateState(old_state)));
        String new_state_str = (service ? Service::StateToString(new_state) : Host::StateToString(Host::CalculateState(new_state)));
 
        if (hardChange) {
-               OnStateChange(GetSelf(), cr, StateTypeHard, origin);
+               OnStateChange(this, cr, StateTypeHard, origin);
                Log(LogNotice, "Checkable")
                    << "State Change: Checkable " << GetName() << " hard state change from " << old_state_str << " to " << new_state_str << " detected.";
        } else if (stateChange) {
-               OnStateChange(GetSelf(), cr, StateTypeSoft, origin);
+               OnStateChange(this, cr, StateTypeSoft, origin);
                Log(LogNotice, "Checkable")
                    << "State Change: Checkable " << GetName() << " soft state change from " << old_state_str << " to " << new_state_str << " detected.";
        }
@@ -446,22 +446,22 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
                ExecuteEventHandler();
 
        if (send_downtime_notification)
-               OnNotificationsRequested(GetSelf(), in_downtime ? NotificationDowntimeStart : NotificationDowntimeEnd, cr, "", "");
+               OnNotificationsRequested(this, in_downtime ? NotificationDowntimeStart : NotificationDowntimeEnd, cr, "", "");
 
        if (!was_flapping && is_flapping) {
-               OnNotificationsRequested(GetSelf(), NotificationFlappingStart, cr, "", "");
+               OnNotificationsRequested(this, NotificationFlappingStart, cr, "", "");
 
                Log(LogNotice, "Checkable")
                    << "Flapping: Checkable " << GetName() << " started flapping (" << GetFlappingThreshold() << "% < " << GetFlappingCurrent() << "%).";
-               OnFlappingChanged(GetSelf(), FlappingStarted);
+               OnFlappingChanged(this, FlappingStarted);
        } else if (was_flapping && !is_flapping) {
-               OnNotificationsRequested(GetSelf(), NotificationFlappingEnd, cr, "", "");
+               OnNotificationsRequested(this, NotificationFlappingEnd, cr, "", "");
 
                Log(LogNotice, "Checkable")
                    << "Flapping: Checkable " << GetName() << " stopped flapping (" << GetFlappingThreshold() << "% >= " << GetFlappingCurrent() << "%).";
-               OnFlappingChanged(GetSelf(), FlappingStopped);
+               OnFlappingChanged(this, FlappingStopped);
        } else if (send_notification)
-               OnNotificationsRequested(GetSelf(), recovery ? NotificationRecovery : NotificationProblem, cr, "", "");
+               OnNotificationsRequested(this, recovery ? NotificationRecovery : NotificationProblem, cr, "", "");
 }
 
 bool Checkable::IsCheckPending(void) const
@@ -498,14 +498,12 @@ void Checkable::ExecuteCheck(void)
        double scheduled_start = GetNextCheck();
        double before_check = Utility::GetTime();
 
-       Checkable::Ptr self = GetSelf();
-
-       CheckResult::Ptr result = make_shared<CheckResult>();
+       CheckResult::Ptr result = new CheckResult();
 
        result->SetScheduleStart(scheduled_start);
        result->SetExecutionStart(before_check);
 
-       GetCheckCommand()->Execute(GetSelf(), result);
+       GetCheckCommand()->Execute(this, result);
 }
 
 void Checkable::UpdateStatistics(const CheckResult::Ptr& cr, CheckableType type)
index ae6497c79fb0fe6c05d554e965d18962eb2a9670..7a94a6a42ea1777deadce485af1f2c8bb440a0dc 100644 (file)
@@ -30,7 +30,7 @@ using namespace icinga;
 static int l_NextCommentID = 1;
 static boost::mutex l_CommentMutex;
 static std::map<int, String> l_LegacyCommentsCache;
-static std::map<String, Checkable::WeakPtr> l_CommentsCache;
+static std::map<String, Checkable::Ptr> l_CommentsCache;
 static Timer::Ptr l_CommentsExpireTimer;
 
 boost::signals2::signal<void (const Checkable::Ptr&, const Comment::Ptr&, const MessageOrigin&)> Checkable::OnCommentAdded;
@@ -53,7 +53,7 @@ String Checkable::AddComment(CommentType entryType, const String& author,
        else
                uid = id;
 
-       Comment::Ptr comment = make_shared<Comment>();
+       Comment::Ptr comment = new Comment();
        comment->SetId(uid);;
        comment->SetEntryTime(Utility::GetTime());
        comment->SetEntryType(entryType);
@@ -75,10 +75,10 @@ String Checkable::AddComment(CommentType entryType, const String& author,
        {
                boost::mutex::scoped_lock lock(l_CommentMutex);
                l_LegacyCommentsCache[legacy_id] = uid;
-               l_CommentsCache[uid] = GetSelf();
+               l_CommentsCache[uid] = this;
        }
 
-       OnCommentAdded(GetSelf(), comment, origin);
+       OnCommentAdded(this, comment, origin);
 
        return uid;
 }
@@ -145,7 +145,7 @@ Checkable::Ptr Checkable::GetOwnerByCommentID(const String& id)
 {
        boost::mutex::scoped_lock lock(l_CommentMutex);
 
-       return l_CommentsCache[id].lock();
+       return l_CommentsCache[id];
 }
 
 Comment::Ptr Checkable::GetCommentByID(const String& id)
@@ -184,7 +184,7 @@ void Checkable::AddCommentsToCache(void)
                        l_NextCommentID = legacy_id + 1;
 
                l_LegacyCommentsCache[legacy_id] = kv.first;
-               l_CommentsCache[kv.first] = GetSelf();
+               l_CommentsCache[kv.first] = this;
        }
 }
 
index 6bb640aff03235c56f34ae41db926f97879a3619..782c251dbced5a8754500feaaeea74dd6d395a27 100644 (file)
@@ -31,7 +31,7 @@ using namespace icinga;
 static int l_NextDowntimeID = 1;
 static boost::mutex l_DowntimeMutex;
 static std::map<int, String> l_LegacyDowntimesCache;
-static std::map<String, Checkable::WeakPtr> l_DowntimesCache;
+static std::map<String, Checkable::Ptr> l_DowntimesCache;
 static Timer::Ptr l_DowntimesExpireTimer;
 
 boost::signals2::signal<void (const Checkable::Ptr&, const Downtime::Ptr&, const MessageOrigin&)> Checkable::OnDowntimeAdded;
@@ -59,7 +59,7 @@ String Checkable::AddDowntime(const String& author, const String& comment,
        else
                uid = id;
 
-       Downtime::Ptr downtime = make_shared<Downtime>();
+       Downtime::Ptr downtime = new Downtime();
        downtime->SetId(uid);
        downtime->SetEntryTime(Utility::GetTime());
        downtime->SetAuthor(author);
@@ -101,7 +101,7 @@ String Checkable::AddDowntime(const String& author, const String& comment,
        {
                boost::mutex::scoped_lock lock(l_DowntimeMutex);
                l_LegacyDowntimesCache[legacy_id] = uid;
-               l_DowntimesCache[uid] = GetSelf();
+               l_DowntimesCache[uid] = this;
        }
 
        Log(LogNotice, "Checkable")
@@ -109,7 +109,7 @@ String Checkable::AddDowntime(const String& author, const String& comment,
            << "' between '" << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", startTime)
            << "' and '" << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", endTime) << "'.";
 
-       OnDowntimeAdded(GetSelf(), downtime, origin);
+       OnDowntimeAdded(this, downtime, origin);
 
        return uid;
 }
@@ -223,7 +223,7 @@ String Checkable::GetDowntimeIDFromLegacyID(int id)
 Checkable::Ptr Checkable::GetOwnerByDowntimeID(const String& id)
 {
        boost::mutex::scoped_lock lock(l_DowntimeMutex);
-       return l_DowntimesCache[id].lock();
+       return l_DowntimesCache[id];
 }
 
 Downtime::Ptr Checkable::GetDowntimeByID(const String& id)
@@ -243,7 +243,7 @@ Downtime::Ptr Checkable::GetDowntimeByID(const String& id)
 
 void Checkable::StartDowntimesExpiredTimer(void)
 {
-       l_DowntimesExpireTimer = make_shared<Timer>();
+       l_DowntimesExpireTimer = new Timer();
        l_DowntimesExpireTimer->SetInterval(60);
        l_DowntimesExpireTimer->OnTimerExpired.connect(boost::bind(&Checkable::DowntimesExpireTimerHandler));
        l_DowntimesExpireTimer->Start();
@@ -270,7 +270,7 @@ void Checkable::AddDowntimesToCache(void)
                        l_NextDowntimeID = legacy_id + 1;
 
                l_LegacyDowntimesCache[legacy_id] = kv.first;
-               l_DowntimesCache[kv.first] = GetSelf();
+               l_DowntimesCache[kv.first] = this;
        }
 }
 
index 8ac20823c8e960610468a9f6f951b866ed92eb32..86e450ddf4f9d1eacb50c54b469ea2010796d9bc 100644 (file)
@@ -41,7 +41,7 @@ void Checkable::SetEnableEventHandler(bool enabled, const MessageOrigin& origin)
 {
        SetOverrideEnableEventHandler(enabled);
 
-       OnEnableEventHandlerChanged(GetSelf(), enabled, origin);
+       OnEnableEventHandlerChanged(this, enabled, origin);
 }
 
 EventCommand::Ptr Checkable::GetEventCommand(void) const
@@ -60,7 +60,7 @@ void Checkable::SetEventCommand(const EventCommand::Ptr& command, const MessageO
 {
        SetOverrideEventCommand(command->GetName());
 
-       OnEventCommandChanged(GetSelf(), command, origin);
+       OnEventCommandChanged(this, command, origin);
 }
 
 void Checkable::ExecuteEventHandler(void)
@@ -78,7 +78,7 @@ void Checkable::ExecuteEventHandler(void)
        Log(LogNotice, "Checkable")
            << "Executing event handler '" << ec->GetName() << "' for service '" << GetName() << "'";
 
-       ec->Execute(GetSelf());
+       ec->Execute(this);
 
-       OnEventCommandExecuted(GetSelf());
+       OnEventCommandExecuted(this);
 }
index fe3de9364e7f2399d785fb83fd3e537f2950a609..d82c9b5c185819ad18db1fb9ebb928e22a3ba1b5 100644 (file)
@@ -46,8 +46,8 @@ void Checkable::SetEnableFlapping(bool enabled, const MessageOrigin& origin)
 {
        SetOverrideEnableFlapping(enabled);
 
-       OnFlappingChanged(GetSelf(), enabled ? FlappingEnabled : FlappingDisabled);
-       OnEnableFlappingChanged(GetSelf(), enabled, origin);
+       OnFlappingChanged(this, enabled ? FlappingEnabled : FlappingDisabled);
+       OnEnableFlappingChanged(this, enabled, origin);
 }
 
 void Checkable::UpdateFlappingStatus(bool stateChange)
index cd255d843d72818a097c92c894a6fd7acee5e0f0..84032f751fec261375fd328c54326b53298de269 100644 (file)
@@ -109,7 +109,7 @@ void Checkable::SetEnableNotifications(bool enabled, const MessageOrigin& origin
 {
        SetOverrideEnableNotifications(enabled);
 
-       OnEnableNotificationsChanged(GetSelf(), enabled, origin);
+       OnEnableNotificationsChanged(this, enabled, origin);
 }
 
 bool Checkable::GetForceNextNotification(void) const
@@ -121,5 +121,5 @@ void Checkable::SetForceNextNotification(bool forced, const MessageOrigin& origi
 {
        SetForceNextNotificationRaw(forced);
 
-       OnForceNextNotificationChanged(GetSelf(), forced, origin);
+       OnForceNextNotificationChanged(this, forced, origin);
 }
index 234d0582b99e4617a873145be66dbbff7c64abda..76a064911f9eaa422b506b641327444edf6738ff 100644 (file)
@@ -90,7 +90,7 @@ void Checkable::AddGroup(const String& name)
                return;
 
        if (!groups)
-               groups = make_shared<Array>();
+               groups = new Array();
 
        groups->Add(name);
 }
@@ -127,9 +127,9 @@ void Checkable::AcknowledgeProblem(const String& author, const String& comment,
                SetAcknowledgementExpiry(expiry);
        }
 
-       OnNotificationsRequested(GetSelf(), NotificationAcknowledgement, GetLastCheckResult(), author, comment);
+       OnNotificationsRequested(this, NotificationAcknowledgement, GetLastCheckResult(), author, comment);
 
-       OnAcknowledgementSet(GetSelf(), author, comment, type, expiry, origin);
+       OnAcknowledgementSet(this, author, comment, type, expiry, origin);
 }
 
 void Checkable::ClearAcknowledgement(const MessageOrigin& origin)
@@ -139,7 +139,7 @@ void Checkable::ClearAcknowledgement(const MessageOrigin& origin)
        SetAcknowledgementRaw(AcknowledgementNone);
        SetAcknowledgementExpiry(0);
 
-       OnAcknowledgementCleared(GetSelf(), origin);
+       OnAcknowledgementCleared(this, origin);
 }
 
 bool Checkable::GetEnablePerfdata(void) const
@@ -154,7 +154,7 @@ void Checkable::SetEnablePerfdata(bool enabled, const MessageOrigin& origin)
 {
        SetOverrideEnablePerfdata(enabled);
 
-       OnEnablePerfdataChanged(GetSelf(), enabled, origin);
+       OnEnablePerfdataChanged(this, enabled, origin);
 }
 
 int Checkable::GetModifiedAttributes(void) const
@@ -209,22 +209,22 @@ void Checkable::SetModifiedAttributes(int flags, const MessageOrigin& origin)
 {
        if ((flags & ModAttrNotificationsEnabled) == 0) {
                SetOverrideEnableNotifications(Empty);
-               OnEnableNotificationsChanged(GetSelf(), GetEnableNotifications(), origin);
+               OnEnableNotificationsChanged(this, GetEnableNotifications(), origin);
        }
 
        if ((flags & ModAttrActiveChecksEnabled) == 0) {
                SetOverrideEnableActiveChecks(Empty);
-               OnEnableActiveChecksChanged(GetSelf(), GetEnableActiveChecks(), origin);
+               OnEnableActiveChecksChanged(this, GetEnableActiveChecks(), origin);
        }
 
        if ((flags & ModAttrPassiveChecksEnabled) == 0) {
                SetOverrideEnablePassiveChecks(Empty);
-               OnEnablePassiveChecksChanged(GetSelf(), GetEnablePassiveChecks(), origin);
+               OnEnablePassiveChecksChanged(this, GetEnablePassiveChecks(), origin);
        }
 
        if ((flags & ModAttrFlapDetectionEnabled) == 0) {
                SetOverrideEnableFlapping(Empty);
-               OnEnableFlappingChanged(GetSelf(), GetEnableFlapping(), origin);
+               OnEnableFlappingChanged(this, GetEnableFlapping(), origin);
        }
 
        if ((flags & ModAttrEventHandlerEnabled) == 0)
@@ -232,7 +232,7 @@ void Checkable::SetModifiedAttributes(int flags, const MessageOrigin& origin)
 
        if ((flags & ModAttrPerformanceDataEnabled) == 0) {
                SetOverrideEnablePerfdata(Empty);
-               OnEnablePerfdataChanged(GetSelf(), GetEnablePerfdata(), origin);
+               OnEnablePerfdataChanged(this, GetEnablePerfdata(), origin);
        }
 
        if ((flags & ModAttrNormalCheckInterval) == 0)
@@ -255,6 +255,6 @@ void Checkable::SetModifiedAttributes(int flags, const MessageOrigin& origin)
 
        if ((flags & ModAttrCustomVariable) == 0) {
                SetOverrideVars(Empty);
-               OnVarsChanged(GetSelf(), GetVars(), origin);
+               OnVarsChanged(this, GetVars(), origin);
        }
 }
index cc36c4331ce64badc54d7e6a577de86b2dc3d50b..99d6c90d6baf2b2ca1f5ce40cf043fb23bb27366 100644 (file)
@@ -89,7 +89,7 @@ public:
 
        //bool IsHostCheck(void) const;
 
-       bool IsReachable(DependencyType dt = DependencyState, shared_ptr<Dependency> *failedDependency = NULL, int rstack = 0) const;
+       bool IsReachable(DependencyType dt = DependencyState, intrusive_ptr<Dependency> *failedDependency = NULL, int rstack = 0) const;
 
        AcknowledgementType GetAcknowledgement(void);
 
@@ -97,8 +97,8 @@ public:
        void ClearAcknowledgement(const MessageOrigin& origin = MessageOrigin());
 
        /* Checks */
-       shared_ptr<CheckCommand> GetCheckCommand(void) const;
-       void SetCheckCommand(const shared_ptr<CheckCommand>& command, const MessageOrigin& origin = MessageOrigin());
+       intrusive_ptr<CheckCommand> GetCheckCommand(void) const;
+       void SetCheckCommand(const intrusive_ptr<CheckCommand>& command, const MessageOrigin& origin = MessageOrigin());
 
        TimePeriod::Ptr GetCheckPeriod(void) const;
        void SetCheckPeriod(const TimePeriod::Ptr& tp, const MessageOrigin& origin = MessageOrigin());
@@ -158,8 +158,8 @@ public:
        static boost::signals2::signal<void (const Checkable::Ptr&, double, const MessageOrigin&)> OnCheckIntervalChanged;
        static boost::signals2::signal<void (const Checkable::Ptr&, double, const MessageOrigin&)> OnRetryIntervalChanged;
        static boost::signals2::signal<void (const Checkable::Ptr&, int, const MessageOrigin&)> OnMaxCheckAttemptsChanged;
-       static boost::signals2::signal<void (const Checkable::Ptr&, const shared_ptr<EventCommand>&, const MessageOrigin&)> OnEventCommandChanged;
-       static boost::signals2::signal<void (const Checkable::Ptr&, const shared_ptr<CheckCommand>&, const MessageOrigin&)> OnCheckCommandChanged;
+       static boost::signals2::signal<void (const Checkable::Ptr&, const intrusive_ptr<EventCommand>&, const MessageOrigin&)> OnEventCommandChanged;
+       static boost::signals2::signal<void (const Checkable::Ptr&, const intrusive_ptr<CheckCommand>&, const MessageOrigin&)> OnCheckCommandChanged;
        static boost::signals2::signal<void (const Checkable::Ptr&, const TimePeriod::Ptr&, const MessageOrigin&)> OnCheckPeriodChanged;
 
        static boost::signals2::signal<void (const Checkable::Ptr&, const CheckResult::Ptr&, const MessageOrigin&)> OnNewCheckResult;
@@ -243,8 +243,8 @@ public:
        /* Event Handler */
        void ExecuteEventHandler(void);
 
-       shared_ptr<EventCommand> GetEventCommand(void) const;
-       void SetEventCommand(const shared_ptr<EventCommand>& command, const MessageOrigin& origin = MessageOrigin());
+       intrusive_ptr<EventCommand> GetEventCommand(void) const;
+       void SetEventCommand(const intrusive_ptr<EventCommand>& command, const MessageOrigin& origin = MessageOrigin());
 
        bool GetEnableEventHandler(void) const;
        void SetEnableEventHandler(bool enabled, const MessageOrigin& origin = MessageOrigin());
@@ -263,13 +263,13 @@ public:
        void SetEnablePerfdata(bool enabled, const MessageOrigin& origin = MessageOrigin());
 
        /* Dependencies */
-       void AddDependency(const shared_ptr<Dependency>& dep);
-       void RemoveDependency(const shared_ptr<Dependency>& dep);
-       std::set<shared_ptr<Dependency> > GetDependencies(void) const;
+       void AddDependency(const intrusive_ptr<Dependency>& dep);
+       void RemoveDependency(const intrusive_ptr<Dependency>& dep);
+       std::set<intrusive_ptr<Dependency> > GetDependencies(void) const;
 
-       void AddReverseDependency(const shared_ptr<Dependency>& dep);
-       void RemoveReverseDependency(const shared_ptr<Dependency>& dep);
-       std::set<shared_ptr<Dependency> > GetReverseDependencies(void) const;
+       void AddReverseDependency(const intrusive_ptr<Dependency>& dep);
+       void RemoveReverseDependency(const intrusive_ptr<Dependency>& dep);
+       std::set<intrusive_ptr<Dependency> > GetReverseDependencies(void) const;
 
 protected:
        virtual void Start(void);
@@ -297,10 +297,12 @@ private:
 
        /* Dependencies */
        mutable boost::mutex m_DependencyMutex;
-       std::set<shared_ptr<Dependency> > m_Dependencies;
-       std::set<shared_ptr<Dependency> > m_ReverseDependencies;
+       std::set<intrusive_ptr<Dependency> > m_Dependencies;
+       std::set<intrusive_ptr<Dependency> > m_ReverseDependencies;
 };
 
 }
 
 #endif /* CHECKABLE_H */
+
+#include "icinga/dependency.hpp"
index feee1f43d820d276192657c6448ad8e97b3b33e7..65d420094201917edec5968dbba0e748fd7d7aed 100644 (file)
@@ -41,7 +41,7 @@ enum AcknowledgementType
 abstract class Checkable : CustomVarObject
 {
        [config] Array::Ptr groups {
-               default {{{ return make_shared<Array>(); }}}
+               default {{{ return new Array(); }}}
        };
        [config, protected] String check_command (CheckCommandRaw);
        [config] int max_check_attempts (MaxCheckAttemptsRaw) {
@@ -125,10 +125,10 @@ abstract class Checkable : CustomVarObject
        };
        [state] double acknowledgement_expiry;
        [state] Dictionary::Ptr comments {
-               default {{{ return make_shared<Dictionary>(); }}}
+               default {{{ return new Dictionary(); }}}
        };
        [state] Dictionary::Ptr downtimes {
-               default {{{ return make_shared<Dictionary>(); }}}
+               default {{{ return new Dictionary(); }}}
        };
        [state] bool force_next_notification (ForceNextNotificationRaw);
        [state] int flapping_positive;
index 245734a1d072571ab2601d291b3a344844f51582..38e1530b741fd1f6da059228d6e29069694fa2da 100644 (file)
@@ -240,8 +240,8 @@ HostStatistics CIB::CalculateHostStats(void)
  */
 std::pair<Dictionary::Ptr, Array::Ptr> CIB::GetFeatureStats(void)
 {
-       Dictionary::Ptr status = make_shared<Dictionary>();
-       Array::Ptr perfdata = make_shared<Array>();
+       Dictionary::Ptr status = new Dictionary();
+       Array::Ptr perfdata = new Array();
 
        String name;
        Value ret;
index ab0c72c48b456571eca56fdc541d4607b4184144..4056c90377ac2c745abb563bb5d96c79843f3a93 100644 (file)
@@ -40,7 +40,7 @@ void Command::SetModifiedAttributes(int flags, const MessageOrigin& origin)
 {
        if ((flags & ModAttrCustomVariable) == 0) {
                SetOverrideVars(Empty);
-               OnVarsChanged(GetSelf(), GetVars(), origin);
+               OnVarsChanged(this, GetVars(), origin);
        }
 }
 
index 19a951dd70f8756396f4154d096c435d48a41844..4e8ccd29bd638024a153f799e4ad2a9fa61d75c3 100644 (file)
@@ -115,7 +115,7 @@ String CompatUtility::GetCheckableCommandArgs(const Checkable::Ptr& checkable)
 {
        CheckCommand::Ptr command = checkable->GetCheckCommand();
 
-       Dictionary::Ptr args = make_shared<Dictionary>();
+       Dictionary::Ptr args = new Dictionary();
 
        if (command) {
                Host::Ptr host;
@@ -387,7 +387,7 @@ Dictionary::Ptr CompatUtility::GetCustomAttributeConfig(const CustomVarObject::P
 {
        Dictionary::Ptr vars = object->GetVars();
 
-       Dictionary::Ptr varsvars = make_shared<Dictionary>();
+       Dictionary::Ptr varsvars = new Dictionary();
 
        if (!vars)
                return Dictionary::Ptr();
@@ -418,7 +418,7 @@ String CompatUtility::GetCustomAttributeConfig(const CustomVarObject::Ptr& objec
 
 Array::Ptr CompatUtility::GetModifiedAttributesList(const CustomVarObject::Ptr& object)
 {
-       Array::Ptr mod_attr_list = make_shared<Array>();
+       Array::Ptr mod_attr_list = new Array();
 
        if (object->GetType() != DynamicType::GetByName("Host") &&
            object->GetType() != DynamicType::GetByName("Service") &&
index 8687af256f0a340c5cf5da01ec221779a06da526..9b0424a74a84e80190ae4d3622ce4d187ab245b7 100644 (file)
@@ -38,7 +38,7 @@ void CustomVarObject::SetVars(const Dictionary::Ptr& vars, const MessageOrigin&
 {
        SetOverrideVars(vars);
 
-       OnVarsChanged(GetSelf(), vars, origin);
+       OnVarsChanged(this, vars, origin);
 }
 
 int CustomVarObject::GetModifiedAttributes(void) const
index 097f64ebf94af0c21926fe33959d93c70ad1114f..ed5756afc358cc79f6e90561d6a7949117e4362d 100644 (file)
@@ -49,7 +49,7 @@ void Dependency::EvaluateApplyRuleOneInstance(const Checkable::Ptr& checkable, c
        Log(LogDebug, "Dependency")
                << "Applying dependency '" << name << "' to object '" << checkable->GetName() << "' for rule " << di;
 
-       ConfigItemBuilder::Ptr builder = make_shared<ConfigItemBuilder>(di);
+       ConfigItemBuilder::Ptr builder = new ConfigItemBuilder(di);
        builder->SetType("Dependency");
        builder->SetName(name);
        builder->SetScope(locals);
@@ -58,18 +58,18 @@ void Dependency::EvaluateApplyRuleOneInstance(const Checkable::Ptr& checkable, c
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+       builder->AddExpression(new Expression(&Expression::OpSet,
            MakeArray(MakeArray(MakeLiteral("parent_host_name")), OpSetLiteral),
            MakeLiteral(host->GetName()),
            di));
 
-       builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+       builder->AddExpression(new Expression(&Expression::OpSet,
            MakeArray(MakeArray(MakeLiteral("child_host_name")), OpSetLiteral),
            MakeLiteral(host->GetName()),
            di));
 
        if (service) {
-               builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+               builder->AddExpression(new Expression(&Expression::OpSet,
                    MakeArray(MakeArray(MakeLiteral("child_service_name")), OpSetLiteral),
                    MakeLiteral(service->GetShortName()),
                    di));
@@ -78,7 +78,7 @@ void Dependency::EvaluateApplyRuleOneInstance(const Checkable::Ptr& checkable, c
        String zone = checkable->GetZone();
 
        if (!zone.IsEmpty()) {
-               builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+               builder->AddExpression(new Expression(&Expression::OpSet,
                    MakeArray(MakeArray(MakeLiteral("zone")), OpSetLiteral),
                    MakeLiteral(zone),
                    di));
@@ -104,7 +104,7 @@ bool Dependency::EvaluateApplyRuleOne(const Checkable::Ptr& checkable, const App
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr locals = make_shared<Dictionary>();
+       Dictionary::Ptr locals = new Dictionary();
        locals->Set("__parent", rule.GetScope());
        locals->Set("host", host);
        if (service)
@@ -118,7 +118,7 @@ bool Dependency::EvaluateApplyRuleOne(const Checkable::Ptr& checkable, const App
        if (rule.GetFTerm()) {
                vinstances = rule.GetFTerm()->Evaluate(locals);
        } else {
-               Array::Ptr instances = make_shared<Array>();
+               Array::Ptr instances = new Array();
                instances->Add("");
                vinstances = instances;
        }
index 842d7ec526a14d4107a3377c3f4a39925fa612ab..55fbcc9d56ff8a1b8b83f4ec424d992b5df49ff7 100644 (file)
@@ -82,7 +82,7 @@ void Dependency::OnStateLoaded(void)
                Log(LogWarning, "Dependency")
                    << "Dependency '" << GetName() << "' references an invalid child object and will be ignored.";
        else
-               m_Child->AddDependency(GetSelf());
+               m_Child->AddDependency(this);
 
        Host::Ptr parentHost = Host::GetByName(GetParentHostName());
 
@@ -102,7 +102,7 @@ void Dependency::OnStateLoaded(void)
                Log(LogWarning, "Dependency")
                    << "Dependency '" << GetName() << "' references an invalid parent object and will always fail.";
        else
-               m_Parent->AddReverseDependency(GetSelf());
+               m_Parent->AddReverseDependency(this);
 }
 
 void Dependency::Stop(void)
@@ -110,10 +110,10 @@ void Dependency::Stop(void)
        DynamicObject::Stop();
 
        if (GetChild())
-               GetChild()->RemoveDependency(GetSelf());
+               GetChild()->RemoveDependency(this);
 
        if (GetParent())
-               GetParent()->RemoveReverseDependency(GetSelf());
+               GetParent()->RemoveReverseDependency(this);
 }
 
 bool Dependency::IsAvailable(DependencyType dt) const
index d9c22e64aaad25904cdfe358ee5c827f07d1c7f7..b35b2b07b72ca7963f76a33547d53f319bbbdf48 100644 (file)
@@ -40,8 +40,8 @@ public:
        DECLARE_OBJECT(Dependency);
        DECLARE_OBJECTNAME(Dependency);
 
-       shared_ptr<Checkable> GetParent(void) const;
-       shared_ptr<Checkable> GetChild(void) const;
+       intrusive_ptr<Checkable> GetParent(void) const;
+       intrusive_ptr<Checkable> GetChild(void) const;
 
        TimePeriod::Ptr GetPeriod(void) const;
 
index 5f18cee0eb2d195970491bdea98e9c0bf4779e90..66b07b29c65047eff10e1e1b32a1911482fa1311 100644 (file)
@@ -35,7 +35,7 @@ class Downtime
        [state] String triggered_by;
        [state] String scheduled_by;
        [state] Dictionary::Ptr triggers {
-               default {{{ return make_shared<Dictionary>(); }}}
+               default {{{ return new Dictionary(); }}}
        };
        [state] int legacy_id;
        [state] bool was_cancelled;
index 06b5acebe5003ce5d48128e2389bd21b0e53c892..5a6460d1783786dd06f7c1e65615aa4da673a775 100644 (file)
@@ -91,7 +91,7 @@ static void RegisterCommand(const String& command, const ExternalCommandCallback
        eci.MaxArgs = (maxArgs == UINT_MAX) ? minArgs : maxArgs;
        GetCommands()[command] = eci;
 
-       ApiFunction::Ptr afunc = make_shared<ApiFunction>(boost::bind(&ExternalCommandAPIWrapper, command, _2));
+       ApiFunction::Ptr afunc = new ApiFunction(boost::bind(&ExternalCommandAPIWrapper, command, _2));
        ApiFunction::Register("extcmd::" + command, afunc);
 }
 
@@ -303,7 +303,7 @@ void ExternalCommandProcessor::ProcessHostCheckResult(double time, const std::ve
                BOOST_THROW_EXCEPTION(std::invalid_argument("Got passive check result for host '" + arguments[0] + "' which has passive checks disabled."));
 
        int exitStatus = Convert::ToDouble(arguments[1]);
-       CheckResult::Ptr result = make_shared<CheckResult>();
+       CheckResult::Ptr result = new CheckResult();
        std::pair<String, String> co = PluginUtility::ParseCheckOutput(arguments[2]);
        result->SetOutput(co.first);
        result->SetPerformanceData(PluginUtility::SplitPerfdata(co.second));
@@ -351,7 +351,7 @@ void ExternalCommandProcessor::ProcessServiceCheckResult(double time, const std:
                BOOST_THROW_EXCEPTION(std::invalid_argument("Got passive check result for service '" + arguments[1] + "' which has passive checks disabled."));
 
        int exitStatus = Convert::ToDouble(arguments[2]);
-       CheckResult::Ptr result = make_shared<CheckResult>();
+       CheckResult::Ptr result = new CheckResult();
        std::pair<String, String> co = PluginUtility::ParseCheckOutput(arguments[3]);
        result->SetOutput(co.first);
        result->SetPerformanceData(PluginUtility::SplitPerfdata(co.second));
index 8e39405199f435a62084c9a8219e770f01c20eab..84a61a6b5f75c01ccd9a31fdc1df8da04c551e36 100644 (file)
@@ -49,7 +49,7 @@ void Host::OnConfigLoaded(void)
                        HostGroup::Ptr hg = HostGroup::GetByName(name);
 
                        if (hg)
-                               hg->ResolveGroupMembership(GetSelf(), true);
+                               hg->ResolveGroupMembership(this, true);
                }
        }
 }
@@ -67,7 +67,7 @@ void Host::Stop(void)
                        HostGroup::Ptr hg = HostGroup::GetByName(name);
 
                        if (hg)
-                               hg->ResolveGroupMembership(GetSelf(), false);
+                               hg->ResolveGroupMembership(this, false);
                }
        }
 
index 1754debe6f60bf97a9d0f2ecf931edee79841149..82800dfafb9ca66198ec5f8d80b07be923537e15 100644 (file)
@@ -41,11 +41,11 @@ public:
        DECLARE_OBJECT(Host);
        DECLARE_OBJECTNAME(Host);
 
-       shared_ptr<Service> GetServiceByShortName(const Value& name);
+       intrusive_ptr<Service> GetServiceByShortName(const Value& name);
 
-       std::set<shared_ptr<Service> > GetServices(void) const;
-       void AddService(const shared_ptr<Service>& service);
-       void RemoveService(const shared_ptr<Service>& service);
+       std::set<intrusive_ptr<Service> > GetServices(void) const;
+       void AddService(const intrusive_ptr<Service>& service);
+       void RemoveService(const intrusive_ptr<Service>& service);
 
        int GetTotalServices(void) const;
 
@@ -72,7 +72,7 @@ protected:
 
 private:
        mutable boost::mutex m_ServicesMutex;
-       std::map<String, shared_ptr<Service> > m_Services;
+       std::map<String, intrusive_ptr<Service> > m_Services;
 
        static void RefreshServicesCache(void);
 };
@@ -80,3 +80,5 @@ private:
 }
 
 #endif /* HOST_H */
+
+#include "icinga/service.hpp"
index 312378df61bc63a299ae988392e2327a0497c06d..05c63275a8ff85e38d78bccacab35e06626a8149 100644 (file)
@@ -45,7 +45,7 @@ bool HostGroup::EvaluateObjectRuleOne(const Host::Ptr& host, const ObjectRule& r
        msgbuf << "Evaluating 'object' rule (" << di << ")";
        CONTEXT(msgbuf.str());
 
-       Dictionary::Ptr locals = make_shared<Dictionary>();
+       Dictionary::Ptr locals = new Dictionary();
        locals->Set("__parent", rule.GetScope());
        locals->Set("host", host);
 
index 6ecb1e14625ad41ed5da5ce663b319fc1915bb55..b52404d92474ad0520f7a7b2fe5a97261c81ccf3 100644 (file)
@@ -65,10 +65,10 @@ REGISTER_STATSFUNCTION(IcingaApplicationStats, &IcingaApplication::StatsFunc);
 
 Value IcingaApplication::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const IcingaApplication::Ptr& icingaapplication, DynamicType::GetObjectsByType<IcingaApplication>()) {
-               Dictionary::Ptr stats = make_shared<Dictionary>();
+               Dictionary::Ptr stats = new Dictionary();
                stats->Set("node_name", icingaapplication->GetNodeName());
                stats->Set("enable_notifications", icingaapplication->GetEnableNotifications());
                stats->Set("enable_event_handlers", icingaapplication->GetEnableEventHandlers());
@@ -98,7 +98,7 @@ int IcingaApplication::Main(void)
        Log(LogDebug, "IcingaApplication", "In IcingaApplication::Main()");
 
        /* periodically dump the program state */
-       l_RetentionTimer = make_shared<Timer>();
+       l_RetentionTimer = new Timer();
        l_RetentionTimer->SetInterval(300);
        l_RetentionTimer->OnTimerExpired.connect(boost::bind(&IcingaApplication::DumpProgramState, this));
        l_RetentionTimer->Start();
index 9f10b7d792a06a82696b73515d49f9f5d0016a98..0c1d0d0acee23773049bc7d9d2fd62d96d1e3075 100644 (file)
@@ -37,7 +37,7 @@ REGISTER_STATSFUNCTION(IcingaStatusWriterStats, &IcingaStatusWriter::StatsFunc);
 
 Value IcingaStatusWriter::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const IcingaStatusWriter::Ptr& icingastatuswriter, DynamicType::GetObjectsByType<IcingaStatusWriter>()) {
                nodes->Set(icingastatuswriter->GetName(), 1); //add more stats
@@ -61,7 +61,7 @@ void IcingaStatusWriter::Start(void)
 {
        DynamicObject::Start();
 
-       m_StatusTimer = make_shared<Timer>();
+       m_StatusTimer = new Timer();
        m_StatusTimer->SetInterval(GetUpdateInterval());
        m_StatusTimer->OnTimerExpired.connect(boost::bind(&IcingaStatusWriter::StatusTimerHandler, this));
        m_StatusTimer->Start();
@@ -70,7 +70,7 @@ void IcingaStatusWriter::Start(void)
 
 Dictionary::Ptr IcingaStatusWriter::GetStatusData(void)
 {
-       Dictionary::Ptr bag = make_shared<Dictionary>();
+       Dictionary::Ptr bag = new Dictionary();
 
        /* features */
        std::pair<Dictionary::Ptr, Array::Ptr> stats = CIB::GetFeatureStats();
@@ -79,7 +79,7 @@ Dictionary::Ptr IcingaStatusWriter::GetStatusData(void)
        bag->Set("feature_perfdata", stats.second);
 
        /* icinga stats */
-       Dictionary::Ptr icinga_stats = make_shared<Dictionary>();
+       Dictionary::Ptr icinga_stats = new Dictionary();
 
        double interval = Utility::GetTime() - Application::GetStartTime();
 
index edacace8719c2b18d5886de6e8ca6e1888c2a484..d8a6f0f564c03769df30e1c835191e203d85e6e0 100644 (file)
@@ -365,7 +365,7 @@ Dictionary::Ptr LegacyTimePeriod::ProcessTimeRange(const String& timestamp, tm *
 {
        tm begin, end;
        ProcessTimeRangeRaw(timestamp, reference, &begin, &end);
-       Dictionary::Ptr segment = make_shared<Dictionary>();
+       Dictionary::Ptr segment = new Dictionary();
        segment->Set("begin", (long)mktime(&begin));
        segment->Set("end", (long)mktime(&end));
        return segment;
@@ -407,7 +407,7 @@ Dictionary::Ptr LegacyTimePeriod::FindNextSegment(const String& daydef, const St
 
                do {
                        if (IsInTimeRange(&begin, &end, stride, &iter)) {
-                               Array::Ptr segments = make_shared<Array>();
+                               Array::Ptr segments = new Array();
                                ProcessTimeRanges(timeranges, &iter, segments);
 
                                Dictionary::Ptr bestSegment;
@@ -443,7 +443,7 @@ Dictionary::Ptr LegacyTimePeriod::FindNextSegment(const String& daydef, const St
 
 Array::Ptr LegacyTimePeriod::ScriptFunc(const TimePeriod::Ptr& tp, double begin, double end)
 {
-       Array::Ptr segments = make_shared<Array>();
+       Array::Ptr segments = new Array();
 
        Dictionary::Ptr ranges = tp->GetRanges();
 
index 8d0be46d8495ad6d62937dec444dd35b5ff3f43c..05ce4a4294cd8f3d032d55c300ef2ea1484a3a5d 100644 (file)
@@ -44,7 +44,7 @@ Value MacroProcessor::ResolveMacros(const Value& str, const ResolverList& resolv
        if (str.IsScalar()) {
                result = InternalResolveMacros(str, resolvers, cr, missingMacro, escapeFn);
        } else if (str.IsObjectType<Array>()) {
-               Array::Ptr resultArr = make_shared<Array>();
+               Array::Ptr resultArr = new Array();
                Array::Ptr arr = str;
 
                ObjectLock olock(arr);
@@ -101,7 +101,7 @@ bool MacroProcessor::ResolveMacro(const String& macro, const ResolverList& resol
                        }
                }
 
-               MacroResolver::Ptr mresolver = dynamic_pointer_cast<MacroResolver>(resolver.second);
+               MacroResolver *mresolver = dynamic_cast<MacroResolver *>(resolver.second.get());
 
                if (mresolver && mresolver->ResolveMacro(boost::algorithm::join(tokens, "."), cr, result))
                        return true;
index f9765c10b33c6dd2a6f09ff8cf81daea79fd64a7..f9f299486dd7d02018204226342b0b35f4f0b5cd 100644 (file)
@@ -49,7 +49,7 @@ void Notification::EvaluateApplyRuleOneInstance(const Checkable::Ptr& checkable,
        Log(LogDebug, "Notification")
            << "Applying notification '" << name << "' to object '" << checkable->GetName() << "' for rule " << di;
 
-       ConfigItemBuilder::Ptr builder = make_shared<ConfigItemBuilder>(di);
+       ConfigItemBuilder::Ptr builder = new ConfigItemBuilder(di);
        builder->SetType("Notification");
        builder->SetName(name);
        builder->SetScope(locals);
@@ -58,13 +58,13 @@ void Notification::EvaluateApplyRuleOneInstance(const Checkable::Ptr& checkable,
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+       builder->AddExpression(new Expression(&Expression::OpSet,
            MakeArray(MakeArray(MakeLiteral("host_name")), OpSetLiteral),
            MakeLiteral(host->GetName()),
            di));
 
        if (service) {
-               builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+               builder->AddExpression(new Expression(&Expression::OpSet,
                    MakeArray(MakeArray(MakeLiteral("service_name")), OpSetLiteral),
                    MakeLiteral(service->GetShortName()),
                    di));
@@ -73,7 +73,7 @@ void Notification::EvaluateApplyRuleOneInstance(const Checkable::Ptr& checkable,
        String zone = checkable->GetZone();
 
        if (!zone.IsEmpty()) {
-               builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+               builder->AddExpression(new Expression(&Expression::OpSet,
                    MakeArray(MakeArray(MakeLiteral("zone")), OpSetLiteral),
                    MakeLiteral(zone),
                    di));
@@ -99,7 +99,7 @@ bool Notification::EvaluateApplyRuleOne(const Checkable::Ptr& checkable, const A
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr locals = make_shared<Dictionary>();
+       Dictionary::Ptr locals = new Dictionary();
        locals->Set("__parent", rule.GetScope());
        locals->Set("host", host);
        if (service)
@@ -113,7 +113,7 @@ bool Notification::EvaluateApplyRuleOne(const Checkable::Ptr& checkable, const A
        if (rule.GetFTerm()) {
                vinstances = rule.GetFTerm()->Evaluate(locals);
        } else {
-               Array::Ptr instances = make_shared<Array>();
+               Array::Ptr instances = new Array();
                instances->Add("");
                vinstances = instances;
        }
index eefe413d0cbc08aabfce227d6a13bf47440a19b3..350a3deae9accde288ba650462172118f5f64921 100644 (file)
@@ -84,7 +84,7 @@ void Notification::OnConfigLoaded(void)
        Checkable::Ptr obj = GetCheckable();
 
        if (obj)
-               obj->AddNotification(GetSelf());
+               obj->AddNotification(this);
 }
 
 void Notification::Start(void)
@@ -94,7 +94,7 @@ void Notification::Start(void)
        Checkable::Ptr obj = GetCheckable();
 
        if (obj)
-               obj->AddNotification(GetSelf());
+               obj->AddNotification(this);
 }
 
 void Notification::Stop(void)
@@ -104,7 +104,7 @@ void Notification::Stop(void)
        Checkable::Ptr obj = GetCheckable();
 
        if (obj)
-               obj->RemoveNotification(GetSelf());
+               obj->RemoveNotification(this);
 }
 
 Checkable::Ptr Notification::GetCheckable(void) const
@@ -184,7 +184,7 @@ void Notification::SetNextNotification(double time, const MessageOrigin& origin)
 {
        SetNextNotificationRaw(time);
 
-       OnNextNotificationChanged(GetSelf(), time, origin);
+       OnNextNotificationChanged(this, time, origin);
 }
 
 void Notification::UpdateNotificationNumber(void)
@@ -304,7 +304,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
                std::copy(members.begin(), members.end(), std::inserter(allUsers, allUsers.begin()));
        }
 
-       Service::OnNotificationSendStart(GetSelf(), checkable, allUsers, type, cr, author, text);
+       Service::OnNotificationSendStart(this, checkable, allUsers, type, cr, author, text);
 
        std::set<User::Ptr> allNotifiedUsers;
        BOOST_FOREACH(const User::Ptr& user, allUsers) {
@@ -321,7 +321,7 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
        }
 
        /* used in db_ido for notification history */
-       Service::OnNotificationSentToAllUsers(GetSelf(), checkable, allNotifiedUsers, type, cr, author, text);
+       Service::OnNotificationSentToAllUsers(this, checkable, allNotifiedUsers, type, cr, author, text);
 }
 
 bool Notification::CheckNotificationUserFilters(NotificationType type, const User::Ptr& user, bool force)
@@ -383,7 +383,7 @@ void Notification::ExecuteNotificationHelper(NotificationType type, const User::
                        return;
                }
 
-               command->Execute(GetSelf(), user, cr, type, author, text);
+               command->Execute(this, user, cr, type, author, text);
 
                {
                        ObjectLock olock(this);
@@ -392,7 +392,7 @@ void Notification::ExecuteNotificationHelper(NotificationType type, const User::
                }
 
                /* required by compatlogger */
-               Service::OnNotificationSentToUser(GetSelf(), GetCheckable(), user, type, cr, author, text, command->GetName());
+               Service::OnNotificationSentToUser(this, GetCheckable(), user, type, cr, author, text, command->GetName());
 
                Log(LogInformation, "Notification")
                    << "Completed sending notification for object '" << GetCheckable()->GetName() << "'";
index ab3230b27f1aaa58caa8bc1b60a9a764a4a4e582..9d596cfb9fc54796f750d51cb77819c369055796 100644 (file)
@@ -81,8 +81,8 @@ public:
 
        static void StaticInitialize(void);
 
-       shared_ptr<Checkable> GetCheckable(void) const;
-       shared_ptr<NotificationCommand> GetCommand(void) const;
+       intrusive_ptr<Checkable> GetCheckable(void) const;
+       intrusive_ptr<NotificationCommand> GetCommand(void) const;
        TimePeriod::Ptr GetPeriod(void) const;
        std::set<User::Ptr> GetUsers(void) const;
        std::set<UserGroup::Ptr> GetUserGroups(void) const;
@@ -113,8 +113,8 @@ protected:
 private:
        void ExecuteNotificationHelper(NotificationType type, const User::Ptr& user, const CheckResult::Ptr& cr, bool force, const String& author = "", const String& text = "");
 
-       static void EvaluateApplyRuleOneInstance(const shared_ptr<Checkable>& checkable, const String& name, const Dictionary::Ptr& locals, const ApplyRule& rule);
-       static bool EvaluateApplyRuleOne(const shared_ptr<Checkable>& checkable, const ApplyRule& rule);
+       static void EvaluateApplyRuleOneInstance(const intrusive_ptr<Checkable>& checkable, const String& name, const Dictionary::Ptr& locals, const ApplyRule& rule);
+       static bool EvaluateApplyRuleOne(const intrusive_ptr<Checkable>& checkable, const ApplyRule& rule);
        static void EvaluateApplyRule(const ApplyRule& rule);
        static void EvaluateApplyRules(const std::vector<ApplyRule>& rules);
 };
index 2ab58e6518e347ce68923cd38aa4f479f882d4a8..be8d069ff2965063afc95fba2d508d7f3478275f 100644 (file)
@@ -39,7 +39,7 @@ public:
        DECLARE_OBJECT(NotificationCommand);
        DECLARE_OBJECTNAME(NotificationCommand);
 
-       virtual Dictionary::Ptr Execute(const shared_ptr<Notification>& notification,
+       virtual Dictionary::Ptr Execute(const intrusive_ptr<Notification>& notification,
                const User::Ptr& user, const CheckResult::Ptr& cr, const NotificationType& type,
            const String& author, const String& comment);
 };
index 4a0f3d601563671fceccf61973e7129bf46a0a5f..5a198720b7ddab60123f8d3b76c4d27333f98bc4 100644 (file)
@@ -139,7 +139,7 @@ PerfdataValue::Ptr PerfdataValue::Parse(const String& perfdata)
        if (!max.IsEmpty())
                max = max * base;
 
-       return make_shared<PerfdataValue>(label, value, counter, unit, warn, crit, min, max);
+       return new PerfdataValue(label, value, counter, unit, warn, crit, min, max);
 }
 
 String PerfdataValue::Format(void) const
index 55e9f028ac288237e66b6b2971cd8a842c12ed6e..87f95cb48ce10bff8a4e23f23db2d23da07a5d5d 100644 (file)
@@ -61,7 +61,7 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab
        if (!raw_arguments || raw_command.IsObjectType<Array>())
                command = MacroProcessor::ResolveMacros(raw_command, macroResolvers, cr, NULL, Utility::EscapeShellArg);
        else {
-               Array::Ptr arr = make_shared<Array>();
+               Array::Ptr arr = new Array();
                arr->Add(raw_command);
                command = arr;
        }
@@ -156,7 +156,7 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab
                }
        }
 
-       Dictionary::Ptr envMacros = make_shared<Dictionary>();
+       Dictionary::Ptr envMacros = new Dictionary();
 
        Dictionary::Ptr env = commandObj->GetEnv();
 
@@ -171,7 +171,7 @@ void PluginUtility::ExecuteCommand(const Command::Ptr& commandObj, const Checkab
                }
        }
 
-       Process::Ptr process = make_shared<Process>(Process::PrepareCommand(command), envMacros);
+       Process::Ptr process = new Process(Process::PrepareCommand(command), envMacros);
        process->SetTimeout(commandObj->GetTimeout());
        process->Run(boost::bind(callback, command, _1));
 }
@@ -223,7 +223,7 @@ std::pair<String, String> PluginUtility::ParseCheckOutput(const String& output)
 
 Array::Ptr PluginUtility::SplitPerfdata(const String& perfdata)
 {
-       Array::Ptr result = make_shared<Array>();
+       Array::Ptr result = new Array();
 
        size_t begin = 0;
        String multi_prefix;
index 63fa43b409a81404ad6959d3202414a61ad52a8f..8b830f4012c05a0ea51089e87a95019783112a89 100644 (file)
@@ -48,7 +48,7 @@ void ScheduledDowntime::EvaluateApplyRuleOneInstance(const Checkable::Ptr& check
        Log(LogDebug, "ScheduledDowntime")
                << "Applying scheduled downtime '" << rule.GetName() << "' to object '" << checkable->GetName() << "' for rule " << di;
 
-       ConfigItemBuilder::Ptr builder = make_shared<ConfigItemBuilder>(di);
+       ConfigItemBuilder::Ptr builder = new ConfigItemBuilder(di);
        builder->SetType("ScheduledDowntime");
        builder->SetName(name);
        builder->SetScope(locals);
@@ -57,13 +57,13 @@ void ScheduledDowntime::EvaluateApplyRuleOneInstance(const Checkable::Ptr& check
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+       builder->AddExpression(new Expression(&Expression::OpSet,
            MakeArray(MakeArray(MakeLiteral("host_name")), OpSetLiteral),
            MakeLiteral(host->GetName()),
            di));
 
        if (service) {
-               builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+               builder->AddExpression(new Expression(&Expression::OpSet,
                    MakeArray(MakeArray(MakeLiteral("service_name")), OpSetLiteral),
                    MakeLiteral(service->GetShortName()),
                    di));
@@ -72,7 +72,7 @@ void ScheduledDowntime::EvaluateApplyRuleOneInstance(const Checkable::Ptr& check
        String zone = checkable->GetZone();
 
        if (!zone.IsEmpty()) {
-               builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+               builder->AddExpression(new Expression(&Expression::OpSet,
                    MakeArray(MakeArray(MakeLiteral("zone")), OpSetLiteral),
                    MakeLiteral(zone),
                    di));
@@ -97,7 +97,7 @@ bool ScheduledDowntime::EvaluateApplyRuleOne(const Checkable::Ptr& checkable, co
        Service::Ptr service;
        tie(host, service) = GetHostService(checkable);
 
-       Dictionary::Ptr locals = make_shared<Dictionary>();
+       Dictionary::Ptr locals = new Dictionary();
        locals->Set("__parent", rule.GetScope());
        locals->Set("host", host);
        if (service)
@@ -111,7 +111,7 @@ bool ScheduledDowntime::EvaluateApplyRuleOne(const Checkable::Ptr& checkable, co
        if (rule.GetFTerm()) {
                vinstances = rule.GetFTerm()->Evaluate(locals);
        } else {
-               Array::Ptr instances = make_shared<Array>();
+               Array::Ptr instances = new Array();
                instances->Add("");
                vinstances = instances;
        }
index b9af506c97dd7803811df0aaabcba46d2222d847..544f31fb51169f05f12fac4878cfa6697ecaddb0 100644 (file)
@@ -58,7 +58,7 @@ String ScheduledDowntimeNameComposer::MakeName(const String& shortName, const Ob
 
 void ScheduledDowntime::StaticInitialize(void)
 {
-       l_Timer = make_shared<Timer>();
+       l_Timer = new Timer();
        l_Timer->SetInterval(60);
        l_Timer->OnTimerExpired.connect(boost::bind(&ScheduledDowntime::TimerProc));
        l_Timer->Start();
@@ -98,7 +98,7 @@ std::pair<double, double> ScheduledDowntime::FindNextSegment(void)
 
        Dictionary::Ptr ranges = GetRanges();
 
-       Array::Ptr segments = make_shared<Array>();
+       Array::Ptr segments = new Array();
 
        Dictionary::Ptr bestSegment;
        double bestBegin;
index de9027a24d6fc33e2891833067e78fcdf0b9e19e..83543261fc59c30e206746866de0ae77af4963dc 100644 (file)
@@ -47,17 +47,17 @@ void Service::EvaluateApplyRuleOneInstance(const Host::Ptr& host, const String&
        Log(LogDebug, "Service")
            << "Applying service '" << name << "' to host '" << host->GetName() << "' for rule " << di;
 
-       ConfigItemBuilder::Ptr builder = make_shared<ConfigItemBuilder>(di);
+       ConfigItemBuilder::Ptr builder = new ConfigItemBuilder(di);
        builder->SetType("Service");
        builder->SetName(name);
        builder->SetScope(locals);
 
-       builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+       builder->AddExpression(new Expression(&Expression::OpSet,
            MakeArray(MakeArray(MakeLiteral("host_name")), OpSetLiteral),
            MakeLiteral(host->GetName()),
            di));
 
-       builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+       builder->AddExpression(new Expression(&Expression::OpSet,
            MakeArray(MakeArray(MakeLiteral("name")), OpSetLiteral),
            MakeLiteral(name),
            di));
@@ -65,7 +65,7 @@ void Service::EvaluateApplyRuleOneInstance(const Host::Ptr& host, const String&
        String zone = host->GetZone();
 
        if (!zone.IsEmpty()) {
-               builder->AddExpression(make_shared<Expression>(&Expression::OpSet,
+               builder->AddExpression(new Expression(&Expression::OpSet,
                    MakeArray(MakeArray(MakeLiteral("zone")), OpSetLiteral),
                    MakeLiteral(zone),
                    di));
@@ -86,7 +86,7 @@ bool Service::EvaluateApplyRuleOne(const Host::Ptr& host, const ApplyRule& rule)
        msgbuf << "Evaluating 'apply' rule (" << di << ")";
        CONTEXT(msgbuf.str());
 
-       Dictionary::Ptr locals = make_shared<Dictionary>();
+       Dictionary::Ptr locals = new Dictionary();
        locals->Set("__parent", rule.GetScope());
        locals->Set("host", host);
 
@@ -98,7 +98,7 @@ bool Service::EvaluateApplyRuleOne(const Host::Ptr& host, const ApplyRule& rule)
        if (rule.GetFTerm()) {
                vinstances = rule.GetFTerm()->Evaluate(locals);
        } else {
-               Array::Ptr instances = make_shared<Array>();
+               Array::Ptr instances = new Array();
                instances->Add("");
                vinstances = instances;
        }
index 43240596772306dd03acd63e9b9c2124bffb77ff..9a27c1e1fc2c5e2aaaf3f3eaaaeae7d0ccf0cd7f 100644 (file)
@@ -53,14 +53,14 @@ void Service::OnConfigLoaded(void)
                        ServiceGroup::Ptr sg = ServiceGroup::GetByName(name);
 
                        if (sg)
-                               sg->ResolveGroupMembership(GetSelf(), true);
+                               sg->ResolveGroupMembership(this, true);
                }
        }
 
        m_Host = Host::GetByName(GetHostName());
 
        if (m_Host)
-               m_Host->AddService(GetSelf());
+               m_Host->AddService(this);
 
        SetSchedulingOffset(Utility::Random());
 
index de084c5b790b8bee68095bb709c74a368e9c57ef..af59b0d196c77d6179c6d820e9ecfdef7d3d6ab0 100644 (file)
@@ -47,7 +47,7 @@ bool ServiceGroup::EvaluateObjectRuleOne(const Service::Ptr& service, const Obje
 
        Host::Ptr host = service->GetHost();
 
-       Dictionary::Ptr locals = make_shared<Dictionary>();
+       Dictionary::Ptr locals = new Dictionary();
        locals->Set("__parent", rule.GetScope());
        locals->Set("host", host);
        locals->Set("service", service);
index 929249b63b999e33d92d3a4897be31408991d95f..f2e46a2ea33702a441f24cdfc6eab6664d599e5c 100644 (file)
@@ -35,7 +35,7 @@ INITIALIZE_ONCE(&TimePeriod::StaticInitialize);
 
 void TimePeriod::StaticInitialize(void)
 {
-       l_UpdateTimer = make_shared<Timer>();
+       l_UpdateTimer = new Timer();
        l_UpdateTimer->SetInterval(300);
        l_UpdateTimer->OnTimerExpired.connect(boost::bind(&TimePeriod::UpdateTimerHandler));
        l_UpdateTimer->Start();
@@ -87,12 +87,12 @@ void TimePeriod::AddSegment(double begin, double end)
        }
 
        /* Create new segment if we weren't able to merge this into an existing segment. */
-       Dictionary::Ptr segment = make_shared<Dictionary>();
+       Dictionary::Ptr segment = new Dictionary();
        segment->Set("begin", begin);
        segment->Set("end", end);
 
        if (!segments) {
-               segments = make_shared<Array>();
+               segments = new Array();
                SetSegments(segments);
        }
 
@@ -123,7 +123,7 @@ void TimePeriod::RemoveSegment(double begin, double end)
        if (!segments)
                return;
 
-       Array::Ptr newSegments = make_shared<Array>();
+       Array::Ptr newSegments = new Array();
 
        /* Try to split or adjust an existing segment. */
        ObjectLock dlock(segments);
@@ -172,7 +172,7 @@ void TimePeriod::PurgeSegments(double end)
        if (!segments)
                return;
 
-       Array::Ptr newSegments = make_shared<Array>();
+       Array::Ptr newSegments = new Array();
 
        /* Remove old segments. */
        ObjectLock dlock(segments);
@@ -194,10 +194,8 @@ void TimePeriod::UpdateRegion(double begin, double end, bool clearExisting)
                        return;
        }
 
-       TimePeriod::Ptr self = GetSelf();
-
        std::vector<Value> arguments;
-       arguments.push_back(self);
+       arguments.push_back(this);
        arguments.push_back(begin);
        arguments.push_back(end);
 
index 18342e6af05a1c1710cbfa859895afab6f7c0c1a..4691b7437bce289b3f942a19604696c4771a614e 100644 (file)
@@ -48,7 +48,7 @@ void User::OnConfigLoaded(void)
                        UserGroup::Ptr ug = UserGroup::GetByName(name);
 
                        if (ug)
-                               ug->ResolveGroupMembership(GetSelf(), true);
+                               ug->ResolveGroupMembership(this, true);
                }
        }
 }
@@ -66,7 +66,7 @@ void User::Stop(void)
                        UserGroup::Ptr ug = UserGroup::GetByName(name);
 
                        if (ug)
-                               ug->ResolveGroupMembership(GetSelf(), false);
+                               ug->ResolveGroupMembership(this, false);
                }
        }
 }
@@ -81,7 +81,7 @@ void User::AddGroup(const String& name)
                return;
 
        if (!groups)
-               groups = make_shared<Array>();
+               groups = new Array();
 
        groups->Add(name);
 }
@@ -124,7 +124,7 @@ void User::SetModifiedAttributes(int flags, const MessageOrigin& origin)
 {
        if ((flags & ModAttrCustomVariable) == 0) {
                SetOverrideVars(Empty);
-               OnVarsChanged(GetSelf(), GetVars(), origin);
+               OnVarsChanged(this, GetVars(), origin);
        }
 }
 
@@ -140,6 +140,6 @@ void User::SetEnableNotifications(bool enabled, const MessageOrigin& origin)
 {
        SetOverrideEnableNotifications(enabled);
 
-       OnEnableNotificationsChanged(GetSelf(), enabled, origin);
+       OnEnableNotificationsChanged(this, enabled, origin);
 }
 
index f066b89c22152c7fe6a00ede696ad5ce5e5b8032..7e3b3844831f6dd93287dd21a08902af221de169 100644 (file)
@@ -34,7 +34,7 @@ class User : CustomVarObject
                }}}
        };
        [config] Array::Ptr groups {
-               default {{{ return make_shared<Array>(); }}}
+               default {{{ return new Array(); }}}
        };
        [config] String period (PeriodRaw);
        [config] Array::Ptr types;
index a8b56c8a3b684490c9cabe90b439ae6c4cf5959b..aaaf3df31933866b3cf3cf1bbe204eb411292eff 100644 (file)
@@ -45,7 +45,7 @@ bool UserGroup::EvaluateObjectRuleOne(const User::Ptr& user, const ObjectRule& r
        msgbuf << "Evaluating 'object' rule (" << di << ")";
        CONTEXT(msgbuf.str());
 
-       Dictionary::Ptr locals = make_shared<Dictionary>();
+       Dictionary::Ptr locals = new Dictionary();
        locals->Set("__parent", rule.GetScope());
        locals->Set("user", user);
 
index babb4d7a1b54322003a9c89bfb0a8321945f264a..63de2458507b57779eb1e73c68748590037fdd55 100644 (file)
@@ -105,7 +105,7 @@ Value CommandsTable::CustomVariableNamesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        String key;
        Value value;
@@ -133,7 +133,7 @@ Value CommandsTable::CustomVariableValuesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        String key;
        Value value;
@@ -161,12 +161,12 @@ Value CommandsTable::CustomVariablesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        String key;
        Value value;
        BOOST_FOREACH(tie(key, value), vars) {
-               Array::Ptr key_val = make_shared<Array>();
+               Array::Ptr key_val = new Array();
                key_val->Add(key);
                key_val->Add(value);
                cv->Add(key_val);
index bf1340a0dbf2425a56e6281b975b140651f05394..6faf512c2bda6e1872ea46f4342246e6cfe96663 100644 (file)
@@ -81,7 +81,7 @@ Value ContactGroupsTable::MembersAccessor(const Value& row)
        if(!user_group)
                return Empty;
 
-       Array::Ptr members = make_shared<Array>();
+       Array::Ptr members = new Array();
 
        BOOST_FOREACH(const User::Ptr& user, user_group->GetMembers()) {
                members->Add(user->GetName());
index 606ce995c2fecba190b84dca803433cacee7f949..32f77d6e11da0575ee9a586e0504487c837bdfaa 100644 (file)
@@ -213,7 +213,7 @@ Value ContactsTable::CustomVariableNamesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        ObjectLock olock(vars);
        BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
@@ -240,7 +240,7 @@ Value ContactsTable::CustomVariableValuesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        ObjectLock olock(vars);
        BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
@@ -270,11 +270,11 @@ Value ContactsTable::CustomVariablesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        ObjectLock olock(vars);
        BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
-               Array::Ptr key_val = make_shared<Array>();
+               Array::Ptr key_val = new Array();
                key_val->Add(kv.first);
 
                if (kv.second.IsObjectType<Array>() || kv.second.IsObjectType<Dictionary>())
index 04b8c3b746443a44cfbce11b1fd6c5981418d693..b3c3ab155d77b5ffc505637ba3939dd70a04aa8e 100644 (file)
@@ -105,7 +105,7 @@ Value HostGroupsTable::ActionUrlAccessor(const Value& row)
 
 Value HostGroupsTable::MembersAccessor(const Value& row)
 {
-       Array::Ptr members = make_shared<Array>();
+       Array::Ptr members = new Array();
 
        BOOST_FOREACH(const Host::Ptr& host, static_cast<HostGroup::Ptr>(row)->GetMembers()) {
                members->Add(host->GetName());
@@ -116,10 +116,10 @@ Value HostGroupsTable::MembersAccessor(const Value& row)
 
 Value HostGroupsTable::MembersWithStateAccessor(const Value& row)
 {
-       Array::Ptr members = make_shared<Array>();
+       Array::Ptr members = new Array();
 
        BOOST_FOREACH(const Host::Ptr& host, static_cast<HostGroup::Ptr>(row)->GetMembers()) {
-               Array::Ptr member_state = make_shared<Array>();
+               Array::Ptr member_state = new Array();
                member_state->Add(host->GetName());
                member_state->Add(host->GetState());
                members->Add(member_state);
index 36c9a4b0c29702a948c1cd6f16281287ea46fec0..f4de88742f7d6c55701f3ebe5d0e46e80accd32d 100644 (file)
@@ -873,7 +873,7 @@ Value HostsTable::ContactsAccessor(const Value& row)
        if (!host)
                return Empty;
 
-       Array::Ptr contact_names = make_shared<Array>();
+       Array::Ptr contact_names = new Array();
 
        BOOST_FOREACH(const User::Ptr& user, CompatUtility::GetCheckableNotificationUsers(host)) {
                contact_names->Add(user->GetName());
@@ -891,7 +891,7 @@ Value HostsTable::DowntimesAccessor(const Value& row)
 
        Dictionary::Ptr downtimes = host->GetDowntimes();
 
-       Array::Ptr ids = make_shared<Array>();
+       Array::Ptr ids = new Array();
 
        ObjectLock olock(downtimes);
 
@@ -920,7 +920,7 @@ Value HostsTable::DowntimesWithInfoAccessor(const Value& row)
 
        Dictionary::Ptr downtimes = host->GetDowntimes();
 
-       Array::Ptr ids = make_shared<Array>();
+       Array::Ptr ids = new Array();
 
        ObjectLock olock(downtimes);
 
@@ -934,7 +934,7 @@ Value HostsTable::DowntimesWithInfoAccessor(const Value& row)
                if (downtime->IsExpired())
                        continue;
 
-               Array::Ptr downtime_info = make_shared<Array>();
+               Array::Ptr downtime_info = new Array();
                downtime_info->Add(downtime->GetLegacyId());
                downtime_info->Add(downtime->GetAuthor());
                downtime_info->Add(downtime->GetComment());
@@ -953,7 +953,7 @@ Value HostsTable::CommentsAccessor(const Value& row)
 
        Dictionary::Ptr comments = host->GetComments();
 
-       Array::Ptr ids = make_shared<Array>();
+       Array::Ptr ids = new Array();
 
        ObjectLock olock(comments);
 
@@ -982,7 +982,7 @@ Value HostsTable::CommentsWithInfoAccessor(const Value& row)
 
        Dictionary::Ptr comments = host->GetComments();
 
-       Array::Ptr ids = make_shared<Array>();
+       Array::Ptr ids = new Array();
 
        ObjectLock olock(comments);
 
@@ -996,7 +996,7 @@ Value HostsTable::CommentsWithInfoAccessor(const Value& row)
                if (comment->IsExpired())
                        continue;
 
-               Array::Ptr comment_info = make_shared<Array>();
+               Array::Ptr comment_info = new Array();
                comment_info->Add(comment->GetLegacyId());
                comment_info->Add(comment->GetAuthor());
                comment_info->Add(comment->GetText());
@@ -1015,7 +1015,7 @@ Value HostsTable::CommentsWithExtraInfoAccessor(const Value& row)
 
        Dictionary::Ptr comments = host->GetComments();
 
-       Array::Ptr ids = make_shared<Array>();
+       Array::Ptr ids = new Array();
 
        ObjectLock olock(comments);
 
@@ -1029,7 +1029,7 @@ Value HostsTable::CommentsWithExtraInfoAccessor(const Value& row)
                if (comment->IsExpired())
                        continue;
 
-               Array::Ptr comment_info = make_shared<Array>();
+               Array::Ptr comment_info = new Array();
                comment_info->Add(comment->GetLegacyId());
                comment_info->Add(comment->GetAuthor());
                comment_info->Add(comment->GetText());
@@ -1058,7 +1058,7 @@ Value HostsTable::CustomVariableNamesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        ObjectLock olock(vars);
        BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
@@ -1085,7 +1085,7 @@ Value HostsTable::CustomVariableValuesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        ObjectLock olock(vars);
        BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
@@ -1115,11 +1115,11 @@ Value HostsTable::CustomVariablesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        ObjectLock olock(vars);
        BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
-               Array::Ptr key_val = make_shared<Array>();
+               Array::Ptr key_val = new Array();
                key_val->Add(kv.first);
 
                if (kv.second.IsObjectType<Array>() || kv.second.IsObjectType<Dictionary>())
@@ -1168,7 +1168,7 @@ Value HostsTable::ParentsAccessor(const Value& row)
        if (!host)
                return Empty;
 
-       Array::Ptr parents = make_shared<Array>();
+       Array::Ptr parents = new Array();
 
        BOOST_FOREACH(const Checkable::Ptr& parent, host->GetParents()) {
                Host::Ptr parent_host = dynamic_pointer_cast<Host>(parent);
@@ -1189,7 +1189,7 @@ Value HostsTable::ChildsAccessor(const Value& row)
        if (!host)
                return Empty;
 
-       Array::Ptr childs = make_shared<Array>();
+       Array::Ptr childs = new Array();
 
        BOOST_FOREACH(const Checkable::Ptr& child, host->GetChildren()) {
                Host::Ptr child_host = dynamic_pointer_cast<Host>(child);
@@ -1450,7 +1450,7 @@ Value HostsTable::ContactGroupsAccessor(const Value& row)
        if (!host)
                return Empty;
 
-       Array::Ptr contactgroup_names = make_shared<Array>();
+       Array::Ptr contactgroup_names = new Array();
 
        BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetCheckableNotificationUserGroups(host)) {
                contactgroup_names->Add(usergroup->GetName());
@@ -1466,7 +1466,7 @@ Value HostsTable::ServicesAccessor(const Value& row)
        if (!host)
                return Empty;
 
-       Array::Ptr services = make_shared<Array>();
+       Array::Ptr services = new Array();
 
        BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
                services->Add(service->GetShortName());
@@ -1482,10 +1482,10 @@ Value HostsTable::ServicesWithStateAccessor(const Value& row)
        if (!host)
                return Empty;
 
-       Array::Ptr services = make_shared<Array>();
+       Array::Ptr services = new Array();
 
        BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
-               Array::Ptr svc_add = make_shared<Array>();
+               Array::Ptr svc_add = new Array();
 
                svc_add->Add(service->GetShortName());
                svc_add->Add(service->GetState());
@@ -1503,10 +1503,10 @@ Value HostsTable::ServicesWithInfoAccessor(const Value& row)
        if (!host)
                return Empty;
 
-       Array::Ptr services = make_shared<Array>();
+       Array::Ptr services = new Array();
 
        BOOST_FOREACH(const Service::Ptr& service, host->GetServices()) {
-               Array::Ptr svc_add = make_shared<Array>();
+               Array::Ptr svc_add = new Array();
 
                svc_add->Add(service->GetShortName());
                svc_add->Add(service->GetState());
index a942e08fd94c4128183fd6607cea169374ee9b51..7a7568aad18358249e78e347fc57a0bd8db8cdc3 100644 (file)
@@ -46,15 +46,15 @@ REGISTER_STATSFUNCTION(LivestatusListenerStats, &LivestatusListener::StatsFunc);
 
 Value LivestatusListener::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const LivestatusListener::Ptr& livestatuslistener, DynamicType::GetObjectsByType<LivestatusListener>()) {
-               Dictionary::Ptr stats = make_shared<Dictionary>();
+               Dictionary::Ptr stats = new Dictionary();
                stats->Set("connections", l_Connections);
 
                nodes->Set(livestatuslistener->GetName(), stats);
 
-               perfdata->Add(make_shared<PerfdataValue>("livestatuslistener_" + livestatuslistener->GetName() + "_connections", l_Connections));
+               perfdata->Add(new PerfdataValue("livestatuslistener_" + livestatuslistener->GetName() + "_connections", l_Connections));
        }
 
        status->Set("livestatuslistener", nodes);
@@ -70,7 +70,7 @@ void LivestatusListener::Start(void)
        DynamicObject::Start();
 
        if (GetSocketType() == "tcp") {
-               TcpSocket::Ptr socket = make_shared<TcpSocket>();
+               TcpSocket::Ptr socket = new TcpSocket();
                try {
                        socket->Bind(GetBindHost(), GetBindPort(), AF_UNSPEC);
                } catch (std::exception&) {
@@ -86,7 +86,7 @@ void LivestatusListener::Start(void)
        }
        else if (GetSocketType() == "unix") {
 #ifndef _WIN32
-               UnixSocket::Ptr socket = make_shared<UnixSocket>();
+               UnixSocket::Ptr socket = new UnixSocket();
                try {
                        socket->Bind(GetSocketPath());
                } catch (std::exception&) {
@@ -153,7 +153,7 @@ void LivestatusListener::ClientHandler(const Socket::Ptr& client)
                l_Connections++;
        }
 
-       Stream::Ptr stream = make_shared<NetworkStream>(client);
+       Stream::Ptr stream = new NetworkStream(client);
 
        for (;;) {
                String line;
@@ -171,7 +171,7 @@ void LivestatusListener::ClientHandler(const Socket::Ptr& client)
                if (lines.empty())
                        break;
 
-               LivestatusQuery::Ptr query = make_shared<LivestatusQuery>(lines, GetCompatLogPath());
+               LivestatusQuery::Ptr query = new LivestatusQuery(lines, GetCompatLogPath());
                if (!query->Execute(stream))
                        break;
        }
index 6ffcfeab180c0df51882107863d38ef988bb1bcf..cb5f3ee9435ea08debcf11e3e8a091cbba40c72f 100644 (file)
@@ -122,7 +122,7 @@ void LivestatusLogUtility::CreateLogCache(std::map<time_t, String> index, Histor
 
 Dictionary::Ptr LivestatusLogUtility::GetAttributes(const String& text)
 {
-       Dictionary::Ptr bag = make_shared<Dictionary>();
+       Dictionary::Ptr bag = new Dictionary();
 
        /*
         * [1379025342] SERVICE NOTIFICATION: contactname;hostname;servicedesc;WARNING;true;foo output
index 0b3e5dec1b6c2190018e641c67a421ee5581ee47..32fd88f3c902ccb5bd393aeeeae2f7bcf0c82e9c 100644 (file)
@@ -168,19 +168,19 @@ LivestatusQuery::LivestatusQuery(const std::vector<String>& lines, const String&
                        Filter::Ptr filter;
 
                        if (aggregate_arg == "sum") {
-                               aggregator = make_shared<SumAggregator>(aggregate_attr);
+                               aggregator = new SumAggregator(aggregate_attr);
                        } else if (aggregate_arg == "min") {
-                               aggregator = make_shared<MinAggregator>(aggregate_attr);
+                               aggregator = new MinAggregator(aggregate_attr);
                        } else if (aggregate_arg == "max") {
-                               aggregator = make_shared<MaxAggregator>(aggregate_attr);
+                               aggregator = new MaxAggregator(aggregate_attr);
                        } else if (aggregate_arg == "avg") {
-                               aggregator = make_shared<AvgAggregator>(aggregate_attr);
+                               aggregator = new AvgAggregator(aggregate_attr);
                        } else if (aggregate_arg == "std") {
-                               aggregator = make_shared<StdAggregator>(aggregate_attr);
+                               aggregator = new StdAggregator(aggregate_attr);
                        } else if (aggregate_arg == "suminv") {
-                               aggregator = make_shared<InvSumAggregator>(aggregate_attr);
+                               aggregator = new InvSumAggregator(aggregate_attr);
                        } else if (aggregate_arg == "avginv") {
-                               aggregator = make_shared<InvAvgAggregator>(aggregate_attr);
+                               aggregator = new InvAvgAggregator(aggregate_attr);
                        } else {
                                filter = ParseFilter(params, m_LogTimeFrom, m_LogTimeUntil);
 
@@ -191,7 +191,7 @@ LivestatusQuery::LivestatusQuery(const std::vector<String>& lines, const String&
                                        return;
                                }
 
-                               aggregator = make_shared<CountAggregator>();
+                               aggregator = new CountAggregator();
                        }
 
                        aggregator->SetFilter(filter);
@@ -205,11 +205,11 @@ LivestatusQuery::LivestatusQuery(const std::vector<String>& lines, const String&
                        CombinerFilter::Ptr filter;
 
                        if (header == "Or" || header == "StatsOr") {
-                               filter = make_shared<OrFilter>();
+                               filter = new OrFilter();
                                Log(LogDebug, "LivestatusQuery")
                                    << "Add OR filter for " << params << " column(s). " << deq.size() << " filters available.";
                        } else {
-                               filter = make_shared<AndFilter>();
+                               filter = new AndFilter();
                                Log(LogDebug, "LivestatusQuery")
                                    << "Add AND filter for " << params << " column(s). " << deq.size() << " filters available.";
                        }
@@ -232,7 +232,7 @@ LivestatusQuery::LivestatusQuery(const std::vector<String>& lines, const String&
 
                        deq.push_back(filter);
                        if (&deq == &stats) {
-                               Aggregator::Ptr aggregator = make_shared<CountAggregator>();
+                               Aggregator::Ptr aggregator = new CountAggregator();
                                aggregator->SetFilter(filter);
                                aggregators.push_back(aggregator);
                        }
@@ -256,7 +256,7 @@ LivestatusQuery::LivestatusQuery(const std::vector<String>& lines, const String&
                                return;
                        }
 
-                       deq.push_back(make_shared<NegateFilter>(filter));
+                       deq.push_back(new NegateFilter(filter));
 
                        if (deq == stats) {
                                Aggregator::Ptr aggregator = aggregators.back();
@@ -266,7 +266,7 @@ LivestatusQuery::LivestatusQuery(const std::vector<String>& lines, const String&
        }
 
        /* Combine all top-level filters into a single filter. */
-       AndFilter::Ptr top_filter = make_shared<AndFilter>();
+       AndFilter::Ptr top_filter = new AndFilter();
 
        BOOST_FOREACH(const Filter::Ptr& filter, filters) {
                top_filter->AddSubFilter(filter);
@@ -338,10 +338,10 @@ Filter::Ptr LivestatusQuery::ParseFilter(const String& params, unsigned long& fr
                negate = true;
        }
 
-       Filter::Ptr filter = make_shared<AttributeFilter>(attr, op, val);
+       Filter::Ptr filter = new AttributeFilter(attr, op, val);
 
        if (negate)
-               filter = make_shared<NegateFilter>(filter);
+               filter = new NegateFilter(filter);
 
        /* pre-filter log time duration */
        if (attr == "time") {
@@ -456,13 +456,13 @@ void LivestatusQuery::ExecuteGetHelper(const Stream::Ptr& stream)
        else
                columns = table->GetColumnNames();
 
-       Array::Ptr rs = make_shared<Array>();
+       Array::Ptr rs = new Array();
 
        if (m_Aggregators.empty()) {
-               Array::Ptr header = make_shared<Array>();
+               Array::Ptr header = new Array();
 
                BOOST_FOREACH(const Value& object, objects) {
-                       Array::Ptr row = make_shared<Array>();
+                       Array::Ptr row = new Array();
 
                        BOOST_FOREACH(const String& columnName, columns) {
                                Column column = table->GetColumn(columnName);
@@ -496,7 +496,7 @@ void LivestatusQuery::ExecuteGetHelper(const Stream::Ptr& stream)
 
                /* add column headers both for raw and aggregated data */
                if (m_ColumnHeaders) {
-                       Array::Ptr header = make_shared<Array>();
+                       Array::Ptr header = new Array();
 
                        BOOST_FOREACH(const String& columnName, m_Columns) {
                                header->Add(columnName);
@@ -509,7 +509,7 @@ void LivestatusQuery::ExecuteGetHelper(const Stream::Ptr& stream)
                        rs->Add(header);
                }
 
-               Array::Ptr row = make_shared<Array>();
+               Array::Ptr row = new Array();
 
                /*
                 * add selected columns next to stats
index 2769cb240fac95b7abcd26663288bbcf780f38c7..6ccd95a749d00739952495d30c7cb977e7a15f17 100644 (file)
@@ -96,10 +96,10 @@ Value ServiceGroupsTable::ActionUrlAccessor(const Value& row)
 
 Value ServiceGroupsTable::MembersAccessor(const Value& row)
 {
-       Array::Ptr members = make_shared<Array>();
+       Array::Ptr members = new Array();
 
        BOOST_FOREACH(const Service::Ptr& service, static_cast<ServiceGroup::Ptr>(row)->GetMembers()) {
-               Array::Ptr host_svc = make_shared<Array>();
+               Array::Ptr host_svc = new Array();
                host_svc->Add(service->GetHost()->GetName());
                host_svc->Add(service->GetShortName());
                members->Add(host_svc);
@@ -110,10 +110,10 @@ Value ServiceGroupsTable::MembersAccessor(const Value& row)
 
 Value ServiceGroupsTable::MembersWithStateAccessor(const Value& row)
 {
-       Array::Ptr members = make_shared<Array>();
+       Array::Ptr members = new Array();
 
        BOOST_FOREACH(const Service::Ptr& service, static_cast<ServiceGroup::Ptr>(row)->GetMembers()) {
-               Array::Ptr host_svc = make_shared<Array>();
+               Array::Ptr host_svc = new Array();
                host_svc->Add(service->GetHost()->GetName());
                host_svc->Add(service->GetShortName());
                host_svc->Add(service->GetHost()->GetState());
index 8bffa2b21777a452b16ddd5183b3bbb4df2bad7c..71f1b8f94e9ba6b568ce80c3802fc85f4ffc1139 100644 (file)
@@ -877,7 +877,7 @@ Value ServicesTable::ContactsAccessor(const Value& row)
        if (!service)
                return Empty;
 
-       Array::Ptr contact_names = make_shared<Array>();
+       Array::Ptr contact_names = new Array();
 
        BOOST_FOREACH(const User::Ptr& user, CompatUtility::GetCheckableNotificationUsers(service)) {
                contact_names->Add(user->GetName());
@@ -895,7 +895,7 @@ Value ServicesTable::DowntimesAccessor(const Value& row)
 
        Dictionary::Ptr downtimes = service->GetDowntimes();
 
-       Array::Ptr ids = make_shared<Array>();
+       Array::Ptr ids = new Array();
 
        ObjectLock olock(downtimes);
 
@@ -924,7 +924,7 @@ Value ServicesTable::DowntimesWithInfoAccessor(const Value& row)
 
        Dictionary::Ptr downtimes = service->GetDowntimes();
 
-       Array::Ptr ids = make_shared<Array>();
+       Array::Ptr ids = new Array();
 
        ObjectLock olock(downtimes);
 
@@ -938,7 +938,7 @@ Value ServicesTable::DowntimesWithInfoAccessor(const Value& row)
                if (downtime->IsExpired())
                        continue;
 
-               Array::Ptr downtime_info = make_shared<Array>();
+               Array::Ptr downtime_info = new Array();
                downtime_info->Add(downtime->GetLegacyId());
                downtime_info->Add(downtime->GetAuthor());
                downtime_info->Add(downtime->GetComment());
@@ -957,7 +957,7 @@ Value ServicesTable::CommentsAccessor(const Value& row)
 
        Dictionary::Ptr comments = service->GetComments();
 
-       Array::Ptr ids = make_shared<Array>();
+       Array::Ptr ids = new Array();
 
        ObjectLock olock(comments);
 
@@ -986,7 +986,7 @@ Value ServicesTable::CommentsWithInfoAccessor(const Value& row)
 
        Dictionary::Ptr comments = service->GetComments();
 
-       Array::Ptr ids = make_shared<Array>();
+       Array::Ptr ids = new Array();
 
        ObjectLock olock(comments);
 
@@ -1000,7 +1000,7 @@ Value ServicesTable::CommentsWithInfoAccessor(const Value& row)
                if (comment->IsExpired())
                        continue;
 
-               Array::Ptr comment_info = make_shared<Array>();
+               Array::Ptr comment_info = new Array();
                comment_info->Add(comment->GetLegacyId());
                comment_info->Add(comment->GetAuthor());
                comment_info->Add(comment->GetText());
@@ -1019,7 +1019,7 @@ Value ServicesTable::CommentsWithExtraInfoAccessor(const Value& row)
 
        Dictionary::Ptr comments = service->GetComments();
 
-       Array::Ptr ids = make_shared<Array>();
+       Array::Ptr ids = new Array();
 
        ObjectLock olock(comments);
 
@@ -1033,7 +1033,7 @@ Value ServicesTable::CommentsWithExtraInfoAccessor(const Value& row)
                if (comment->IsExpired())
                        continue;
 
-               Array::Ptr comment_info = make_shared<Array>();
+               Array::Ptr comment_info = new Array();
                comment_info->Add(comment->GetLegacyId());
                comment_info->Add(comment->GetAuthor());
                comment_info->Add(comment->GetText());
@@ -1062,7 +1062,7 @@ Value ServicesTable::CustomVariableNamesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        ObjectLock olock(vars);
        BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
@@ -1089,7 +1089,7 @@ Value ServicesTable::CustomVariableValuesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        ObjectLock olock(vars);
        BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
@@ -1119,11 +1119,11 @@ Value ServicesTable::CustomVariablesAccessor(const Value& row)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        ObjectLock olock(vars);
        BOOST_FOREACH(const Dictionary::Pair& kv, vars) {
-               Array::Ptr key_val = make_shared<Array>();
+               Array::Ptr key_val = new Array();
                key_val->Add(kv.first);
 
                if (kv.second.IsObjectType<Array>() || kv.second.IsObjectType<Dictionary>())
@@ -1187,7 +1187,7 @@ Value ServicesTable::ContactGroupsAccessor(const Value& row)
        if (!service)
                return Empty;
 
-       Array::Ptr contactgroup_names = make_shared<Array>();
+       Array::Ptr contactgroup_names = new Array();
 
        BOOST_FOREACH(const UserGroup::Ptr& usergroup, CompatUtility::GetCheckableNotificationUserGroups(service)) {
                contactgroup_names->Add(usergroup->GetName());
index df2843bfa7d14ebcc634d19b05f6c093eefaecf7..7aad049048e0dbade806c1e3ba11d020db43c963 100644 (file)
@@ -87,8 +87,8 @@ void StateHistTable::UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, in
        if (m_CheckablesCache.find(checkable) == m_CheckablesCache.end()) {
 
                /* create new values */
-               state_hist_service_states = make_shared<Array>();
-               state_hist_bag = make_shared<Dictionary>();
+               state_hist_service_states = new Array();
+               state_hist_bag = new Dictionary();
 
                Service::Ptr service = dynamic_pointer_cast<Service>(checkable);
                Host::Ptr host;
@@ -155,7 +155,7 @@ void StateHistTable::UpdateLogEntries(const Dictionary::Ptr& log_entry_attrs, in
                                        state_hist_bag->Set("until", time); /* add until record for duration calculation */
 
                                        /* 2. add new state_hist_bag */
-                                       Dictionary::Ptr state_hist_bag_new = make_shared<Dictionary>();
+                                       Dictionary::Ptr state_hist_bag_new = new Dictionary();
 
                                        state_hist_bag_new->Set("host_name", state_hist_bag->Get("host_name"));
                                        state_hist_bag_new->Set("service_description", state_hist_bag->Get("service_description"));
index 08860e5f0027bd83f2211f3a92f6337fc9944723..722c9bd407b7edcc12a8cc3856e625bfbaab6032 100644 (file)
@@ -115,7 +115,7 @@ String StatusTable::GetPrefix(void) const
 
 void StatusTable::FetchRows(const AddRowFunction& addRowFn)
 {
-       Object::Ptr obj = make_shared<Object>();
+       Object::Ptr obj = new Object();
 
        /* Return a fake row. */
        addRowFn(obj);
@@ -237,7 +237,7 @@ Value StatusTable::CustomVariableNamesAccessor(const Value&)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        String key;
        Value value;
@@ -255,7 +255,7 @@ Value StatusTable::CustomVariableValuesAccessor(const Value&)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        String key;
        Value value;
@@ -273,12 +273,12 @@ Value StatusTable::CustomVariablesAccessor(const Value&)
        if (!vars)
                return Empty;
 
-       Array::Ptr cv = make_shared<Array>();
+       Array::Ptr cv = new Array();
 
        String key;
        Value value;
        BOOST_FOREACH(tie(key, value), vars) {
-               Array::Ptr key_val = make_shared<Array>();
+               Array::Ptr key_val = new Array();
                key_val->Add(key);
                key_val->Add(value);
                cv->Add(key_val);
index 59a7ac7ee3e92ac85b5ff5611aabcfdaa43e2882..702a47473c4e245b132745fe480231e417532b5c 100644 (file)
@@ -48,33 +48,33 @@ Table::Table(void)
 Table::Ptr Table::GetByName(const String& name, const String& compat_log_path, const unsigned long& from, const unsigned long& until)
 {
        if (name == "status")
-               return make_shared<StatusTable>();
+               return new StatusTable();
        else if (name == "contactgroups")
-               return make_shared<ContactGroupsTable>();
+               return new ContactGroupsTable();
        else if (name == "contacts")
-               return make_shared<ContactsTable>();
+               return new ContactsTable();
        else if (name == "hostgroups")
-               return make_shared<HostGroupsTable>();
+               return new HostGroupsTable();
        else if (name == "hosts")
-               return make_shared<HostsTable>();
+               return new HostsTable();
        else if (name == "servicegroups")
-               return make_shared<ServiceGroupsTable>();
+               return new ServiceGroupsTable();
        else if (name == "services")
-               return make_shared<ServicesTable>();
+               return new ServicesTable();
        else if (name == "commands")
-               return make_shared<CommandsTable>();
+               return new CommandsTable();
        else if (name == "comments")
-               return make_shared<CommentsTable>();
+               return new CommentsTable();
        else if (name == "downtimes")
-               return make_shared<DowntimesTable>();
+               return new DowntimesTable();
        else if (name == "timeperiods")
-               return make_shared<TimePeriodsTable>();
+               return new TimePeriodsTable();
        else if (name == "log")
-               return make_shared<LogTable>(compat_log_path, from, until);
+               return new LogTable(compat_log_path, from, until);
        else if (name == "statehist")
-               return make_shared<StateHistTable>(compat_log_path, from, until);
+               return new StateHistTable(compat_log_path, from, until);
        else if (name == "endpoints")
-               return make_shared<EndpointsTable>();
+               return new EndpointsTable();
 
        return Table::Ptr();
 }
@@ -128,7 +128,7 @@ std::vector<Value> Table::FilterRows(const Filter::Ptr& filter)
 
 void Table::FilteredAddRow(std::vector<Value>& rs, const Filter::Ptr& filter, const Value& row)
 {
-       if (!filter || filter->Apply(GetSelf(), row))
+       if (!filter || filter->Apply(this, row))
                rs.push_back(row);
 }
 
@@ -149,10 +149,10 @@ Value Table::EmptyStringAccessor(const Value&)
 
 Value Table::EmptyArrayAccessor(const Value&)
 {
-       return make_shared<Array>();
+       return new Array();
 }
 
 Value Table::EmptyDictionaryAccessor(const Value&)
 {
-       return make_shared<Dictionary>();
+       return new Dictionary();
 }
index 5844f4acfb785647648d87dad314e60c2c7ac45f..cffd019a044ba63a465b89e25853f73ee7245cc0 100644 (file)
@@ -45,7 +45,7 @@ public:
        virtual String GetName(void) const = 0;
        virtual String GetPrefix(void) const = 0;
 
-       std::vector<Value> FilterRows(const shared_ptr<Filter>& filter);
+       std::vector<Value> FilterRows(const intrusive_ptr<Filter>& filter);
 
        void AddColumn(const String& name, const Column& column);
        Column GetColumn(const String& name) const;
@@ -65,9 +65,11 @@ protected:
 private:
        std::map<String, Column> m_Columns;
 
-       void FilteredAddRow(std::vector<Value>& rs, const shared_ptr<Filter>& filter, const Value& row);
+       void FilteredAddRow(std::vector<Value>& rs, const intrusive_ptr<Filter>& filter, const Value& row);
 };
 
 }
 
 #endif /* TABLE_H */
+
+#include "livestatus/filter.hpp"
index 298f006ce59247cdcd1d4acc59f22eec9b422a56..1c9eeaa5ef692896616aeccd6aed94ea482b81ae 100644 (file)
@@ -161,7 +161,7 @@ void ClrCheckTask::ScriptFunc(const Checkable::Ptr& checkable, const CheckResult
        resolvers.push_back(std::make_pair("command", commandObj));
        resolvers.push_back(std::make_pair("icinga", IcingaApplication::GetInstance()));
 
-       Dictionary::Ptr envMacros = make_shared<Dictionary>();
+       Dictionary::Ptr envMacros = new Dictionary();
 
        Dictionary::Ptr env = commandObj->GetEnv();
 
index 445f367ec00fbefb77fd61b0e05fd378fb04beb1..3cf69fb0d697cce8d08b31e7dc6d1ea2a5bd28b4 100644 (file)
@@ -39,58 +39,58 @@ void IcingaCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResul
        if (interval > 60)
                interval = 60;
 
-       Array::Ptr perfdata = make_shared<Array>();
-
-       perfdata->Add(make_shared<PerfdataValue>("active_host_checks", CIB::GetActiveHostChecksStatistics(interval) / interval));
-       perfdata->Add(make_shared<PerfdataValue>("passive_host_checks", CIB::GetPassiveHostChecksStatistics(interval) / interval));
-       perfdata->Add(make_shared<PerfdataValue>("active_host_checks_1min", CIB::GetActiveHostChecksStatistics(60)));
-       perfdata->Add(make_shared<PerfdataValue>("passive_host_checks_1min", CIB::GetPassiveHostChecksStatistics(60)));
-       perfdata->Add(make_shared<PerfdataValue>("active_host_checks_5min", CIB::GetActiveHostChecksStatistics(60 * 5)));
-       perfdata->Add(make_shared<PerfdataValue>("passive_host_checks_5min", CIB::GetPassiveHostChecksStatistics(60 * 5)));
-       perfdata->Add(make_shared<PerfdataValue>("active_host_checks_15min", CIB::GetActiveHostChecksStatistics(60 * 15)));
-       perfdata->Add(make_shared<PerfdataValue>("passive_host_checks_15min", CIB::GetPassiveHostChecksStatistics(60 * 15)));
-
-       perfdata->Add(make_shared<PerfdataValue>("active_service_checks", CIB::GetActiveServiceChecksStatistics(interval) / interval));
-       perfdata->Add(make_shared<PerfdataValue>("passive_service_checks", CIB::GetPassiveServiceChecksStatistics(interval) / interval));
-       perfdata->Add(make_shared<PerfdataValue>("active_service_checks_1min", CIB::GetActiveServiceChecksStatistics(60)));
-       perfdata->Add(make_shared<PerfdataValue>("passive_service_checks_1min", CIB::GetPassiveServiceChecksStatistics(60)));
-       perfdata->Add(make_shared<PerfdataValue>("active_service_checks_5min", CIB::GetActiveServiceChecksStatistics(60 * 5)));
-       perfdata->Add(make_shared<PerfdataValue>("passive_service_checks_5min", CIB::GetPassiveServiceChecksStatistics(60 * 5)));
-       perfdata->Add(make_shared<PerfdataValue>("active_service_checks_15min", CIB::GetActiveServiceChecksStatistics(60 * 15)));
-       perfdata->Add(make_shared<PerfdataValue>("passive_service_checks_15min", CIB::GetPassiveServiceChecksStatistics(60 * 15)));
+       Array::Ptr perfdata = new Array();
+
+       perfdata->Add(new PerfdataValue("active_host_checks", CIB::GetActiveHostChecksStatistics(interval) / interval));
+       perfdata->Add(new PerfdataValue("passive_host_checks", CIB::GetPassiveHostChecksStatistics(interval) / interval));
+       perfdata->Add(new PerfdataValue("active_host_checks_1min", CIB::GetActiveHostChecksStatistics(60)));
+       perfdata->Add(new PerfdataValue("passive_host_checks_1min", CIB::GetPassiveHostChecksStatistics(60)));
+       perfdata->Add(new PerfdataValue("active_host_checks_5min", CIB::GetActiveHostChecksStatistics(60 * 5)));
+       perfdata->Add(new PerfdataValue("passive_host_checks_5min", CIB::GetPassiveHostChecksStatistics(60 * 5)));
+       perfdata->Add(new PerfdataValue("active_host_checks_15min", CIB::GetActiveHostChecksStatistics(60 * 15)));
+       perfdata->Add(new PerfdataValue("passive_host_checks_15min", CIB::GetPassiveHostChecksStatistics(60 * 15)));
+
+       perfdata->Add(new PerfdataValue("active_service_checks", CIB::GetActiveServiceChecksStatistics(interval) / interval));
+       perfdata->Add(new PerfdataValue("passive_service_checks", CIB::GetPassiveServiceChecksStatistics(interval) / interval));
+       perfdata->Add(new PerfdataValue("active_service_checks_1min", CIB::GetActiveServiceChecksStatistics(60)));
+       perfdata->Add(new PerfdataValue("passive_service_checks_1min", CIB::GetPassiveServiceChecksStatistics(60)));
+       perfdata->Add(new PerfdataValue("active_service_checks_5min", CIB::GetActiveServiceChecksStatistics(60 * 5)));
+       perfdata->Add(new PerfdataValue("passive_service_checks_5min", CIB::GetPassiveServiceChecksStatistics(60 * 5)));
+       perfdata->Add(new PerfdataValue("active_service_checks_15min", CIB::GetActiveServiceChecksStatistics(60 * 15)));
+       perfdata->Add(new PerfdataValue("passive_service_checks_15min", CIB::GetPassiveServiceChecksStatistics(60 * 15)));
 
        CheckableCheckStatistics scs = CIB::CalculateServiceCheckStats();
 
-       perfdata->Add(make_shared<PerfdataValue>("min_latency", scs.min_latency));
-       perfdata->Add(make_shared<PerfdataValue>("max_latency", scs.max_latency));
-       perfdata->Add(make_shared<PerfdataValue>("avg_latency", scs.avg_latency));
-       perfdata->Add(make_shared<PerfdataValue>("min_execution_time", scs.min_latency));
-       perfdata->Add(make_shared<PerfdataValue>("max_execution_time", scs.max_latency));
-       perfdata->Add(make_shared<PerfdataValue>("avg_execution_time", scs.avg_execution_time));
+       perfdata->Add(new PerfdataValue("min_latency", scs.min_latency));
+       perfdata->Add(new PerfdataValue("max_latency", scs.max_latency));
+       perfdata->Add(new PerfdataValue("avg_latency", scs.avg_latency));
+       perfdata->Add(new PerfdataValue("min_execution_time", scs.min_latency));
+       perfdata->Add(new PerfdataValue("max_execution_time", scs.max_latency));
+       perfdata->Add(new PerfdataValue("avg_execution_time", scs.avg_execution_time));
 
        ServiceStatistics ss = CIB::CalculateServiceStats();
 
-       perfdata->Add(make_shared<PerfdataValue>("num_services_ok", ss.services_ok));
-       perfdata->Add(make_shared<PerfdataValue>("num_services_warning", ss.services_warning));
-       perfdata->Add(make_shared<PerfdataValue>("num_services_critical", ss.services_critical));
-       perfdata->Add(make_shared<PerfdataValue>("num_services_unknown", ss.services_unknown));
-       perfdata->Add(make_shared<PerfdataValue>("num_services_pending", ss.services_pending));
-       perfdata->Add(make_shared<PerfdataValue>("num_services_unreachable", ss.services_unreachable));
-       perfdata->Add(make_shared<PerfdataValue>("num_services_flapping", ss.services_flapping));
-       perfdata->Add(make_shared<PerfdataValue>("num_services_in_downtime", ss.services_in_downtime));
-       perfdata->Add(make_shared<PerfdataValue>("num_services_acknowledged", ss.services_acknowledged));
+       perfdata->Add(new PerfdataValue("num_services_ok", ss.services_ok));
+       perfdata->Add(new PerfdataValue("num_services_warning", ss.services_warning));
+       perfdata->Add(new PerfdataValue("num_services_critical", ss.services_critical));
+       perfdata->Add(new PerfdataValue("num_services_unknown", ss.services_unknown));
+       perfdata->Add(new PerfdataValue("num_services_pending", ss.services_pending));
+       perfdata->Add(new PerfdataValue("num_services_unreachable", ss.services_unreachable));
+       perfdata->Add(new PerfdataValue("num_services_flapping", ss.services_flapping));
+       perfdata->Add(new PerfdataValue("num_services_in_downtime", ss.services_in_downtime));
+       perfdata->Add(new PerfdataValue("num_services_acknowledged", ss.services_acknowledged));
 
        double uptime = Utility::GetTime() - Application::GetStartTime();
-       perfdata->Add(make_shared<PerfdataValue>("uptime", uptime));
+       perfdata->Add(new PerfdataValue("uptime", uptime));
 
        HostStatistics hs = CIB::CalculateHostStats();
 
-       perfdata->Add(make_shared<PerfdataValue>("num_hosts_up", hs.hosts_up));
-       perfdata->Add(make_shared<PerfdataValue>("num_hosts_down", hs.hosts_down));
-       perfdata->Add(make_shared<PerfdataValue>("num_hosts_unreachable", hs.hosts_unreachable));
-       perfdata->Add(make_shared<PerfdataValue>("num_hosts_flapping", hs.hosts_flapping));
-       perfdata->Add(make_shared<PerfdataValue>("num_hosts_in_downtime", hs.hosts_in_downtime));
-       perfdata->Add(make_shared<PerfdataValue>("num_hosts_acknowledged", hs.hosts_acknowledged));
+       perfdata->Add(new PerfdataValue("num_hosts_up", hs.hosts_up));
+       perfdata->Add(new PerfdataValue("num_hosts_down", hs.hosts_down));
+       perfdata->Add(new PerfdataValue("num_hosts_unreachable", hs.hosts_unreachable));
+       perfdata->Add(new PerfdataValue("num_hosts_flapping", hs.hosts_flapping));
+       perfdata->Add(new PerfdataValue("num_hosts_in_downtime", hs.hosts_in_downtime));
+       perfdata->Add(new PerfdataValue("num_hosts_acknowledged", hs.hosts_acknowledged));
 
        cr->SetOutput("Icinga 2 has been running for " + Utility::FormatDuration(uptime) +
            ". Version: " + Application::GetVersion());
index 4e378d3534fc65932023f8c288e159f51b96cc33..2c52a945748d31e60052435927903f16cd55c672 100644 (file)
@@ -36,8 +36,8 @@ void NullCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResult:
        String output = "Hello from ";
        output += Utility::GetFQDN();
 
-       Array::Ptr perfdata = make_shared<Array>();
-       perfdata->Add(make_shared<PerfdataValue>("time", Convert::ToDouble(Utility::GetTime())));
+       Array::Ptr perfdata = new Array();
+       perfdata->Add(new PerfdataValue("time", Convert::ToDouble(Utility::GetTime())));
 
        cr->SetOutput(output);
        cr->SetPerformanceData(perfdata);
index a10c0beab4c3324fdf9fe5cd310b682ea0e821e6..ec192436aac7f169a4698962ad88e92471c1d741 100644 (file)
@@ -44,7 +44,7 @@ void PluginNotificationTask::ScriptFunc(const Notification::Ptr& notification, c
 
        Checkable::Ptr checkable = notification->GetCheckable();
 
-       Dictionary::Ptr notificationExtra = make_shared<Dictionary>();
+       Dictionary::Ptr notificationExtra = new Dictionary();
        notificationExtra->Set("type", Notification::NotificationTypeToString(type));
        notificationExtra->Set("author", author);
        notificationExtra->Set("comment", comment);
index a10e2634f4e17a44fbf1defd1424334e8974ef87..47a930a1a027eeb320a2d6b80c85c1b039bfc7cb 100644 (file)
@@ -36,8 +36,8 @@ void RandomCheckTask::ScriptFunc(const Checkable::Ptr& service, const CheckResul
        String output = "Hello from ";
        output += Utility::GetFQDN();
 
-       Array::Ptr perfdata = make_shared<Array>();
-       perfdata->Add(make_shared<PerfdataValue>("time", Convert::ToDouble(Utility::GetTime())));
+       Array::Ptr perfdata = new Array();
+       perfdata->Add(new PerfdataValue("time", Convert::ToDouble(Utility::GetTime())));
 
        cr->SetOutput(output);
        cr->SetPerformanceData(perfdata);
index 7a21c0dab199b0bfce644f5d4bca044fb36b95e3..7960ecd7c47f2c8d382a0c87d422726c1d465cc2 100644 (file)
@@ -27,17 +27,17 @@ REGISTER_SCRIPTFUNCTION(EvenMinutesTimePeriod, &TimePeriodTask::EvenMinutesTimeP
 
 Array::Ptr TimePeriodTask::EmptyTimePeriodUpdate(const TimePeriod::Ptr&, double, double)
 {
-       Array::Ptr segments = make_shared<Array>();
+       Array::Ptr segments = new Array();
        return segments;
 }
 
 Array::Ptr TimePeriodTask::EvenMinutesTimePeriodUpdate(const TimePeriod::Ptr&, double begin, double end)
 {
-       Array::Ptr segments = make_shared<Array>();
+       Array::Ptr segments = new Array();
 
        for (long t = begin / 60 - 1; t * 60 < end; t++) {
                if ((t % 2) == 0) {
-                       Dictionary::Ptr segment = make_shared<Dictionary>();
+                       Dictionary::Ptr segment = new Dictionary();
                        segment->Set("begin", t * 60);
                        segment->Set("end", (t + 1) * 60);
 
index 522e7a6e190ca780f04264de13da2329c69ee325..2be3270541586904f9ded1eb5c0516c9e6930f98 100644 (file)
@@ -36,7 +36,7 @@ REGISTER_STATSFUNCTION(NotificationComponentStats, &NotificationComponent::Stats
 
 Value NotificationComponent::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const NotificationComponent::Ptr& notification_component, DynamicType::GetObjectsByType<NotificationComponent>()) {
                nodes->Set(notification_component->GetName(), 1); //add more stats
@@ -57,7 +57,7 @@ void NotificationComponent::Start(void)
        Checkable::OnNotificationsRequested.connect(boost::bind(&NotificationComponent::SendNotificationsHandler, this, _1,
            _2, _3, _4, _5));
 
-       m_NotificationTimer = make_shared<Timer>();
+       m_NotificationTimer = new Timer();
        m_NotificationTimer->SetInterval(5);
        m_NotificationTimer->OnTimerExpired.connect(boost::bind(&NotificationComponent::NotificationTimerHandler, this));
        m_NotificationTimer->Start();
index defa0ae0e500e53382d617d4eebe6febbe09e3bb..7498f3f6cb17acf40fc619ba28f718204b095e42 100644 (file)
@@ -48,7 +48,7 @@ REGISTER_STATSFUNCTION(GraphiteWriterStats, &GraphiteWriter::StatsFunc);
 
 Value GraphiteWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const GraphiteWriter::Ptr& graphitewriter, DynamicType::GetObjectsByType<GraphiteWriter>()) {
                nodes->Set(graphitewriter->GetName(), 1); //add more stats
@@ -63,7 +63,7 @@ void GraphiteWriter::Start(void)
 {
        DynamicObject::Start();
 
-       m_ReconnectTimer = make_shared<Timer>();
+       m_ReconnectTimer = new Timer();
        m_ReconnectTimer->SetInterval(10);
        m_ReconnectTimer->OnTimerExpired.connect(boost::bind(&GraphiteWriter::ReconnectTimerHandler, this));
        m_ReconnectTimer->Start();
@@ -77,7 +77,7 @@ void GraphiteWriter::ReconnectTimerHandler(void)
        if (m_Stream)
                return;
 
-       TcpSocket::Ptr socket = make_shared<TcpSocket>();
+       TcpSocket::Ptr socket = new TcpSocket();
 
        Log(LogNotice, "GraphiteWriter")
            << "Reconnecting to Graphite on host '" << GetHost() << "' port '" << GetPort() << "'.";
@@ -90,7 +90,7 @@ void GraphiteWriter::ReconnectTimerHandler(void)
                return;
        }
 
-       m_Stream = make_shared<NetworkStream>(socket);
+       m_Stream = new NetworkStream(socket);
 }
 
 void GraphiteWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
index 05b4e059f277c543421099fb7caddb3ca602d982..40575eac095541579c2c3485c9a7011eda191c25 100644 (file)
@@ -38,7 +38,7 @@ REGISTER_STATSFUNCTION(PerfdataWriterStats, &PerfdataWriter::StatsFunc);
 
 Value PerfdataWriter::StatsFunc(const Dictionary::Ptr& status, const Array::Ptr&)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
 
        BOOST_FOREACH(const PerfdataWriter::Ptr& perfdatawriter, DynamicType::GetObjectsByType<PerfdataWriter>()) {
                nodes->Set(perfdatawriter->GetName(), 1); //add more stats
@@ -55,7 +55,7 @@ void PerfdataWriter::Start(void)
 
        Checkable::OnNewCheckResult.connect(boost::bind(&PerfdataWriter::CheckResultHandler, this, _1, _2));
 
-       m_RotationTimer = make_shared<Timer>();
+       m_RotationTimer = new Timer();
        m_RotationTimer->OnTimerExpired.connect(boost::bind(&PerfdataWriter::RotationTimerHandler, this));
        m_RotationTimer->SetInterval(GetRotationInterval());
        m_RotationTimer->Start();
index 5429599c8d9bfee5da4b626878401cd03dae7d6e..9f54076fd9c488c4a654fef01e5e0dffe663e2c1 100644 (file)
@@ -43,7 +43,7 @@ ApiClient::ApiClient(const String& identity, bool authenticated, const TlsStream
 
 void ApiClient::Start(void)
 {
-       boost::thread thread(boost::bind(&ApiClient::MessageThreadProc, static_cast<ApiClient::Ptr>(GetSelf())));
+       boost::thread thread(boost::bind(&ApiClient::MessageThreadProc, ApiClient::Ptr(this)));
        thread.detach();
 }
 
@@ -81,7 +81,7 @@ void ApiClient::SendMessage(const Dictionary::Ptr& message)
                return;
        }
 
-       m_WriteQueue.Enqueue(boost::bind(&ApiClient::SendMessageSync, static_cast<ApiClient::Ptr>(GetSelf()), message));
+       m_WriteQueue.Enqueue(boost::bind(&ApiClient::SendMessageSync, ApiClient::Ptr(this), message));
 }
 
 void ApiClient::SendMessageSync(const Dictionary::Ptr& message)
@@ -107,7 +107,7 @@ void ApiClient::SendMessageSync(const Dictionary::Ptr& message)
 
 void ApiClient::Disconnect(void)
 {
-       Utility::QueueAsyncCallback(boost::bind(&ApiClient::DisconnectSync, static_cast<ApiClient::Ptr>(GetSelf())));
+       Utility::QueueAsyncCallback(boost::bind(&ApiClient::DisconnectSync, ApiClient::Ptr(this)));
 }
 
 void ApiClient::DisconnectSync(void)
@@ -116,10 +116,10 @@ void ApiClient::DisconnectSync(void)
            << "API client disconnected for identity '" << m_Identity << "'";
 
        if (m_Endpoint)
-               m_Endpoint->RemoveClient(GetSelf());
+               m_Endpoint->RemoveClient(this);
        else {
                ApiListener::Ptr listener = ApiListener::GetInstance();
-               listener->RemoveAnonymousClient(GetSelf());
+               listener->RemoveAnonymousClient(this);
        }
 
        m_Stream->Close();
@@ -160,7 +160,7 @@ bool ApiClient::ProcessMessage(void)
        }
 
        MessageOrigin origin;
-       origin.FromClient = GetSelf();
+       origin.FromClient = this;
 
        if (m_Endpoint) {
                if (m_Endpoint->GetZone() != Zone::GetLocalZone())
@@ -174,7 +174,7 @@ bool ApiClient::ProcessMessage(void)
        Log(LogNotice, "ApiClient")
            << "Received '" << method << "' message from '" << m_Identity << "'";
 
-       Dictionary::Ptr resultMessage = make_shared<Dictionary>();
+       Dictionary::Ptr resultMessage = new Dictionary();
 
        try {
                ApiFunction::Ptr afunc = ApiFunction::GetByName(method);
@@ -243,7 +243,7 @@ Value RequestCertificateHandler(const MessageOrigin& origin, const Dictionary::P
        ApiListener::Ptr listener = ApiListener::GetInstance();
        String salt = listener->GetTicketSalt();
 
-       Dictionary::Ptr result = make_shared<Dictionary>();
+       Dictionary::Ptr result = new Dictionary();
 
        if (salt.IsEmpty()) {
                result->Set("error", "Ticket salt is not configured.");
@@ -258,16 +258,16 @@ Value RequestCertificateHandler(const MessageOrigin& origin, const Dictionary::P
                return result;
        }
 
-       shared_ptr<X509> cert = origin.FromClient->GetStream()->GetPeerCertificate();
+       boost::shared_ptr<X509> cert = origin.FromClient->GetStream()->GetPeerCertificate();
 
        EVP_PKEY *pubkey = X509_get_pubkey(cert.get());
        X509_NAME *subject = X509_get_subject_name(cert.get());
 
-       shared_ptr<X509> newcert = CreateCertIcingaCA(pubkey, subject);
+       boost::shared_ptr<X509> newcert = CreateCertIcingaCA(pubkey, subject);
        result->Set("cert", CertificateToString(newcert));
 
        String cacertfile = GetIcingaCADir() + "/ca.crt";
-       shared_ptr<X509> cacert = GetX509Certificate(cacertfile);
+       boost::shared_ptr<X509> cacert = GetX509Certificate(cacertfile);
        result->Set("ca", CertificateToString(cacert));
 
        return result;
index bbb6fa4fc6d5c548a3abaf3c58190fad3d5d0a72..2e427df229555168a3f9726e0d4ade2d32163410 100644 (file)
@@ -33,7 +33,7 @@ Value ApiFunction::Invoke(const MessageOrigin& origin, const Dictionary::Ptr& ar
 
 RegisterApiFunctionHelper::RegisterApiFunctionHelper(const String& name, const ApiFunction::Callback& function)
 {
-       ApiFunction::Ptr func = make_shared<ApiFunction>(function);
+       ApiFunction::Ptr func = new ApiFunction(function);
        ApiFunctionRegistry::GetInstance()->Register(name, func);
 }
 
index d0a524247dab603b3d4106325903fedd14d1aada..310a35cff5f38656cd201b470e5ad244588b54cf 100644 (file)
@@ -52,7 +52,7 @@ void ApiListener::ConfigGlobHandler(Dictionary::Ptr& config, const String& path,
 
 Dictionary::Ptr ApiListener::LoadConfigDir(const String& dir)
 {
-       Dictionary::Ptr config = make_shared<Dictionary>();
+       Dictionary::Ptr config = new Dictionary();
        Utility::GlobRecursive(dir, "*.conf", boost::bind(&ApiListener::ConfigGlobHandler, boost::ref(config), dir, _1), GlobFile);
        return config;
 }
@@ -155,7 +155,7 @@ void ApiListener::SendConfigUpdate(const ApiClient::Ptr& aclient)
        if (!azone->IsChildOf(lzone))
                return;
 
-       Dictionary::Ptr configUpdate = make_shared<Dictionary>();
+       Dictionary::Ptr configUpdate = new Dictionary();
 
        String zonesDir = Application::GetLocalStateDir() + "/lib/icinga2/api/zones";
 
@@ -180,10 +180,10 @@ void ApiListener::SendConfigUpdate(const ApiClient::Ptr& aclient)
                configUpdate->Set(zone->GetName(), LoadConfigDir(zonesDir + "/" + zone->GetName()));
        }
 
-       Dictionary::Ptr params = make_shared<Dictionary>();
+       Dictionary::Ptr params = new Dictionary();
        params->Set("update", configUpdate);
 
-       Dictionary::Ptr message = make_shared<Dictionary>();
+       Dictionary::Ptr message = new Dictionary();
        message->Set("jsonrpc", "2.0");
        message->Set("method", "config::Update");
        message->Set("params", params);
index da204dd96ce003e17cc74f38dc2f6ae7f1400089..5fb31b647e856270f8ee79caabe33e1124a048b0 100644 (file)
@@ -43,7 +43,7 @@ REGISTER_STATSFUNCTION(ApiListenerStats, &ApiListener::StatsFunc);
 void ApiListener::OnConfigLoaded(void)
 {
        /* set up SSL context */
-       shared_ptr<X509> cert;
+       boost::shared_ptr<X509> cert;
        try {
                cert = GetX509Certificate(GetCertPath());
        } catch (const std::exception&) {
@@ -115,7 +115,7 @@ void ApiListener::Start(void)
                Application::Exit(EXIT_FAILURE);
        }
 
-       m_Timer = make_shared<Timer>();
+       m_Timer = new Timer();
        m_Timer->OnTimerExpired.connect(boost::bind(&ApiListener::ApiTimerHandler, this));
        m_Timer->SetInterval(5);
        m_Timer->Start();
@@ -132,7 +132,7 @@ ApiListener::Ptr ApiListener::GetInstance(void)
        return ApiListener::Ptr();
 }
 
-shared_ptr<SSL_CTX> ApiListener::GetSSLContext(void) const
+boost::shared_ptr<SSL_CTX> ApiListener::GetSSLContext(void) const
 {
        return m_SSLContext;
 }
@@ -175,7 +175,7 @@ bool ApiListener::AddListener(const String& node, const String& service)
 {
        ObjectLock olock(this);
 
-       shared_ptr<SSL_CTX> sslContext = m_SSLContext;
+       boost::shared_ptr<SSL_CTX> sslContext = m_SSLContext;
 
        if (!sslContext) {
                Log(LogCritical, "ApiListener", "SSL context is required for AddListener()");
@@ -185,7 +185,7 @@ bool ApiListener::AddListener(const String& node, const String& service)
        Log(LogInformation, "ApiListener")
            << "Adding new listener on port '" << service << "'";
 
-       TcpSocket::Ptr server = make_shared<TcpSocket>();
+       TcpSocket::Ptr server = new TcpSocket();
 
        try {
                server->Bind(node, service, AF_UNSPEC);
@@ -229,7 +229,7 @@ void ApiListener::AddConnection(const Endpoint::Ptr& endpoint)
        {
                ObjectLock olock(this);
 
-               shared_ptr<SSL_CTX> sslContext = m_SSLContext;
+               boost::shared_ptr<SSL_CTX> sslContext = m_SSLContext;
 
                if (!sslContext) {
                        Log(LogCritical, "ApiListener", "SSL context is required for AddConnection()");
@@ -243,7 +243,7 @@ void ApiListener::AddConnection(const Endpoint::Ptr& endpoint)
        Log(LogInformation, "ApiClient")
            << "Reconnecting to API endpoint '" << endpoint->GetName() << "' via host '" << host << "' and port '" << port << "'";
 
-       TcpSocket::Ptr client = make_shared<TcpSocket>();
+       TcpSocket::Ptr client = new TcpSocket();
 
        try {
                endpoint->SetConnecting(true);
@@ -276,7 +276,7 @@ void ApiListener::NewClientHandler(const Socket::Ptr& client, ConnectionRole rol
        {
                ObjectLock olock(this);
                try {
-                       tlsStream = make_shared<TlsStream>(client, role, m_SSLContext);
+                       tlsStream = new TlsStream(client, role, m_SSLContext);
                } catch (const std::exception&) {
                        Log(LogCritical, "ApiListener", "Cannot create TLS stream from client connection.");
                        return;
@@ -290,7 +290,7 @@ void ApiListener::NewClientHandler(const Socket::Ptr& client, ConnectionRole rol
                return;
        }
 
-       shared_ptr<X509> cert = tlsStream->GetPeerCertificate();
+       boost::shared_ptr<X509> cert = tlsStream->GetPeerCertificate();
        String identity;
 
        try {
@@ -316,7 +316,7 @@ void ApiListener::NewClientHandler(const Socket::Ptr& client, ConnectionRole rol
        if (endpoint)
                need_sync = !endpoint->IsConnected();
 
-       ApiClient::Ptr aclient = make_shared<ApiClient>(identity, verify_ok, tlsStream, role);
+       ApiClient::Ptr aclient = new ApiClient(identity, verify_ok, tlsStream, role);
        aclient->Start();
 
        if (endpoint) {
@@ -417,10 +417,10 @@ void ApiListener::ApiTimerHandler(void)
                if (ts == 0)
                        continue;
 
-               Dictionary::Ptr lparams = make_shared<Dictionary>();
+               Dictionary::Ptr lparams = new Dictionary();
                lparams->Set("log_position", ts);
 
-               Dictionary::Ptr lmessage = make_shared<Dictionary>();
+               Dictionary::Ptr lmessage = new Dictionary();
                lmessage->Set("jsonrpc", "2.0");
                lmessage->Set("method", "log::SetLogPosition");
                lmessage->Set("params", lparams);
@@ -459,12 +459,12 @@ void ApiListener::PersistMessage(const Dictionary::Ptr& message, const DynamicOb
 
        ASSERT(ts != 0);
 
-       Dictionary::Ptr pmessage = make_shared<Dictionary>();
+       Dictionary::Ptr pmessage = new Dictionary();
        pmessage->Set("timestamp", ts);
 
        pmessage->Set("message", JsonEncode(message));
        
-       Dictionary::Ptr secname = make_shared<Dictionary>();
+       Dictionary::Ptr secname = new Dictionary();
        secname->Set("type", secobj->GetType()->GetName());
        secname->Set("name", secobj->GetName());
        pmessage->Set("secobj", secname);
@@ -583,7 +583,7 @@ void ApiListener::OpenLogFile(void)
                return;
        }
 
-       m_LogFile = make_shared<StdioStream>(fp, true);
+       m_LogFile = new StdioStream(fp, true);
        m_LogMessageCount = 0;
        SetLogMessageTimestamp(Utility::GetTime());
 }
@@ -674,7 +674,7 @@ void ApiListener::ReplayLog(const ApiClient::Ptr& client)
                            << "Replaying log: " << path;
 
                        std::fstream *fp = new std::fstream(path.CStr(), std::fstream::in);
-                       StdioStream::Ptr logStream = make_shared<StdioStream>(fp, true);
+                       StdioStream::Ptr logStream = new StdioStream(fp, true);
 
                        String message;
                        while (true) {
@@ -740,7 +740,7 @@ void ApiListener::ReplayLog(const ApiClient::Ptr& client)
 
 Value ApiListener::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
 {
-       Dictionary::Ptr nodes = make_shared<Dictionary>();
+       Dictionary::Ptr nodes = new Dictionary();
        std::pair<Dictionary::Ptr, Dictionary::Ptr> stats;
 
        ApiListener::Ptr listener = ApiListener::GetInstance();
@@ -760,15 +760,15 @@ Value ApiListener::StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata)
 
 std::pair<Dictionary::Ptr, Dictionary::Ptr> ApiListener::GetStatus(void)
 {
-       Dictionary::Ptr status = make_shared<Dictionary>();
-       Dictionary::Ptr perfdata = make_shared<Dictionary>();
+       Dictionary::Ptr status = new Dictionary();
+       Dictionary::Ptr perfdata = new Dictionary();
 
        /* cluster stats */
        status->Set("identity", GetIdentity());
 
        double count_endpoints = 0;
-       Array::Ptr not_connected_endpoints = make_shared<Array>();
-       Array::Ptr connected_endpoints = make_shared<Array>();
+       Array::Ptr not_connected_endpoints = new Array();
+       Array::Ptr connected_endpoints = new Array();
 
        BOOST_FOREACH(const Endpoint::Ptr& endpoint, DynamicType::GetObjectsByType<Endpoint>()) {
                if (endpoint->GetName() == GetIdentity())
index deea3e74686d48d31b43eaee5c22c933c6621c08..de1d8a7ab5e62540a0675d4f4d354b13b066835e 100644 (file)
@@ -49,7 +49,7 @@ public:
 
        static ApiListener::Ptr GetInstance(void);
 
-       shared_ptr<SSL_CTX> GetSSLContext(void) const;
+       boost::shared_ptr<SSL_CTX> GetSSLContext(void) const;
 
        Endpoint::Ptr GetMaster(void) const;
        bool IsMaster(void) const;
@@ -72,7 +72,7 @@ protected:
        virtual void Start(void);
 
 private:
-       shared_ptr<SSL_CTX> m_SSLContext;
+       boost::shared_ptr<SSL_CTX> m_SSLContext;
        std::set<TcpSocket::Ptr> m_Servers;
        std::set<ApiClient::Ptr> m_AnonymousClients;
        Timer::Ptr m_Timer;
index 6b4b60d9d154bc11831f4f16869f9c32605d7cea..7a90ef6f319cdcf8f1e8ed3c5e4c6593a8ed677c 100644 (file)
@@ -69,7 +69,7 @@ static void AuthorityTimerHandler(void)
 
 static void StaticInitialize(void)
 {
-       l_AuthorityTimer = make_shared<Timer>();
+       l_AuthorityTimer = new Timer();
        l_AuthorityTimer->OnTimerExpired.connect(boost::bind(&AuthorityTimerHandler));
        l_AuthorityTimer->SetInterval(30);
        l_AuthorityTimer->Start();
index 4b66d839384790bf78736714bb979696928b67dc..35a28486ff0a48c98ea0cdaffa9ff1acd7a71919 100644 (file)
@@ -44,7 +44,7 @@ void Endpoint::OnConfigLoaded(void)
                if (members.empty())
                        continue;
 
-               if (members.find(GetSelf()) != members.end()) {
+               if (members.find(this) != members.end()) {
                        if (m_Zone)
                                BOOST_THROW_EXCEPTION(std::runtime_error("Endpoint '" + GetName() + "' is in more than one zone."));
 
@@ -70,7 +70,7 @@ void Endpoint::AddClient(const ApiClient::Ptr& client)
        if (was_master != is_master)
                ApiListener::OnMasterChanged(is_master);
 
-       OnConnected(GetSelf(), client);
+       OnConnected(this, client);
 }
 
 void Endpoint::RemoveClient(const ApiClient::Ptr& client)
@@ -90,7 +90,7 @@ void Endpoint::RemoveClient(const ApiClient::Ptr& client)
        if (was_master != is_master)
                ApiListener::OnMasterChanged(is_master);
 
-       OnDisconnected(GetSelf(), client);
+       OnDisconnected(this, client);
 }
 
 std::set<ApiClient::Ptr> Endpoint::GetClients(void) const
index ee92088c7533daf7d727cd8836d20a1f28763a7e..1f4463400aa56d3cc2e9201e7beb0c5858a9090a 100644 (file)
@@ -41,14 +41,14 @@ public:
        DECLARE_OBJECT(Endpoint);
        DECLARE_OBJECTNAME(Endpoint);
 
-       static boost::signals2::signal<void(const Endpoint::Ptr&, const shared_ptr<ApiClient>&)> OnConnected;
-       static boost::signals2::signal<void(const Endpoint::Ptr&, const shared_ptr<ApiClient>&)> OnDisconnected;
+       static boost::signals2::signal<void(const Endpoint::Ptr&, const intrusive_ptr<ApiClient>&)> OnConnected;
+       static boost::signals2::signal<void(const Endpoint::Ptr&, const intrusive_ptr<ApiClient>&)> OnDisconnected;
 
-       void AddClient(const shared_ptr<ApiClient>& client);
-       void RemoveClient(const shared_ptr<ApiClient>& client);
-       std::set<shared_ptr<ApiClient> > GetClients(void) const;
+       void AddClient(const intrusive_ptr<ApiClient>& client);
+       void RemoveClient(const intrusive_ptr<ApiClient>& client);
+       std::set<intrusive_ptr<ApiClient> > GetClients(void) const;
 
-       shared_ptr<Zone> GetZone(void) const;
+       intrusive_ptr<Zone> GetZone(void) const;
 
        bool IsConnected(void) const;
 
@@ -59,8 +59,8 @@ protected:
 
 private:
        mutable boost::mutex m_ClientsLock;
-       std::set<shared_ptr<ApiClient> > m_Clients;
-       shared_ptr<Zone> m_Zone;
+       std::set<intrusive_ptr<ApiClient> > m_Clients;
+       intrusive_ptr<Zone> m_Zone;
 };
 
 }
index e720ba24a27fbf88f1ee25530bdaf9e68d8035ed..8be1c3f311eb7fde3f0cf050017d7716b27d31d6 100644 (file)
@@ -18,6 +18,7 @@
  ******************************************************************************/
 
 #include "remote/zone.hpp"
+#include "remote/apiclient.hpp"
 #include "base/objectlock.hpp"
 #include <boost/foreach.hpp>
 
@@ -64,12 +65,12 @@ bool Zone::CanAccessObject(const DynamicObject::Ptr& object)
        if (!object_zone)
                object_zone = Zone::GetLocalZone();
 
-       return object_zone->IsChildOf(GetSelf());
+       return object_zone->IsChildOf(this);
 }
 
 bool Zone::IsChildOf(const Zone::Ptr& zone)
 {
-       Zone::Ptr azone = GetSelf();
+       Zone::Ptr azone = this;
 
        while (azone) {
                if (azone == zone)
@@ -81,7 +82,7 @@ bool Zone::IsChildOf(const Zone::Ptr& zone)
        return false;
 }
 
-bool Zone::IsGlobal(void)
+bool Zone::IsGlobal(void) const
 {
        return GetGlobal();
 }
index ea1ab7464617be50b3abcb943c2b1e49b3b450aa..41c9d9b5f1ec4f2b7fda61ca85dc556687221661 100644 (file)
@@ -41,7 +41,7 @@ public:
 
        bool CanAccessObject(const DynamicObject::Ptr& object);
        bool IsChildOf(const Zone::Ptr& zone);
-       bool IsGlobal(void);
+       bool IsGlobal(void) const;
 
        static Zone::Ptr GetLocalZone(void);
 };
index d2e158b5218eede872444d37b88b6089be868375..099cec27e3919589255155dd835cb613d5c0f87c 100644 (file)
@@ -59,7 +59,6 @@ add_boost_test(base
         base_netstring/netstring
         base_object/construct
         base_object/getself
-        base_object/weak
         base_serialize/scalar
         base_serialize/array
         base_serialize/dictionary
index e58cc9e2136a1f97f3bf06b52473da30d0a246c2..6e2077b85b9460b94d83e32da72cd34ac3b63c58 100644 (file)
@@ -29,14 +29,14 @@ BOOST_AUTO_TEST_SUITE(base_array)
 
 BOOST_AUTO_TEST_CASE(construct)
 {
-       Array::Ptr array = make_shared<Array>();
+       Array::Ptr array = new Array();
        BOOST_CHECK(array);
        BOOST_CHECK(array->GetLength() == 0);
 }
 
 BOOST_AUTO_TEST_CASE(getset)
 {
-       Array::Ptr array = make_shared<Array>();
+       Array::Ptr array = new Array();
        array->Add(7);
        array->Add(2);
        array->Add(5);
@@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(getset)
 
 BOOST_AUTO_TEST_CASE(insert)
 {
-       Array::Ptr array = make_shared<Array>();
+       Array::Ptr array = new Array();
 
        array->Insert(0, 11);
        array->Insert(1, 22);
@@ -76,7 +76,7 @@ BOOST_AUTO_TEST_CASE(insert)
 
 BOOST_AUTO_TEST_CASE(remove)
 {
-       Array::Ptr array = make_shared<Array>();
+       Array::Ptr array = new Array();
        array->Add(7);
        array->Add(2);
        array->Add(5);
@@ -93,7 +93,7 @@ BOOST_AUTO_TEST_CASE(remove)
 
 BOOST_AUTO_TEST_CASE(foreach)
 {
-       Array::Ptr array = make_shared<Array>();
+       Array::Ptr array = new Array();
        array->Add(7);
        array->Add(2);
        array->Add(5);
@@ -113,7 +113,7 @@ BOOST_AUTO_TEST_CASE(foreach)
 
 BOOST_AUTO_TEST_CASE(clone)
 {
-       Array::Ptr array = make_shared<Array>();
+       Array::Ptr array = new Array();
        array->Add(7);
        array->Add(2);
        array->Add(5);
@@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE(clone)
 
 BOOST_AUTO_TEST_CASE(json)
 {
-       Array::Ptr array = make_shared<Array>();
+       Array::Ptr array = new Array();
        array->Add(7);
        array->Add(2);
        array->Add(5);
index f140d5a2a22f2625e37b1d5d7f4103964b299459..99990e92a0b83d95ccd11ebef83adb3396a64378 100644 (file)
@@ -30,13 +30,13 @@ BOOST_AUTO_TEST_SUITE(base_dictionary)
 
 BOOST_AUTO_TEST_CASE(construct)
 {
-       Dictionary::Ptr dictionary = make_shared<Dictionary>();
+       Dictionary::Ptr dictionary = new Dictionary();
        BOOST_CHECK(dictionary);
 }
 
 BOOST_AUTO_TEST_CASE(get1)
 {
-       Dictionary::Ptr dictionary = make_shared<Dictionary>();
+       Dictionary::Ptr dictionary = new Dictionary();
        dictionary->Set("test1", 7);
        dictionary->Set("test2", "hello world");
 
@@ -58,8 +58,8 @@ BOOST_AUTO_TEST_CASE(get1)
 
 BOOST_AUTO_TEST_CASE(get2)
 {
-       Dictionary::Ptr dictionary = make_shared<Dictionary>();
-       Dictionary::Ptr other = make_shared<Dictionary>();
+       Dictionary::Ptr dictionary = new Dictionary();
+       Dictionary::Ptr other = new Dictionary();
 
        dictionary->Set("test1", other);
 
@@ -74,7 +74,7 @@ BOOST_AUTO_TEST_CASE(get2)
 
 BOOST_AUTO_TEST_CASE(foreach)
 {
-       Dictionary::Ptr dictionary = make_shared<Dictionary>();
+       Dictionary::Ptr dictionary = new Dictionary();
        dictionary->Set("test1", 7);
        dictionary->Set("test2", "hello world");
 
@@ -106,7 +106,7 @@ BOOST_AUTO_TEST_CASE(foreach)
 
 BOOST_AUTO_TEST_CASE(remove)
 {
-       Dictionary::Ptr dictionary = make_shared<Dictionary>();
+       Dictionary::Ptr dictionary = new Dictionary();
 
        dictionary->Set("test1", 7);
        dictionary->Set("test2", "hello world");
@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(remove)
 
 BOOST_AUTO_TEST_CASE(clone)
 {
-       Dictionary::Ptr dictionary = make_shared<Dictionary>();
+       Dictionary::Ptr dictionary = new Dictionary();
 
        dictionary->Set("test1", 7);
        dictionary->Set("test2", "hello world");
@@ -167,7 +167,7 @@ BOOST_AUTO_TEST_CASE(clone)
 
 BOOST_AUTO_TEST_CASE(json)
 {
-       Dictionary::Ptr dictionary = make_shared<Dictionary>();
+       Dictionary::Ptr dictionary = new Dictionary();
 
        dictionary->Set("test1", 7);
        dictionary->Set("test2", "hello world");
index abe88b1c82af771dee228b2f9bace68231bf86c3..c80fd4b5f6ad01ecc057bedc8cba3554769c52d4 100644 (file)
@@ -28,7 +28,7 @@ BOOST_AUTO_TEST_SUITE(base_fifo)
 
 BOOST_AUTO_TEST_CASE(construct)
 {
-       FIFO::Ptr fifo = make_shared<FIFO>();
+       FIFO::Ptr fifo = new FIFO();
        BOOST_CHECK(fifo);
        BOOST_CHECK(fifo->GetAvailableBytes() == 0);
 
@@ -37,7 +37,7 @@ BOOST_AUTO_TEST_CASE(construct)
 
 BOOST_AUTO_TEST_CASE(io)
 {
-       FIFO::Ptr fifo = make_shared<FIFO>();
+       FIFO::Ptr fifo = new FIFO();
 
        fifo->Write("hello", 5);
        BOOST_CHECK(fifo->GetAvailableBytes() == 5);
index 94becf4d2f6f094803c39425fcf0853c70a0e316..47799fed11c98671de5c620e0d414088cd1a742f 100644 (file)
@@ -27,7 +27,7 @@ BOOST_AUTO_TEST_SUITE(base_netstring)
 
 BOOST_AUTO_TEST_CASE(netstring)
 {
-       FIFO::Ptr fifo = make_shared<FIFO>();
+       FIFO::Ptr fifo = new FIFO();
 
        NetString::WriteStringToStream(fifo, "hello");
 
index 8be052703201e5eb63c41fe0188f423e9df97e5a..b67dd12d3278d9e0158c43eb0cfc3797367f9e24 100644 (file)
@@ -30,7 +30,7 @@ public:
 
        TestObject::Ptr GetTestRef(void)
        {
-               return GetSelf();
+               return this;
        }
 };
 
@@ -38,13 +38,13 @@ BOOST_AUTO_TEST_SUITE(base_object)
 
 BOOST_AUTO_TEST_CASE(construct)
 {
-       Object::Ptr tobject = make_shared<TestObject>();
+       Object::Ptr tobject = new TestObject();
        BOOST_CHECK(tobject);
 }
 
 BOOST_AUTO_TEST_CASE(getself)
 {
-       TestObject::Ptr tobject = make_shared<TestObject>();
+       TestObject::Ptr tobject = new TestObject();
        TestObject::Ptr tobject_self = tobject->GetTestRef();
        BOOST_CHECK(tobject == tobject_self);
 
@@ -53,13 +53,4 @@ BOOST_AUTO_TEST_CASE(getself)
        BOOST_CHECK(vobject.IsObjectType<TestObject>());
 }
 
-BOOST_AUTO_TEST_CASE(weak)
-{
-       TestObject::Ptr tobject = make_shared<TestObject>();
-       TestObject::WeakPtr wtobject = tobject;
-       tobject.reset();
-       BOOST_CHECK(!tobject);
-       BOOST_CHECK(!wtobject.lock());
-}
-
 BOOST_AUTO_TEST_SUITE_END()
index 26d6dc471da2cae94973b693ef4c7f76b497552d..7be2c08d96c02c39683703853c0b0a2e854a2e24 100644 (file)
@@ -41,7 +41,7 @@ BOOST_AUTO_TEST_CASE(scalar)
 
 BOOST_AUTO_TEST_CASE(array)
 {
-       Array::Ptr array = make_shared<Array>();
+       Array::Ptr array = new Array();
        array->Add(7);
        array->Add(7.3);
        array->Add(Empty);
@@ -59,7 +59,7 @@ BOOST_AUTO_TEST_CASE(array)
 
 BOOST_AUTO_TEST_CASE(dictionary)
 {
-       Dictionary::Ptr dict = make_shared<Dictionary>();
+       Dictionary::Ptr dict = new Dictionary();
        dict->Set("k1", 7);
        dict->Set("k2", 7.3);
        dict->Set("k3", Empty);
@@ -77,7 +77,7 @@ BOOST_AUTO_TEST_CASE(dictionary)
 
 BOOST_AUTO_TEST_CASE(object)
 {
-       PerfdataValue::Ptr pdv = make_shared<PerfdataValue>("size", 100, true, "bytes");
+       PerfdataValue::Ptr pdv = new PerfdataValue("size", 100, true, "bytes");
 
        PerfdataValue::Ptr result = Deserialize(Serialize(pdv));
 
index 3b523375ade7650666bbf737bb128b1497019e42..5dc3c42f7f9b7792c3cebd842a124e0167ee6f2a 100644 (file)
@@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE(readline_stdio)
        std::stringstream msgbuf;
        msgbuf << "Hello\nWorld\n\n";
 
-       StdioStream::Ptr stdstream = make_shared<StdioStream>(&msgbuf, false);
+       StdioStream::Ptr stdstream = new StdioStream(&msgbuf, false);
 
        ReadLineContext rlc;
 
index d7b1380c773d06aeb9c2c435240e2d26ce9c4a84..115d9542a3ac8d9c3f727420e0274ec662ecd01c 100644 (file)
@@ -42,13 +42,13 @@ BOOST_FIXTURE_TEST_SUITE(base_timer, TimerFixture)
 
 BOOST_AUTO_TEST_CASE(construct)
 {
-       Timer::Ptr timer = make_shared<Timer>();
+       Timer::Ptr timer = new Timer();
        BOOST_CHECK(timer);
 }
 
 BOOST_AUTO_TEST_CASE(interval)
 {
-       Timer::Ptr timer = make_shared<Timer>();
+       Timer::Ptr timer = new Timer();
        timer->SetInterval(1.5);
        BOOST_CHECK(timer->GetInterval() == 1.5);
 }
@@ -61,7 +61,7 @@ static void Callback(int *counter)
 BOOST_AUTO_TEST_CASE(invoke)
 {
        int counter;
-       Timer::Ptr timer = make_shared<Timer>();
+       Timer::Ptr timer = new Timer();
        timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
        timer->SetInterval(1);
 
@@ -76,7 +76,7 @@ BOOST_AUTO_TEST_CASE(invoke)
 BOOST_AUTO_TEST_CASE(scope)
 {
        int counter;
-       Timer::Ptr timer = make_shared<Timer>();
+       Timer::Ptr timer = new Timer();
        timer->OnTimerExpired.connect(boost::bind(&Callback, &counter));
        timer->SetInterval(1);