Add DECLARE_PTR_TYPEDEFS macro for Ptr/WeakPtr typedefs.

This commit is contained in:
Gunnar Beutner 2013-07-09 08:42:08 +02:00
parent 989c979ea7
commit 4961523e91
74 changed files with 85 additions and 141 deletions

View File

@ -63,8 +63,7 @@ struct ServiceNextCheckExtractor
class CheckerComponent : public DynamicObject class CheckerComponent : public DynamicObject
{ {
public: public:
typedef shared_ptr<CheckerComponent> Ptr; DECLARE_PTR_TYPEDEFS(CheckerComponent);
typedef weak_ptr<CheckerComponent> WeakPtr;
typedef boost::multi_index_container< typedef boost::multi_index_container<
Service::Ptr, Service::Ptr,

View File

@ -36,8 +36,7 @@ namespace icinga
class CheckResultReader : public DynamicObject class CheckResultReader : public DynamicObject
{ {
public: public:
typedef shared_ptr<CheckResultReader> Ptr; DECLARE_PTR_TYPEDEFS(CheckResultReader);
typedef weak_ptr<CheckResultReader> WeakPtr;
CheckResultReader(const Dictionary::Ptr& properties); CheckResultReader(const Dictionary::Ptr& properties);

View File

@ -45,6 +45,8 @@ enum CompatObjectType
class CompatComponent : public DynamicObject class CompatComponent : public DynamicObject
{ {
public: public:
DECLARE_PTR_TYPEDEFS(CompatComponent);
CompatComponent(const Dictionary::Ptr& serializedUpdate); CompatComponent(const Dictionary::Ptr& serializedUpdate);
virtual void Start(void); virtual void Start(void);

View File

@ -37,8 +37,7 @@ namespace icinga
class CompatLog : public DynamicObject class CompatLog : public DynamicObject
{ {
public: public:
typedef shared_ptr<CompatLog> Ptr; DECLARE_PTR_TYPEDEFS(CompatLog);
typedef weak_ptr<CompatLog> WeakPtr;
CompatLog(const Dictionary::Ptr& serializedUpdate); CompatLog(const Dictionary::Ptr& serializedUpdate);

View File

@ -34,6 +34,8 @@ namespace icinga
class DelegationComponent : public DynamicObject class DelegationComponent : public DynamicObject
{ {
public: public:
DECLARE_PTR_TYPEDEFS(DelegationComponent);
DelegationComponent(const Dictionary::Ptr& serializedUpdate); DelegationComponent(const Dictionary::Ptr& serializedUpdate);
virtual void Start(void); virtual void Start(void);

View File

@ -33,6 +33,8 @@ namespace icinga
class DemoComponent : public DynamicObject class DemoComponent : public DynamicObject
{ {
public: public:
DECLARE_PTR_TYPEDEFS(DemoComponent);
DemoComponent(const Dictionary::Ptr& serializedUpdate); DemoComponent(const Dictionary::Ptr& serializedUpdate);
virtual void Start(void); virtual void Start(void);

View File

@ -33,8 +33,7 @@ namespace livestatus
class AndFilter : public CombinerFilter class AndFilter : public CombinerFilter
{ {
public: public:
typedef shared_ptr<AndFilter> Ptr; DECLARE_PTR_TYPEDEFS(AndFilter);
typedef weak_ptr<AndFilter> WeakPtr;
AndFilter(void); AndFilter(void);

View File

@ -33,8 +33,7 @@ namespace livestatus
class AttributeFilter : public Filter class AttributeFilter : public Filter
{ {
public: public:
typedef shared_ptr<AttributeFilter> Ptr; DECLARE_PTR_TYPEDEFS(AttributeFilter);
typedef weak_ptr<AttributeFilter> WeakPtr;
AttributeFilter(const String& column, const String& op, const String& operand); AttributeFilter(const String& column, const String& op, const String& operand);

View File

@ -33,8 +33,7 @@ namespace livestatus
class CombinerFilter : public Filter class CombinerFilter : public Filter
{ {
public: public:
typedef shared_ptr<CombinerFilter> Ptr; DECLARE_PTR_TYPEDEFS(CombinerFilter);
typedef weak_ptr<CombinerFilter> WeakPtr;
CombinerFilter(void); CombinerFilter(void);

View File

@ -33,8 +33,7 @@ namespace livestatus
class CommentsTable : public Table class CommentsTable : public Table
{ {
public: public:
typedef shared_ptr<CommentsTable> Ptr; DECLARE_PTR_TYPEDEFS(CommentsTable);
typedef weak_ptr<CommentsTable> WeakPtr;
CommentsTable(void); CommentsTable(void);

View File

@ -33,8 +33,7 @@ namespace livestatus
class ContactGroupsTable : public Table class ContactGroupsTable : public Table
{ {
public: public:
typedef shared_ptr<ContactGroupsTable> Ptr; DECLARE_PTR_TYPEDEFS(ContactGroupsTable);
typedef weak_ptr<ContactGroupsTable> WeakPtr;
ContactGroupsTable(void); ContactGroupsTable(void);

View File

@ -33,8 +33,7 @@ namespace livestatus
class ContactsTable : public Table class ContactsTable : public Table
{ {
public: public:
typedef shared_ptr<ContactsTable> Ptr; DECLARE_PTR_TYPEDEFS(ContactsTable);
typedef weak_ptr<ContactsTable> WeakPtr;
ContactsTable(void); ContactsTable(void);

View File

@ -33,8 +33,7 @@ namespace livestatus
class DowntimesTable : public Table class DowntimesTable : public Table
{ {
public: public:
typedef shared_ptr<DowntimesTable> Ptr; DECLARE_PTR_TYPEDEFS(DowntimesTable);
typedef weak_ptr<DowntimesTable> WeakPtr;
DowntimesTable(void); DowntimesTable(void);

View File

@ -31,8 +31,7 @@ namespace livestatus
class Filter : public Object class Filter : public Object
{ {
public: public:
typedef shared_ptr<Filter> Ptr; DECLARE_PTR_TYPEDEFS(Filter);
typedef weak_ptr<Filter> WeakPtr;
virtual bool Apply(const Table::Ptr& table, const Object::Ptr& object) = 0; virtual bool Apply(const Table::Ptr& table, const Object::Ptr& object) = 0;

View File

@ -33,8 +33,7 @@ namespace livestatus
class HostsTable : public Table class HostsTable : public Table
{ {
public: public:
typedef shared_ptr<HostsTable> Ptr; DECLARE_PTR_TYPEDEFS(HostsTable);
typedef weak_ptr<HostsTable> WeakPtr;
HostsTable(void); HostsTable(void);

View File

@ -33,8 +33,7 @@ namespace livestatus
class NegateFilter : public Filter class NegateFilter : public Filter
{ {
public: public:
typedef shared_ptr<NegateFilter> Ptr; DECLARE_PTR_TYPEDEFS(NegateFilter);
typedef weak_ptr<NegateFilter> WeakPtr;
NegateFilter(const Filter::Ptr& inner); NegateFilter(const Filter::Ptr& inner);

View File

@ -33,8 +33,7 @@ namespace livestatus
class OrFilter : public CombinerFilter class OrFilter : public CombinerFilter
{ {
public: public:
typedef shared_ptr<OrFilter> Ptr; DECLARE_PTR_TYPEDEFS(OrFilter);
typedef weak_ptr<OrFilter> WeakPtr;
OrFilter(void); OrFilter(void);

View File

@ -37,8 +37,7 @@ namespace livestatus
class Query : public Object class Query : public Object
{ {
public: public:
typedef shared_ptr<Query> Ptr; DECLARE_PTR_TYPEDEFS(Query);
typedef weak_ptr<Query> WeakPtr;
Query(const std::vector<String>& lines); Query(const std::vector<String>& lines);

View File

@ -33,8 +33,7 @@ namespace livestatus
class ServicesTable : public Table class ServicesTable : public Table
{ {
public: public:
typedef shared_ptr<ServicesTable> Ptr; DECLARE_PTR_TYPEDEFS(ServicesTable);
typedef weak_ptr<ServicesTable> WeakPtr;
ServicesTable(void); ServicesTable(void);

View File

@ -33,8 +33,7 @@ namespace livestatus
class StatusTable : public Table class StatusTable : public Table
{ {
public: public:
typedef shared_ptr<StatusTable> Ptr; DECLARE_PTR_TYPEDEFS(StatusTable);
typedef weak_ptr<StatusTable> WeakPtr;
StatusTable(void); StatusTable(void);

View File

@ -36,8 +36,7 @@ class Filter;
class Table : public Object class Table : public Object
{ {
public: public:
typedef shared_ptr<Table> Ptr; DECLARE_PTR_TYPEDEFS(Table);
typedef weak_ptr<Table> WeakPtr;
typedef boost::function<void (const Object::Ptr&)> AddRowFunction; typedef boost::function<void (const Object::Ptr&)> AddRowFunction;

View File

@ -33,6 +33,8 @@ namespace icinga
class NotificationComponent : public DynamicObject class NotificationComponent : public DynamicObject
{ {
public: public:
DECLARE_PTR_TYPEDEFS(NotificationComponent);
NotificationComponent(const Dictionary::Ptr& serializedUpdate); NotificationComponent(const Dictionary::Ptr& serializedUpdate);
virtual void Start(void); virtual void Start(void);

View File

@ -32,6 +32,8 @@ namespace icinga
class ReplicationComponent : public DynamicObject class ReplicationComponent : public DynamicObject
{ {
public: public:
DECLARE_PTR_TYPEDEFS(ReplicationComponent);
ReplicationComponent(const Dictionary::Ptr& serializedUpdate); ReplicationComponent(const Dictionary::Ptr& serializedUpdate);
virtual void Start(void); virtual void Start(void);

View File

@ -35,8 +35,7 @@ class Component;
*/ */
class I2_BASE_API Application : public DynamicObject { class I2_BASE_API Application : public DynamicObject {
public: public:
typedef shared_ptr<Application> Ptr; DECLARE_PTR_TYPEDEFS(Application);
typedef weak_ptr<Application> WeakPtr;
explicit Application(const Dictionary::Ptr& serializedUpdate); explicit Application(const Dictionary::Ptr& serializedUpdate);
~Application(void); ~Application(void);

View File

@ -35,8 +35,7 @@ namespace icinga
class I2_BASE_API Array : public Object class I2_BASE_API Array : public Object
{ {
public: public:
typedef shared_ptr<Array> Ptr; DECLARE_PTR_TYPEDEFS(Array);
typedef weak_ptr<Array> WeakPtr;
/** /**
* An iterator that can be used to iterate over array elements. * An iterator that can be used to iterate over array elements.

View File

@ -35,8 +35,7 @@ namespace icinga
class I2_BASE_API BufferedStream : public Stream class I2_BASE_API BufferedStream : public Stream
{ {
public: public:
typedef shared_ptr<BufferedStream> Ptr; DECLARE_PTR_TYPEDEFS(BufferedStream);
typedef weak_ptr<BufferedStream> WeakPtr;
BufferedStream(const Stream::Ptr& innerStream); BufferedStream(const Stream::Ptr& innerStream);
~BufferedStream(void); ~BufferedStream(void);

View File

@ -34,8 +34,7 @@ namespace icinga
class I2_BASE_API ConsoleLogger : public StreamLogger class I2_BASE_API ConsoleLogger : public StreamLogger
{ {
public: public:
typedef shared_ptr<ConsoleLogger> Ptr; DECLARE_PTR_TYPEDEFS(ConsoleLogger);
typedef weak_ptr<ConsoleLogger> WeakPtr;
explicit ConsoleLogger(const Dictionary::Ptr& serializedUpdate); explicit ConsoleLogger(const Dictionary::Ptr& serializedUpdate);
}; };

View File

@ -36,8 +36,7 @@ namespace icinga
class I2_BASE_API Dictionary : public Object class I2_BASE_API Dictionary : public Object
{ {
public: public:
typedef shared_ptr<Dictionary> Ptr; DECLARE_PTR_TYPEDEFS(Dictionary);
typedef weak_ptr<Dictionary> WeakPtr;
/** /**
* An iterator that can be used to iterate over dictionary elements. * An iterator that can be used to iterate over dictionary elements.

View File

@ -42,8 +42,7 @@ class DynamicType;
class I2_BASE_API DynamicObject : public Object class I2_BASE_API DynamicObject : public Object
{ {
public: public:
typedef shared_ptr<DynamicObject> Ptr; DECLARE_PTR_TYPEDEFS(DynamicObject);
typedef weak_ptr<DynamicObject> WeakPtr;
typedef std::map<String, AttributeHolder, string_iless> AttributeMap; typedef std::map<String, AttributeHolder, string_iless> AttributeMap;
typedef AttributeMap::iterator AttributeIterator; typedef AttributeMap::iterator AttributeIterator;

View File

@ -34,8 +34,7 @@ namespace icinga
class I2_BASE_API DynamicType : public Object class I2_BASE_API DynamicType : public Object
{ {
public: public:
typedef shared_ptr<DynamicType> Ptr; DECLARE_PTR_TYPEDEFS(DynamicType);
typedef weak_ptr<DynamicType> WeakPtr;
typedef boost::function<DynamicObject::Ptr (const Dictionary::Ptr&)> ObjectFactory; typedef boost::function<DynamicObject::Ptr (const Dictionary::Ptr&)> ObjectFactory;

View File

@ -34,10 +34,9 @@ namespace icinga
class I2_BASE_API FIFO : public Stream class I2_BASE_API FIFO : public Stream
{ {
public: public:
static const size_t BlockSize = 16 * 1024; DECLARE_PTR_TYPEDEFS(FIFO);
typedef shared_ptr<FIFO> Ptr; static const size_t BlockSize = 16 * 1024;
typedef weak_ptr<FIFO> WeakPtr;
FIFO(void); FIFO(void);
~FIFO(void); ~FIFO(void);

View File

@ -34,8 +34,7 @@ namespace icinga
class I2_BASE_API FileLogger : public StreamLogger class I2_BASE_API FileLogger : public StreamLogger
{ {
public: public:
typedef shared_ptr<FileLogger> Ptr; DECLARE_PTR_TYPEDEFS(FileLogger);
typedef weak_ptr<FileLogger> WeakPtr;
explicit FileLogger(const Dictionary::Ptr& serializedUpdate); explicit FileLogger(const Dictionary::Ptr& serializedUpdate);

View File

@ -48,8 +48,7 @@ struct LogEntry {
class I2_BASE_API Logger : public DynamicObject class I2_BASE_API Logger : public DynamicObject
{ {
public: public:
typedef shared_ptr<Logger> Ptr; DECLARE_PTR_TYPEDEFS(Logger);
typedef weak_ptr<Logger> WeakPtr;
explicit Logger(const Dictionary::Ptr& serializedUpdate); explicit Logger(const Dictionary::Ptr& serializedUpdate);

View File

@ -35,8 +35,7 @@ namespace icinga
class I2_BASE_API NetworkStream : public Stream class I2_BASE_API NetworkStream : public Stream
{ {
public: public:
typedef shared_ptr<NetworkStream> Ptr; DECLARE_PTR_TYPEDEFS(NetworkStream);
typedef weak_ptr<NetworkStream> WeakPtr;
NetworkStream(const Socket::Ptr& socket); NetworkStream(const Socket::Ptr& socket);

View File

@ -44,6 +44,10 @@ namespace icinga
class Value; class Value;
#define DECLARE_PTR_TYPEDEFS(klass) \
typedef shared_ptr<klass> Ptr; \
typedef weak_ptr<klass> WeakPtr
/** /**
* Base class for all heap-allocated objects. At least one of its methods * Base class for all heap-allocated objects. At least one of its methods
* has to be virtual for RTTI to work. * has to be virtual for RTTI to work.
@ -53,8 +57,7 @@ class Value;
class I2_BASE_API Object : public boost::enable_shared_from_this<Object> class I2_BASE_API Object : public boost::enable_shared_from_this<Object>
{ {
public: public:
typedef shared_ptr<Object> Ptr; DECLARE_PTR_TYPEDEFS(Object);
typedef weak_ptr<Object> WeakPtr;
Object(void); Object(void);
virtual ~Object(void); virtual ~Object(void);

View File

@ -54,8 +54,7 @@ struct ProcessResult
class I2_BASE_API Process : public Object class I2_BASE_API Process : public Object
{ {
public: public:
typedef shared_ptr<Process> Ptr; DECLARE_PTR_TYPEDEFS(Process);
typedef weak_ptr<Process> WeakPtr;
static const std::deque<Process::Ptr>::size_type MaxTasksPerThread = 512; static const std::deque<Process::Ptr>::size_type MaxTasksPerThread = 512;

View File

@ -35,8 +35,7 @@ namespace icinga
class I2_BASE_API RingBuffer : public Object class I2_BASE_API RingBuffer : public Object
{ {
public: public:
typedef shared_ptr<RingBuffer> Ptr; DECLARE_PTR_TYPEDEFS(RingBuffer);
typedef weak_ptr<RingBuffer> WeakPtr;
typedef std::vector<int>::size_type SizeType; typedef std::vector<int>::size_type SizeType;

View File

@ -36,8 +36,7 @@ class ScriptInterpreter;
class I2_BASE_API Script : public DynamicObject class I2_BASE_API Script : public DynamicObject
{ {
public: public:
typedef shared_ptr<Script> Ptr; DECLARE_PTR_TYPEDEFS(Script);
typedef weak_ptr<Script> WeakPtr;
Script(const Dictionary::Ptr& serializedUpdate); Script(const Dictionary::Ptr& serializedUpdate);

View File

@ -38,8 +38,7 @@ namespace icinga
class I2_BASE_API ScriptFunction : public Object class I2_BASE_API ScriptFunction : public Object
{ {
public: public:
typedef shared_ptr<ScriptFunction> Ptr; DECLARE_PTR_TYPEDEFS(ScriptFunction);
typedef weak_ptr<ScriptFunction> WeakPtr;
typedef boost::function<Value (const std::vector<Value>& arguments)> Callback; typedef boost::function<Value (const std::vector<Value>& arguments)> Callback;

View File

@ -36,8 +36,7 @@ namespace icinga
class I2_BASE_API ScriptInterpreter : public Object class I2_BASE_API ScriptInterpreter : public Object
{ {
public: public:
typedef shared_ptr<ScriptInterpreter> Ptr; DECLARE_PTR_TYPEDEFS(ScriptInterpreter);
typedef weak_ptr<ScriptInterpreter> WeakPtr;
~ScriptInterpreter(void); ~ScriptInterpreter(void);

View File

@ -35,8 +35,7 @@ namespace icinga
class I2_BASE_API ScriptLanguage : public Object class I2_BASE_API ScriptLanguage : public Object
{ {
public: public:
typedef shared_ptr<ScriptLanguage> Ptr; DECLARE_PTR_TYPEDEFS(ScriptLanguage);
typedef weak_ptr<ScriptLanguage> WeakPtr;
static void Register(const String& name, const ScriptLanguage::Ptr& language); static void Register(const String& name, const ScriptLanguage::Ptr& language);
static void Unregister(const String& name); static void Unregister(const String& name);

View File

@ -37,8 +37,7 @@ namespace icinga {
class I2_BASE_API Socket : public Object class I2_BASE_API Socket : public Object
{ {
public: public:
typedef shared_ptr<Socket> Ptr; DECLARE_PTR_TYPEDEFS(Socket);
typedef weak_ptr<Socket> WeakPtr;
Socket(void); Socket(void);
Socket(SOCKET fd); Socket(SOCKET fd);

View File

@ -29,8 +29,7 @@ namespace icinga {
class StdioStream : public Stream class StdioStream : public Stream
{ {
public: public:
typedef shared_ptr<StdioStream> Ptr; DECLARE_PTR_TYPEDEFS(StdioStream);
typedef weak_ptr<StdioStream> WeakPtr;
StdioStream(std::iostream *innerStream, bool ownsStream); StdioStream(std::iostream *innerStream, bool ownsStream);
~StdioStream(void); ~StdioStream(void);

View File

@ -48,8 +48,7 @@ struct ReadLineContext
class I2_BASE_API Stream : public Object class I2_BASE_API Stream : public Object
{ {
public: public:
typedef shared_ptr<Stream> Ptr; DECLARE_PTR_TYPEDEFS(Stream);
typedef weak_ptr<Stream> WeakPtr;
/** /**
* Reads data from the stream. * Reads data from the stream.

View File

@ -35,8 +35,7 @@ namespace icinga
class I2_BASE_API StreamLogger : public Logger class I2_BASE_API StreamLogger : public Logger
{ {
public: public:
typedef shared_ptr<StreamLogger> Ptr; DECLARE_PTR_TYPEDEFS(StreamLogger);
typedef weak_ptr<StreamLogger> WeakPtr;
StreamLogger(const Dictionary::Ptr& serializedUpdate); StreamLogger(const Dictionary::Ptr& serializedUpdate);
~StreamLogger(void); ~StreamLogger(void);

View File

@ -35,8 +35,7 @@ namespace icinga
class I2_BASE_API SyslogLogger : public Logger class I2_BASE_API SyslogLogger : public Logger
{ {
public: public:
typedef shared_ptr<SyslogLogger> Ptr; DECLARE_PTR_TYPEDEFS(SyslogLogger);
typedef weak_ptr<SyslogLogger> WeakPtr;
explicit SyslogLogger(const Dictionary::Ptr& serializedUpdate); explicit SyslogLogger(const Dictionary::Ptr& serializedUpdate);

View File

@ -34,8 +34,7 @@ namespace icinga
class I2_BASE_API TcpSocket : public Socket class I2_BASE_API TcpSocket : public Socket
{ {
public: public:
typedef shared_ptr<TcpSocket> Ptr; DECLARE_PTR_TYPEDEFS(TcpSocket);
typedef weak_ptr<TcpSocket> WeakPtr;
void Bind(const String& service, int family); void Bind(const String& service, int family);
void Bind(const String& node, const String& service, int family); void Bind(const String& node, const String& service, int family);

View File

@ -36,8 +36,7 @@ struct TimerNextExtractor;
class I2_BASE_API Timer : public Object class I2_BASE_API Timer : public Object
{ {
public: public:
typedef shared_ptr<Timer> Ptr; DECLARE_PTR_TYPEDEFS(Timer);
typedef weak_ptr<Timer> WeakPtr;
Timer(void); Timer(void);

View File

@ -43,8 +43,7 @@ enum TlsRole
class I2_BASE_API TlsStream : public Stream class I2_BASE_API TlsStream : public Stream
{ {
public: public:
typedef shared_ptr<TlsStream> Ptr; DECLARE_PTR_TYPEDEFS(TlsStream);
typedef weak_ptr<TlsStream> WeakPtr;
TlsStream(const Stream::Ptr& innerStream, TlsRole role, shared_ptr<SSL_CTX> sslContext); TlsStream(const Stream::Ptr& innerStream, TlsRole role, shared_ptr<SSL_CTX> sslContext);

View File

@ -30,8 +30,7 @@ namespace icinga
class UnixSocket : public Socket class UnixSocket : public Socket
{ {
public: public:
typedef shared_ptr<UnixSocket> Ptr; DECLARE_PTR_TYPEDEFS(UnixSocket);
typedef weak_ptr<UnixSocket> WeakPtr;
UnixSocket(void); UnixSocket(void);

View File

@ -35,8 +35,7 @@ namespace icinga
*/ */
class I2_CONFIG_API ConfigItem : public Object { class I2_CONFIG_API ConfigItem : public Object {
public: public:
typedef shared_ptr<ConfigItem> Ptr; DECLARE_PTR_TYPEDEFS(ConfigItem);
typedef weak_ptr<ConfigItem> WeakPtr;
ConfigItem(const String& type, const String& name, const String& unit, ConfigItem(const String& type, const String& name, const String& unit,
bool abstract, const ExpressionList::Ptr& exprl, const std::vector<String>& parents, bool abstract, const ExpressionList::Ptr& exprl, const std::vector<String>& parents,

View File

@ -38,8 +38,7 @@ namespace icinga
class I2_CONFIG_API ConfigItemBuilder : public Object class I2_CONFIG_API ConfigItemBuilder : public Object
{ {
public: public:
typedef shared_ptr<ConfigItemBuilder> Ptr; DECLARE_PTR_TYPEDEFS(ConfigItemBuilder);
typedef weak_ptr<ConfigItemBuilder> WeakPtr;
ConfigItemBuilder(void); ConfigItemBuilder(void);
explicit ConfigItemBuilder(const DebugInfo& debugInfo); explicit ConfigItemBuilder(const DebugInfo& debugInfo);

View File

@ -36,8 +36,7 @@ namespace icinga
*/ */
class I2_CONFIG_API ConfigType : public Object { class I2_CONFIG_API ConfigType : public Object {
public: public:
typedef shared_ptr<ConfigType> Ptr; DECLARE_PTR_TYPEDEFS(ConfigType);
typedef weak_ptr<ConfigType> WeakPtr;
ConfigType(const String& name, const DebugInfo& debuginfo); ConfigType(const String& name, const DebugInfo& debuginfo);

View File

@ -36,8 +36,7 @@ namespace icinga
class I2_CONFIG_API ExpressionList : public Object class I2_CONFIG_API ExpressionList : public Object
{ {
public: public:
typedef shared_ptr<ExpressionList> Ptr; DECLARE_PTR_TYPEDEFS(ExpressionList);
typedef weak_ptr<ExpressionList> WeakPtr;
void AddExpression(const Expression& expression); void AddExpression(const Expression& expression);

View File

@ -47,8 +47,7 @@ enum TypeValidationResult
class I2_CONFIG_API TypeRuleList : public Object class I2_CONFIG_API TypeRuleList : public Object
{ {
public: public:
typedef shared_ptr<TypeRuleList> Ptr; DECLARE_PTR_TYPEDEFS(TypeRuleList);
typedef weak_ptr<TypeRuleList> WeakPtr;
void SetValidator(const String& validator); void SetValidator(const String& validator);
String GetValidator(void) const; String GetValidator(void) const;

View File

@ -34,8 +34,7 @@ namespace icinga
class I2_BASE_API CheckCommand : public Command class I2_BASE_API CheckCommand : public Command
{ {
public: public:
typedef shared_ptr<CheckCommand> Ptr; DECLARE_PTR_TYPEDEFS(CheckCommand);
typedef weak_ptr<CheckCommand> WeakPtr;
explicit CheckCommand(const Dictionary::Ptr& serializedUpdate); explicit CheckCommand(const Dictionary::Ptr& serializedUpdate);

View File

@ -38,8 +38,7 @@ namespace icinga
class I2_BASE_API Command : public DynamicObject, public MacroResolver class I2_BASE_API Command : public DynamicObject, public MacroResolver
{ {
public: public:
typedef shared_ptr<Command> Ptr; DECLARE_PTR_TYPEDEFS(Command);
typedef weak_ptr<Command> WeakPtr;
explicit Command(const Dictionary::Ptr& serializedUpdate); explicit Command(const Dictionary::Ptr& serializedUpdate);

View File

@ -34,8 +34,7 @@ namespace icinga
class I2_BASE_API EventCommand : public Command class I2_BASE_API EventCommand : public Command
{ {
public: public:
typedef shared_ptr<EventCommand> Ptr; DECLARE_PTR_TYPEDEFS(EventCommand);
typedef weak_ptr<EventCommand> WeakPtr;
explicit EventCommand(const Dictionary::Ptr& serializedUpdate); explicit EventCommand(const Dictionary::Ptr& serializedUpdate);

View File

@ -77,8 +77,7 @@ enum StateType
class I2_ICINGA_API Host : public DynamicObject, public MacroResolver class I2_ICINGA_API Host : public DynamicObject, public MacroResolver
{ {
public: public:
typedef shared_ptr<Host> Ptr; DECLARE_PTR_TYPEDEFS(Host);
typedef weak_ptr<Host> WeakPtr;
explicit Host(const Dictionary::Ptr& serializedUpdate); explicit Host(const Dictionary::Ptr& serializedUpdate);
~Host(void); ~Host(void);

View File

@ -36,8 +36,7 @@ namespace icinga
class I2_ICINGA_API HostGroup : public DynamicObject class I2_ICINGA_API HostGroup : public DynamicObject
{ {
public: public:
typedef shared_ptr<HostGroup> Ptr; DECLARE_PTR_TYPEDEFS(HostGroup);
typedef weak_ptr<HostGroup> WeakPtr;
explicit HostGroup(const Dictionary::Ptr& serializedUpdate); explicit HostGroup(const Dictionary::Ptr& serializedUpdate);
~HostGroup(void); ~HostGroup(void);

View File

@ -36,8 +36,7 @@ namespace icinga
class I2_ICINGA_API IcingaApplication : public Application, public MacroResolver class I2_ICINGA_API IcingaApplication : public Application, public MacroResolver
{ {
public: public:
typedef shared_ptr<IcingaApplication> Ptr; DECLARE_PTR_TYPEDEFS(IcingaApplication);
typedef weak_ptr<IcingaApplication> WeakPtr;
explicit IcingaApplication(const Dictionary::Ptr& serializedUpdate); explicit IcingaApplication(const Dictionary::Ptr& serializedUpdate);

View File

@ -35,8 +35,7 @@ namespace icinga
class I2_ICINGA_API MacroResolver class I2_ICINGA_API MacroResolver
{ {
public: public:
typedef shared_ptr<MacroResolver> Ptr; DECLARE_PTR_TYPEDEFS(MacroResolver);
typedef weak_ptr<MacroResolver> WeakPtr;
virtual bool ResolveMacro(const String& macro, const Dictionary::Ptr& cr, String *result) const = 0; virtual bool ResolveMacro(const String& macro, const Dictionary::Ptr& cr, String *result) const = 0;
}; };
@ -44,8 +43,7 @@ public:
class I2_ICINGA_API StaticMacroResolver : public Object, public MacroResolver class I2_ICINGA_API StaticMacroResolver : public Object, public MacroResolver
{ {
public: public:
typedef shared_ptr<StaticMacroResolver> Ptr; DECLARE_PTR_TYPEDEFS(StaticMacroResolver);
typedef weak_ptr<StaticMacroResolver> WeakPtr;
StaticMacroResolver(void); StaticMacroResolver(void);

View File

@ -58,8 +58,7 @@ class NotificationCommand;
class I2_ICINGA_API Notification : public DynamicObject, public MacroResolver class I2_ICINGA_API Notification : public DynamicObject, public MacroResolver
{ {
public: public:
typedef shared_ptr<Notification> Ptr; DECLARE_PTR_TYPEDEFS(Notification);
typedef weak_ptr<Notification> WeakPtr;
explicit Notification(const Dictionary::Ptr& serializedUpdate); explicit Notification(const Dictionary::Ptr& serializedUpdate);
~Notification(void); ~Notification(void);

View File

@ -36,8 +36,7 @@ class Notification;
class I2_BASE_API NotificationCommand : public Command class I2_BASE_API NotificationCommand : public Command
{ {
public: public:
typedef shared_ptr<NotificationCommand> Ptr; DECLARE_PTR_TYPEDEFS(NotificationCommand);
typedef weak_ptr<NotificationCommand> WeakPtr;
explicit NotificationCommand(const Dictionary::Ptr& serializedUpdate); explicit NotificationCommand(const Dictionary::Ptr& serializedUpdate);

View File

@ -37,8 +37,7 @@ namespace icinga
class I2_ICINGA_API PerfdataWriter : public DynamicObject class I2_ICINGA_API PerfdataWriter : public DynamicObject
{ {
public: public:
typedef shared_ptr<PerfdataWriter> Ptr; DECLARE_PTR_TYPEDEFS(PerfdataWriter);
typedef weak_ptr<PerfdataWriter> WeakPtr;
PerfdataWriter(const Dictionary::Ptr& properties); PerfdataWriter(const Dictionary::Ptr& properties);

View File

@ -96,8 +96,7 @@ class EventCommand;
class I2_ICINGA_API Service : public DynamicObject, public MacroResolver class I2_ICINGA_API Service : public DynamicObject, public MacroResolver
{ {
public: public:
typedef shared_ptr<Service> Ptr; DECLARE_PTR_TYPEDEFS(Service);
typedef weak_ptr<Service> WeakPtr;
explicit Service(const Dictionary::Ptr& serializedUpdate); explicit Service(const Dictionary::Ptr& serializedUpdate);
~Service(void); ~Service(void);

View File

@ -36,8 +36,7 @@ namespace icinga
class I2_ICINGA_API ServiceGroup : public DynamicObject class I2_ICINGA_API ServiceGroup : public DynamicObject
{ {
public: public:
typedef shared_ptr<ServiceGroup> Ptr; DECLARE_PTR_TYPEDEFS(ServiceGroup);
typedef weak_ptr<ServiceGroup> WeakPtr;
explicit ServiceGroup(const Dictionary::Ptr& serializedUpdate); explicit ServiceGroup(const Dictionary::Ptr& serializedUpdate);
~ServiceGroup(void); ~ServiceGroup(void);

View File

@ -35,8 +35,7 @@ namespace icinga
class I2_ICINGA_API TimePeriod : public DynamicObject class I2_ICINGA_API TimePeriod : public DynamicObject
{ {
public: public:
typedef shared_ptr<TimePeriod> Ptr; DECLARE_PTR_TYPEDEFS(TimePeriod);
typedef weak_ptr<TimePeriod> WeakPtr;
explicit TimePeriod(const Dictionary::Ptr& serializedUpdate); explicit TimePeriod(const Dictionary::Ptr& serializedUpdate);

View File

@ -37,8 +37,7 @@ namespace icinga
class I2_ICINGA_API User : public DynamicObject, public MacroResolver class I2_ICINGA_API User : public DynamicObject, public MacroResolver
{ {
public: public:
typedef shared_ptr<User> Ptr; DECLARE_PTR_TYPEDEFS(User);
typedef weak_ptr<User> WeakPtr;
explicit User(const Dictionary::Ptr& serializedUpdate); explicit User(const Dictionary::Ptr& serializedUpdate);
~User(void); ~User(void);

View File

@ -35,8 +35,7 @@ namespace icinga
class I2_ICINGA_API UserGroup : public DynamicObject class I2_ICINGA_API UserGroup : public DynamicObject
{ {
public: public:
typedef shared_ptr<UserGroup> Ptr; DECLARE_PTR_TYPEDEFS(UserGroup);
typedef weak_ptr<UserGroup> WeakPtr;
explicit UserGroup(const Dictionary::Ptr& serializedUpdate); explicit UserGroup(const Dictionary::Ptr& serializedUpdate);
~UserGroup(void); ~UserGroup(void);

View File

@ -35,8 +35,7 @@ namespace icinga
class PythonInterpreter : public ScriptInterpreter class PythonInterpreter : public ScriptInterpreter
{ {
public: public:
typedef shared_ptr<PythonInterpreter> Ptr; DECLARE_PTR_TYPEDEFS(PythonInterpreter);
typedef weak_ptr<PythonInterpreter> WeakPtr;
PythonInterpreter(const PythonLanguage::Ptr& language, const Script::Ptr& script); PythonInterpreter(const PythonLanguage::Ptr& language, const Script::Ptr& script);
~PythonInterpreter(void); ~PythonInterpreter(void);

View File

@ -36,8 +36,7 @@ class PythonInterpreter;
class PythonLanguage : public ScriptLanguage class PythonLanguage : public ScriptLanguage
{ {
public: public:
typedef shared_ptr<PythonLanguage> Ptr; DECLARE_PTR_TYPEDEFS(PythonLanguage);
typedef weak_ptr<PythonLanguage> WeakPtr;
PythonLanguage(void); PythonLanguage(void);
~PythonLanguage(void); ~PythonLanguage(void);

View File

@ -40,8 +40,7 @@ class EndpointManager;
class I2_REMOTING_API Endpoint : public DynamicObject class I2_REMOTING_API Endpoint : public DynamicObject
{ {
public: public:
typedef shared_ptr<Endpoint> Ptr; DECLARE_PTR_TYPEDEFS(Endpoint);
typedef weak_ptr<Endpoint> WeakPtr;
typedef void (Callback)(const Endpoint::Ptr&, const Endpoint::Ptr&, const RequestMessage&); typedef void (Callback)(const Endpoint::Ptr&, const Endpoint::Ptr&, const RequestMessage&);

View File

@ -39,8 +39,7 @@ namespace icinga
class I2_REMOTING_API EndpointManager : public Object class I2_REMOTING_API EndpointManager : public Object
{ {
public: public:
typedef shared_ptr<EndpointManager> Ptr; DECLARE_PTR_TYPEDEFS(EndpointManager);
typedef weak_ptr<EndpointManager> WeakPtr;
EndpointManager(void); EndpointManager(void);