mirror of https://github.com/Icinga/icinga2.git
Implement typeof() function
This commit is contained in:
parent
0f4e3004b6
commit
170c5a59e4
|
@ -36,7 +36,7 @@ namespace icinga
|
|||
*/
|
||||
class I2_BASE_API Application : public ObjectImpl<Application> {
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Application);
|
||||
DECLARE_OBJECT(Application);
|
||||
|
||||
static boost::signals2::signal<void (void)> OnReopenLogs;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace icinga
|
|||
class I2_BASE_API Array : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Array);
|
||||
DECLARE_OBJECT(Array);
|
||||
|
||||
/**
|
||||
* An iterator that can be used to iterate over array elements.
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace icinga
|
|||
class I2_BASE_API Dictionary : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Dictionary);
|
||||
DECLARE_OBJECT(Dictionary);
|
||||
|
||||
/**
|
||||
* An iterator that can be used to iterate over dictionary elements.
|
||||
|
|
|
@ -42,7 +42,7 @@ class DynamicType;
|
|||
class I2_BASE_API DynamicObject : public ObjectImpl<DynamicObject>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(DynamicObject);
|
||||
DECLARE_OBJECT(DynamicObject);
|
||||
|
||||
static boost::signals2::signal<void (const DynamicObject::Ptr&)> OnStarted;
|
||||
static boost::signals2::signal<void (const DynamicObject::Ptr&)> OnStopped;
|
||||
|
@ -101,7 +101,7 @@ private:
|
|||
DebugInfo m_DebugInfo;
|
||||
};
|
||||
|
||||
#define DECLARE_TYPENAME(klass) \
|
||||
#define DECLARE_OBJECTNAME(klass) \
|
||||
inline static String GetTypeName(void) \
|
||||
{ \
|
||||
return #klass; \
|
||||
|
|
|
@ -37,7 +37,7 @@ DynamicType::Ptr DynamicType::GetByName(const String& name)
|
|||
DynamicType::TypeMap::const_iterator tt = InternalGetTypeMap().find(name);
|
||||
|
||||
if (tt == InternalGetTypeMap().end()) {
|
||||
const Type *type = Type::GetByName(name);
|
||||
Type::Ptr type = Type::GetByName(name);
|
||||
|
||||
if (!type || !Type::GetByName("DynamicObject")->IsAssignableFrom(type)
|
||||
|| type->IsAbstract())
|
||||
|
@ -127,7 +127,7 @@ DynamicObject::Ptr DynamicType::CreateObject(const Dictionary::Ptr& serializedUp
|
|||
{
|
||||
ASSERT(!OwnsLock());
|
||||
|
||||
const Type *type = Type::GetByName(m_Name);
|
||||
Type::Ptr type = Type::GetByName(m_Name);
|
||||
|
||||
Object::Ptr object = type->Instantiate();
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ class DynamicTypeIterator;
|
|||
class I2_BASE_API DynamicType : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(DynamicType);
|
||||
DECLARE_OBJECT(DynamicType);
|
||||
|
||||
DynamicType(const String& name);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace icinga
|
|||
class I2_BASE_API FIFO : public Stream
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(FIFO);
|
||||
DECLARE_OBJECT(FIFO);
|
||||
|
||||
static const size_t BlockSize = 16 * 1024;
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ namespace icinga
|
|||
class I2_BASE_API FileLogger : public ObjectImpl<FileLogger>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(FileLogger);
|
||||
DECLARE_TYPENAME(FileLogger);
|
||||
DECLARE_OBJECT(FileLogger);
|
||||
DECLARE_OBJECTNAME(FileLogger);
|
||||
|
||||
static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ struct LogEntry {
|
|||
class I2_BASE_API Logger : public ObjectImpl<Logger>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Logger);
|
||||
DECLARE_OBJECT(Logger);
|
||||
|
||||
static String SeverityToString(LogSeverity severity);
|
||||
static LogSeverity StringToSeverity(const String& severity);
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace icinga
|
|||
class I2_BASE_API NetworkStream : public Stream
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(NetworkStream);
|
||||
DECLARE_OBJECT(NetworkStream);
|
||||
|
||||
NetworkStream(const Socket::Ptr& socket);
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
|
||||
using namespace icinga;
|
||||
|
||||
REGISTER_PRIMITIVE_TYPE(Object);
|
||||
|
||||
#ifdef _DEBUG
|
||||
boost::mutex Object::m_DebugMutex;
|
||||
#endif /* _DEBUG */
|
||||
|
@ -70,11 +72,6 @@ Object::SharedPtrHolder::operator Value(void) const
|
|||
return m_Object;
|
||||
}
|
||||
|
||||
const Type *Object::GetReflectionType(void) const
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void Object::SetField(int, const Value&)
|
||||
{
|
||||
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
|
||||
|
@ -85,3 +82,8 @@ Value Object::GetField(int) const
|
|||
BOOST_THROW_EXCEPTION(std::runtime_error("Invalid field ID."));
|
||||
}
|
||||
|
||||
Type::Ptr icinga::LookupType(const char *name)
|
||||
{
|
||||
return Type::GetByName(name);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,8 +53,20 @@ class Value;
|
|||
typedef shared_ptr<klass> Ptr; \
|
||||
typedef weak_ptr<klass> WeakPtr
|
||||
|
||||
#define IMPL_TYPE_LOOKUP(klass) \
|
||||
inline virtual shared_ptr<Type> GetReflectionType(void) const \
|
||||
{ \
|
||||
return LookupType(#klass); \
|
||||
}
|
||||
|
||||
#define DECLARE_OBJECT(klass) \
|
||||
DECLARE_PTR_TYPEDEFS(klass); \
|
||||
IMPL_TYPE_LOOKUP(klass);
|
||||
|
||||
class Type;
|
||||
|
||||
I2_BASE_API shared_ptr<Type> LookupType(const char *name);
|
||||
|
||||
/**
|
||||
* Base class for all heap-allocated objects. At least one of its methods
|
||||
* has to be virtual for RTTI to work.
|
||||
|
@ -64,12 +76,11 @@ class Type;
|
|||
class I2_BASE_API Object : public enable_shared_from_this<Object>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Object);
|
||||
DECLARE_OBJECT(Object);
|
||||
|
||||
Object(void);
|
||||
virtual ~Object(void);
|
||||
|
||||
virtual const Type *GetReflectionType(void) const;
|
||||
virtual void SetField(int id, const Value& value);
|
||||
virtual Value GetField(int id) const;
|
||||
|
||||
|
|
|
@ -34,9 +34,9 @@ String PrimitiveType::GetName(void) const
|
|||
return m_Name;
|
||||
}
|
||||
|
||||
const Type *PrimitiveType::GetBaseType(void) const
|
||||
Type::Ptr PrimitiveType::GetBaseType(void) const
|
||||
{
|
||||
return NULL;
|
||||
return Type::Ptr();
|
||||
}
|
||||
|
||||
int PrimitiveType::GetAttributes(void) const
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
PrimitiveType(const String& name);
|
||||
|
||||
virtual String GetName(void) const;
|
||||
virtual const Type *GetBaseType(void) const;
|
||||
virtual Type::Ptr GetBaseType(void) const;
|
||||
virtual int GetAttributes(void) const;
|
||||
virtual int GetFieldId(const String& name) const;
|
||||
virtual Field GetFieldInfo(int id) const;
|
||||
|
@ -47,7 +47,7 @@ private:
|
|||
namespace { namespace UNIQUE_NAME(prt) { \
|
||||
void RegisterPrimitiveType ## type(void) \
|
||||
{ \
|
||||
icinga::Type *t = new PrimitiveType(#type); \
|
||||
icinga::Type::Ptr t = make_shared<PrimitiveType>(#type); \
|
||||
icinga::Type::Register(t); \
|
||||
} \
|
||||
\
|
||||
|
|
|
@ -53,7 +53,7 @@ struct ProcessResult
|
|||
class I2_BASE_API Process : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Process);
|
||||
DECLARE_OBJECT(Process);
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef String Arguments;
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace icinga
|
|||
class I2_BASE_API RingBuffer : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(RingBuffer);
|
||||
DECLARE_OBJECT(RingBuffer);
|
||||
|
||||
typedef std::vector<int>::size_type SizeType;
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace icinga
|
|||
class I2_BASE_API ScriptFunction : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(ScriptFunction);
|
||||
DECLARE_OBJECT(ScriptFunction);
|
||||
|
||||
typedef boost::function<Value (const std::vector<Value>& arguments)> Callback;
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ REGISTER_SCRIPTFUNCTION(intersection, &ScriptUtils::Intersection);
|
|||
REGISTER_SCRIPTFUNCTION(log, &ScriptUtils::Log);
|
||||
REGISTER_SCRIPTFUNCTION(range, &ScriptUtils::Range);
|
||||
REGISTER_SCRIPTFUNCTION(exit, &ScriptUtils::Exit);
|
||||
REGISTER_SCRIPTFUNCTION(typeof, &ScriptUtils::TypeOf);
|
||||
|
||||
bool ScriptUtils::Regex(const String& pattern, const String& text)
|
||||
{
|
||||
|
@ -179,3 +180,19 @@ void ScriptUtils::Exit(int code)
|
|||
{
|
||||
exit(code);
|
||||
}
|
||||
|
||||
Type::Ptr ScriptUtils::TypeOf(const Value& value)
|
||||
{
|
||||
switch (value.GetType()) {
|
||||
case ValueEmpty:
|
||||
return Type::GetByName("Object");
|
||||
case ValueNumber:
|
||||
return Type::GetByName("double");
|
||||
case ValueString:
|
||||
return Type::GetByName("String");
|
||||
case ValueObject:
|
||||
return static_cast<Object::Ptr>(value)->GetReflectionType();
|
||||
default:
|
||||
VERIFY(!"Invalid value type.");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
static void Log(const std::vector<Value>& arguments);
|
||||
static Array::Ptr Range(const std::vector<Value>& arguments);
|
||||
static void Exit(int code);
|
||||
static Type::Ptr TypeOf(const Value& value);
|
||||
|
||||
private:
|
||||
ScriptUtils(void);
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
class I2_BASE_API ScriptVariable : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(ScriptVariable);
|
||||
DECLARE_OBJECT(ScriptVariable);
|
||||
|
||||
ScriptVariable(const Value& data);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ static Dictionary::Ptr SerializeDictionary(const Dictionary::Ptr& input, int att
|
|||
|
||||
static Object::Ptr SerializeObject(const Object::Ptr& input, int attributeTypes)
|
||||
{
|
||||
const Type *type = input->GetReflectionType();
|
||||
Type::Ptr type = input->GetReflectionType();
|
||||
|
||||
VERIFY(type);
|
||||
|
||||
|
@ -101,11 +101,11 @@ static Dictionary::Ptr DeserializeDictionary(const Dictionary::Ptr& input, bool
|
|||
|
||||
static Object::Ptr DeserializeObject(const Object::Ptr& object, const Dictionary::Ptr& input, bool safe_mode, int attributeTypes)
|
||||
{
|
||||
const Type *type;
|
||||
|
||||
if (!object && safe_mode)
|
||||
BOOST_THROW_EXCEPTION(std::runtime_error("Tried to instantiate object while safe mode is enabled."));
|
||||
|
||||
Type::Ptr type;
|
||||
|
||||
if (object)
|
||||
type = object->GetReflectionType();
|
||||
else
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace icinga
|
|||
class I2_BASE_API Socket : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Socket);
|
||||
DECLARE_OBJECT(Socket);
|
||||
|
||||
Socket(void);
|
||||
Socket(SOCKET fd);
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace icinga
|
|||
class I2_BASE_API StatsFunction : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(StatsFunction);
|
||||
DECLARE_OBJECT(StatsFunction);
|
||||
|
||||
typedef boost::function<Value (Dictionary::Ptr& status, Array::Ptr& perfdata)> Callback;
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace icinga {
|
|||
class I2_BASE_API StdioStream : public Stream
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(StdioStream);
|
||||
DECLARE_OBJECT(StdioStream);
|
||||
|
||||
StdioStream(std::iostream *innerStream, bool ownsStream);
|
||||
~StdioStream(void);
|
||||
|
|
|
@ -54,7 +54,7 @@ struct ReadLineContext
|
|||
class I2_BASE_API Stream : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Stream);
|
||||
DECLARE_OBJECT(Stream);
|
||||
|
||||
/**
|
||||
* Reads data from the stream.
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace icinga
|
|||
class I2_BASE_API StreamLogger : public ObjectImpl<StreamLogger>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(StreamLogger);
|
||||
DECLARE_OBJECT(StreamLogger);
|
||||
|
||||
virtual void Start(void);
|
||||
virtual void Stop(void);
|
||||
|
|
|
@ -35,8 +35,8 @@ namespace icinga
|
|||
class I2_BASE_API SyslogLogger : public ObjectImpl<SyslogLogger>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(SyslogLogger);
|
||||
DECLARE_TYPENAME(SyslogLogger);
|
||||
DECLARE_OBJECT(SyslogLogger);
|
||||
DECLARE_OBJECTNAME(SyslogLogger);
|
||||
|
||||
static Value StatsFunc(Dictionary::Ptr& status, Array::Ptr& perfdata);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace icinga
|
|||
class I2_BASE_API TcpSocket : public Socket
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(TcpSocket);
|
||||
DECLARE_OBJECT(TcpSocket);
|
||||
|
||||
void Bind(const String& service, int family);
|
||||
void Bind(const String& node, const String& service, int family);
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace icinga {
|
|||
class I2_BASE_API Timer : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Timer);
|
||||
DECLARE_OBJECT(Timer);
|
||||
|
||||
Timer(void);
|
||||
~Timer(void);
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace icinga
|
|||
class I2_BASE_API TlsStream : public Stream
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(TlsStream);
|
||||
DECLARE_OBJECT(TlsStream);
|
||||
|
||||
TlsStream(const Socket::Ptr& socket, ConnectionRole role, const shared_ptr<SSL_CTX>& sslContext);
|
||||
|
||||
|
|
|
@ -28,21 +28,21 @@ Type::TypeMap& Type::GetTypes(void)
|
|||
return types;
|
||||
}
|
||||
|
||||
void Type::Register(const Type *type)
|
||||
void Type::Register(const Type::Ptr& type)
|
||||
{
|
||||
VERIFY(GetByName(type->GetName()) == NULL);
|
||||
|
||||
GetTypes()[type->GetName()] = type;
|
||||
}
|
||||
|
||||
const Type *Type::GetByName(const String& name)
|
||||
Type::Ptr Type::GetByName(const String& name)
|
||||
{
|
||||
std::map<String, const Type *>::const_iterator it;
|
||||
std::map<String, Type::Ptr>::const_iterator it;
|
||||
|
||||
it = GetTypes().find(name);
|
||||
|
||||
if (it == GetTypes().end())
|
||||
return NULL;
|
||||
return Type::Ptr();
|
||||
|
||||
return it->second;
|
||||
}
|
||||
|
@ -57,10 +57,10 @@ bool Type::IsAbstract(void) const
|
|||
return ((GetAttributes() & TAAbstract) != 0);
|
||||
}
|
||||
|
||||
bool Type::IsAssignableFrom(const Type *other) const
|
||||
bool Type::IsAssignableFrom(const Type::Ptr& other) const
|
||||
{
|
||||
for (const Type *t = other; t; t = t->GetBaseType()) {
|
||||
if (t == this)
|
||||
for (Type::Ptr t = other; t; t = t->GetBaseType()) {
|
||||
if (t.get() == this)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,11 +42,11 @@ class Type;
|
|||
struct Field
|
||||
{
|
||||
int ID;
|
||||
const Type *FType;
|
||||
shared_ptr<Type> FType;
|
||||
const char *Name;
|
||||
int Attributes;
|
||||
|
||||
Field(int id, const Type *type, const char *name, int attributes)
|
||||
Field(int id, const shared_ptr<Type>& type, const char *name, int attributes)
|
||||
: ID(id), FType(type), Name(name), Attributes(attributes)
|
||||
{ }
|
||||
};
|
||||
|
@ -56,13 +56,15 @@ enum TypeAttribute
|
|||
TAAbstract = 1
|
||||
};
|
||||
|
||||
class I2_BASE_API Type
|
||||
class I2_BASE_API Type : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_OBJECT(Type);
|
||||
|
||||
typedef boost::function<Object::Ptr (void)> Factory;
|
||||
|
||||
virtual String GetName(void) const = 0;
|
||||
virtual const Type *GetBaseType(void) const = 0;
|
||||
virtual Type::Ptr GetBaseType(void) const = 0;
|
||||
virtual int GetAttributes(void) const = 0;
|
||||
virtual int GetFieldId(const String& name) const = 0;
|
||||
virtual Field GetFieldInfo(int id) const = 0;
|
||||
|
@ -70,17 +72,17 @@ public:
|
|||
|
||||
Object::Ptr Instantiate(void) const;
|
||||
|
||||
bool IsAssignableFrom(const Type *other) const;
|
||||
bool IsAssignableFrom(const Type::Ptr& other) const;
|
||||
|
||||
bool IsAbstract(void) const;
|
||||
|
||||
static void Register(const Type *type);
|
||||
static const Type *GetByName(const String& name);
|
||||
static void Register(const Type::Ptr& type);
|
||||
static Type::Ptr GetByName(const String& name);
|
||||
|
||||
void SetFactory(const Factory& factory);
|
||||
|
||||
private:
|
||||
typedef std::map<String, const Type *> TypeMap;
|
||||
typedef std::map<String, Type::Ptr> TypeMap;
|
||||
|
||||
static TypeMap& GetTypes(void);
|
||||
|
||||
|
@ -111,7 +113,7 @@ struct FactoryHelper
|
|||
namespace { namespace UNIQUE_NAME(rt) { \
|
||||
void RegisterType ## type(void) \
|
||||
{ \
|
||||
icinga::Type *t = new TypeImpl<type>(); \
|
||||
icinga::Type::Ptr t = make_shared<TypeImpl<type> >(); \
|
||||
t->SetFactory(FactoryHelper<type>().GetFactory()); \
|
||||
icinga::Type::Register(t); \
|
||||
} \
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace icinga
|
|||
class I2_BASE_API UnixSocket : public Socket
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(UnixSocket);
|
||||
DECLARE_OBJECT(UnixSocket);
|
||||
|
||||
UnixSocket(void);
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ ValueType Value::GetType(void) const
|
|||
|
||||
String Value::GetTypeName(void) const
|
||||
{
|
||||
const Type *t;
|
||||
Type::Ptr t;
|
||||
|
||||
switch (GetType()) {
|
||||
case ValueEmpty:
|
||||
|
|
|
@ -57,8 +57,8 @@ struct CheckableNextCheckExtractor
|
|||
class CheckerComponent : public ObjectImpl<CheckerComponent>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(CheckerComponent);
|
||||
DECLARE_TYPENAME(CheckerComponent);
|
||||
DECLARE_OBJECT(CheckerComponent);
|
||||
DECLARE_OBJECTNAME(CheckerComponent);
|
||||
|
||||
typedef boost::multi_index_container<
|
||||
Checkable::Ptr,
|
||||
|
|
|
@ -68,7 +68,7 @@ std::vector<String> icinga::GetBashCompletionSuggestions(const String& type, con
|
|||
return result;
|
||||
}
|
||||
|
||||
std::vector<String> icinga::GetFieldCompletionSuggestions(const Type *type, const String& word)
|
||||
std::vector<String> icinga::GetFieldCompletionSuggestions(const Type::Ptr& type, const String& word)
|
||||
{
|
||||
std::vector<String> result;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "cli/i2-cli.hpp"
|
||||
#include "base/value.hpp"
|
||||
#include "base/utility.hpp"
|
||||
#include "base/type.hpp"
|
||||
#include <vector>
|
||||
#include <boost/program_options.hpp>
|
||||
|
||||
|
@ -30,7 +31,7 @@ namespace icinga
|
|||
{
|
||||
|
||||
std::vector<String> I2_CLI_API GetBashCompletionSuggestions(const String& type, const String& word);
|
||||
std::vector<String> I2_CLI_API GetFieldCompletionSuggestions(const Type *type, const String& word);
|
||||
std::vector<String> I2_CLI_API GetFieldCompletionSuggestions(const Type::Ptr& type, const String& word);
|
||||
|
||||
enum ImpersonationLevel
|
||||
{
|
||||
|
@ -47,7 +48,7 @@ enum ImpersonationLevel
|
|||
class I2_CLI_API CLICommand : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(CLICommand);
|
||||
DECLARE_OBJECT(CLICommand);
|
||||
|
||||
typedef std::vector<String>(*ArgumentCompletionCallback)(const String&, const String&);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class DaemonCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(DaemonCommand);
|
||||
DECLARE_OBJECT(DaemonCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class FeatureDisableCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(FeatureDisableCommand);
|
||||
DECLARE_OBJECT(FeatureDisableCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class FeatureEnableCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(FeatureEnableCommand);
|
||||
DECLARE_OBJECT(FeatureEnableCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class FeatureListCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(FeatureListCommand);
|
||||
DECLARE_OBJECT(FeatureListCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class NodeAddCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(NodeAddCommand);
|
||||
DECLARE_OBJECT(NodeAddCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -40,7 +40,7 @@ enum BlackAndWhitelistCommandType
|
|||
class I2_CLI_API BlackAndWhitelistCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(BlackAndWhitelistCommand);
|
||||
DECLARE_OBJECT(BlackAndWhitelistCommand);
|
||||
|
||||
BlackAndWhitelistCommand(const String& type, BlackAndWhitelistCommandType command);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class NodeListCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(NodeListCommand);
|
||||
DECLARE_OBJECT(NodeListCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class NodeRemoveCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(NodeRemoveCommand);
|
||||
DECLARE_OBJECT(NodeRemoveCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class NodeSetCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(NodeSetCommand);
|
||||
DECLARE_OBJECT(NodeSetCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class NodeSetupCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(NodeSetupCommand);
|
||||
DECLARE_OBJECT(NodeSetupCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class NodeUpdateConfigCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(NodeUpdateConfigCommand);
|
||||
DECLARE_OBJECT(NodeUpdateConfigCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class NodeWizardCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(NodeWizardCommand);
|
||||
DECLARE_OBJECT(NodeWizardCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace icinga
|
|||
class ObjectListCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(ObjectListCommand);
|
||||
DECLARE_OBJECT(ObjectListCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class PKINewCACommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(PKINewCACommand);
|
||||
DECLARE_OBJECT(PKINewCACommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class PKINewCertCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(PKINewCertCommand);
|
||||
DECLARE_OBJECT(PKINewCertCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class PKIRequestCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(PKIRequestCommand);
|
||||
DECLARE_OBJECT(PKIRequestCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class PKISaveCertCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(PKISaveCertCommand);
|
||||
DECLARE_OBJECT(PKISaveCertCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class PKISignCSRCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(PKISignCSRCommand);
|
||||
DECLARE_OBJECT(PKISignCSRCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace icinga
|
|||
class PKITicketCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(PKITicketCommand);
|
||||
DECLARE_OBJECT(PKITicketCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace icinga
|
|||
class RepositoryClearChangesCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(RepositoryClearChangesCommand);
|
||||
DECLARE_OBJECT(RepositoryClearChangesCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace icinga
|
|||
class RepositoryCommitCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(RepositoryCommitCommand);
|
||||
DECLARE_OBJECT(RepositoryCommitCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -129,7 +129,7 @@ std::vector<String> RepositoryObjectCommand::GetPositionalSuggestions(const Stri
|
|||
{
|
||||
if (m_Command == RepositoryCommandAdd) {
|
||||
Utility::LoadExtensionLibrary("icinga");
|
||||
const Type *ptype = Type::GetByName(m_Type);
|
||||
Type::Ptr ptype = Type::GetByName(m_Type);
|
||||
ASSERT(ptype);
|
||||
return GetFieldCompletionSuggestions(ptype, word);
|
||||
} else if (m_Command == RepositoryCommandRemove) {
|
||||
|
|
|
@ -41,7 +41,7 @@ enum RepositoryCommandType
|
|||
class I2_CLI_API RepositoryObjectCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(RepositoryObjectCommand);
|
||||
DECLARE_OBJECT(RepositoryObjectCommand);
|
||||
|
||||
RepositoryObjectCommand(const String& type, RepositoryCommandType command);
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace icinga
|
|||
class VariableGetCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(VariableGetCommand);
|
||||
DECLARE_OBJECT(VariableGetCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace icinga
|
|||
class VariableListCommand : public CLICommand
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(VariableListCommand);
|
||||
DECLARE_OBJECT(VariableListCommand);
|
||||
|
||||
virtual String GetDescription(void) const;
|
||||
virtual String GetShortDescription(void) const;
|
||||
|
|
|
@ -35,8 +35,8 @@ namespace icinga
|
|||
class CheckResultReader : public ObjectImpl<CheckResultReader>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(CheckResultReader);
|
||||
DECLARE_TYPENAME(CheckResultReader);
|
||||
DECLARE_OBJECT(CheckResultReader);
|
||||
DECLARE_OBJECTNAME(CheckResultReader);
|
||||
|
||||
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ namespace icinga
|
|||
class CompatLogger : public ObjectImpl<CompatLogger>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(CompatLogger);
|
||||
DECLARE_TYPENAME(CompatLogger);
|
||||
DECLARE_OBJECT(CompatLogger);
|
||||
DECLARE_OBJECTNAME(CompatLogger);
|
||||
|
||||
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
|
||||
|
||||
|
|
|
@ -36,8 +36,8 @@ namespace icinga
|
|||
class ExternalCommandListener : public ObjectImpl<ExternalCommandListener>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(ExternalCommandListener);
|
||||
DECLARE_TYPENAME(ExternalCommandListener);
|
||||
DECLARE_OBJECT(ExternalCommandListener);
|
||||
DECLARE_OBJECTNAME(ExternalCommandListener);
|
||||
|
||||
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@ namespace icinga
|
|||
class StatusDataWriter : public ObjectImpl<StatusDataWriter>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(StatusDataWriter);
|
||||
DECLARE_TYPENAME(StatusDataWriter);
|
||||
DECLARE_OBJECT(StatusDataWriter);
|
||||
DECLARE_OBJECTNAME(StatusDataWriter);
|
||||
|
||||
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
|
||||
|
||||
|
|
|
@ -143,7 +143,7 @@ Dictionary::Ptr ConfigItem::GetProperties(void)
|
|||
String name = m_Name;
|
||||
|
||||
if (!m_Abstract) {
|
||||
const NameComposer *nc = dynamic_cast<const NameComposer *>(Type::GetByName(m_Type));
|
||||
shared_ptr<NameComposer> nc = dynamic_pointer_cast<NameComposer>(Type::GetByName(m_Type));
|
||||
|
||||
if (nc) {
|
||||
name = nc->MakeName(m_Name, m_Properties);
|
||||
|
@ -212,7 +212,7 @@ void ConfigItem::Register(void)
|
|||
/* If this is a non-abstract object we need to figure out
|
||||
* its real name now - or assign it a temporary name. */
|
||||
if (!m_Abstract) {
|
||||
const NameComposer *nc = dynamic_cast<const NameComposer *>(Type::GetByName(m_Type));
|
||||
shared_ptr<NameComposer> nc = dynamic_pointer_cast<NameComposer>(Type::GetByName(m_Type));
|
||||
|
||||
if (nc) {
|
||||
name = nc->MakeName(m_Name, Dictionary::Ptr());
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace icinga
|
|||
*/
|
||||
class I2_CONFIG_API ConfigItem : public Object {
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(ConfigItem);
|
||||
DECLARE_OBJECT(ConfigItem);
|
||||
|
||||
ConfigItem(const String& type, const String& name, bool abstract,
|
||||
const Expression::Ptr& exprl, const DebugInfo& debuginfo,
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace icinga
|
|||
class I2_CONFIG_API ConfigItemBuilder : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(ConfigItemBuilder);
|
||||
DECLARE_OBJECT(ConfigItemBuilder);
|
||||
|
||||
ConfigItemBuilder(void);
|
||||
explicit ConfigItemBuilder(const DebugInfo& debugInfo);
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace icinga
|
|||
*/
|
||||
class I2_CONFIG_API ConfigType : public Object {
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(ConfigType);
|
||||
DECLARE_OBJECT(ConfigType);
|
||||
|
||||
ConfigType(const String& name, const DebugInfo& debuginfo);
|
||||
|
||||
|
|
|
@ -480,7 +480,7 @@ Value Expression::OpIndexer(const Expression *expr, const Dictionary::Ptr& local
|
|||
return arr->Get(index);
|
||||
} else if (value.IsObjectType<Object>()) {
|
||||
Object::Ptr object = value;
|
||||
const Type *type = object->GetReflectionType();
|
||||
Type::Ptr type = object->GetReflectionType();
|
||||
|
||||
if (!type)
|
||||
BOOST_THROW_EXCEPTION(ConfigError("Dot operator applied to object which does not support reflection"));
|
||||
|
@ -578,7 +578,7 @@ Value Expression::OpObject(const Expression* expr, const Dictionary::Ptr& locals
|
|||
String checkName = name;
|
||||
|
||||
if (!abstract) {
|
||||
const NameComposer *nc = dynamic_cast<const NameComposer *>(Type::GetByName(type));
|
||||
shared_ptr<NameComposer> nc = dynamic_pointer_cast<NameComposer>(Type::GetByName(type));
|
||||
|
||||
if (nc)
|
||||
checkName = nc->MakeName(name, Dictionary::Ptr());
|
||||
|
|
|
@ -52,7 +52,7 @@ struct DebugHint
|
|||
class I2_CONFIG_API Expression : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Expression);
|
||||
DECLARE_OBJECT(Expression);
|
||||
|
||||
typedef Value (*OpCallback)(const Expression *, const Dictionary::Ptr&, DebugHint *dhint);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ enum TypeValidationResult
|
|||
class I2_CONFIG_API TypeRuleList : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(TypeRuleList);
|
||||
DECLARE_OBJECT(TypeRuleList);
|
||||
|
||||
void SetValidator(const String& validator);
|
||||
String GetValidator(void) const;
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace icinga
|
|||
class CommandDbObject : public DbObject
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(CommandDbObject);
|
||||
DECLARE_OBJECT(CommandDbObject);
|
||||
|
||||
CommandDbObject(const shared_ptr<DbType>& type, const String& name1, const String& name2);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace icinga
|
|||
class I2_DB_IDO_API DbConnection : public ObjectImpl<DbConnection>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(DbConnection);
|
||||
DECLARE_OBJECT(DbConnection);
|
||||
|
||||
static void StaticInitialize(void);
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ enum DbObjectType
|
|||
class I2_DB_IDO_API DbObject : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(DbObject);
|
||||
DECLARE_OBJECT(DbObject);
|
||||
|
||||
static void StaticInitialize(void);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class DbObject;
|
|||
class I2_DB_IDO_API DbType : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(DbType);
|
||||
DECLARE_OBJECT(DbType);
|
||||
|
||||
typedef boost::function<shared_ptr<DbObject> (const shared_ptr<DbType>&, const String&, const String&)> ObjectFactory;
|
||||
typedef std::map<String, DbType::Ptr> TypeMap;
|
||||
|
|
|
@ -42,7 +42,7 @@ enum DbValueType
|
|||
struct I2_DB_IDO_API DbValue : public Object
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(DbValue);
|
||||
DECLARE_OBJECT(DbValue);
|
||||
|
||||
DbValue(DbValueType type, const Value& value);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace icinga
|
|||
class EndpointDbObject : public DbObject
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(EndpointDbObject);
|
||||
DECLARE_OBJECT(EndpointDbObject);
|
||||
|
||||
EndpointDbObject(const shared_ptr<DbType>& type, const String& name1, const String& name2);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace icinga
|
|||
class HostDbObject : public DbObject
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(HostDbObject);
|
||||
DECLARE_OBJECT(HostDbObject);
|
||||
|
||||
HostDbObject(const DbType::Ptr& type, const String& name1, const String& name2);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace icinga
|
|||
class HostGroupDbObject : public DbObject
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(HostGroupDbObject);
|
||||
DECLARE_OBJECT(HostGroupDbObject);
|
||||
|
||||
HostGroupDbObject(const DbType::Ptr& type, const String& name1, const String& name2);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace icinga
|
|||
class ServiceDbObject : public DbObject
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(ServiceDbObject);
|
||||
DECLARE_OBJECT(ServiceDbObject);
|
||||
|
||||
ServiceDbObject(const DbType::Ptr& type, const String& name1, const String& name2);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace icinga
|
|||
class ServiceGroupDbObject : public DbObject
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(ServiceGroupDbObject);
|
||||
DECLARE_OBJECT(ServiceGroupDbObject);
|
||||
|
||||
ServiceGroupDbObject(const DbType::Ptr& type, const String& name1, const String& name2);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace icinga
|
|||
class TimePeriodDbObject : public DbObject
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(TimePeriodDbObject);
|
||||
DECLARE_OBJECT(TimePeriodDbObject);
|
||||
|
||||
TimePeriodDbObject(const DbType::Ptr& type, const String& name1, const String& name2);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace icinga
|
|||
class UserDbObject : public DbObject
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(UserDbObject);
|
||||
DECLARE_OBJECT(UserDbObject);
|
||||
|
||||
UserDbObject(const DbType::Ptr& type, const String& name1, const String& name2);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace icinga
|
|||
class UserGroupDbObject : public DbObject
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(UserGroupDbObject);
|
||||
DECLARE_OBJECT(UserGroupDbObject);
|
||||
|
||||
UserGroupDbObject(const DbType::Ptr& type, const String& name1, const String& name2);
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@ typedef shared_ptr<MYSQL_RES> IdoMysqlResult;
|
|||
class IdoMysqlConnection : public ObjectImpl<IdoMysqlConnection>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(IdoMysqlConnection);
|
||||
DECLARE_TYPENAME(IdoMysqlConnection);
|
||||
DECLARE_OBJECT(IdoMysqlConnection);
|
||||
DECLARE_OBJECTNAME(IdoMysqlConnection);
|
||||
|
||||
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
|
||||
|
||||
|
|
|
@ -39,8 +39,8 @@ typedef shared_ptr<PGresult> IdoPgsqlResult;
|
|||
class IdoPgsqlConnection : public ObjectImpl<IdoPgsqlConnection>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(IdoPgsqlConnection);
|
||||
DECLARE_TYPENAME(IdoPgsqlConnection);
|
||||
DECLARE_OBJECT(IdoPgsqlConnection);
|
||||
DECLARE_OBJECTNAME(IdoPgsqlConnection);
|
||||
|
||||
static Value StatsFunc(const Dictionary::Ptr& status, const Array::Ptr& perfdata);
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace icinga
|
|||
class Demo : public ObjectImpl<Demo>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Demo);
|
||||
DECLARE_TYPENAME(Demo);
|
||||
DECLARE_OBJECT(Demo);
|
||||
DECLARE_OBJECTNAME(Demo);
|
||||
|
||||
virtual void Start(void);
|
||||
|
||||
|
|
|
@ -33,8 +33,8 @@ namespace icinga
|
|||
class Hello : public ObjectImpl<Hello>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Hello);
|
||||
DECLARE_TYPENAME(Hello);
|
||||
DECLARE_OBJECT(Hello);
|
||||
DECLARE_OBJECTNAME(Hello);
|
||||
|
||||
int Main(void);
|
||||
};
|
||||
|
|
|
@ -77,8 +77,8 @@ class Dependency;
|
|||
class I2_ICINGA_API Checkable : public ObjectImpl<Checkable>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Checkable);
|
||||
DECLARE_TYPENAME(Checkable);
|
||||
DECLARE_OBJECT(Checkable);
|
||||
DECLARE_OBJECTNAME(Checkable);
|
||||
|
||||
Checkable(void);
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ namespace icinga
|
|||
class I2_ICINGA_API CheckCommand : public ObjectImpl<CheckCommand>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(CheckCommand);
|
||||
DECLARE_TYPENAME(CheckCommand);
|
||||
DECLARE_OBJECT(CheckCommand);
|
||||
DECLARE_OBJECTNAME(CheckCommand);
|
||||
|
||||
virtual void Execute(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr);
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace icinga
|
|||
class I2_ICINGA_API CheckResult : public ObjectImpl<CheckResult>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(CheckResult);
|
||||
DECLARE_OBJECT(CheckResult);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace icinga
|
|||
class I2_ICINGA_API Command : public ObjectImpl<Command>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Command);
|
||||
DECLARE_OBJECT(Command);
|
||||
|
||||
//virtual Dictionary::Ptr Execute(const Object::Ptr& context) = 0;
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace icinga
|
|||
class I2_ICINGA_API Comment : public ObjectImpl<Comment>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Comment);
|
||||
DECLARE_OBJECT(Comment);
|
||||
|
||||
bool IsExpired(void) const;
|
||||
};
|
||||
|
|
|
@ -57,7 +57,7 @@ enum ModifiedAttributeType
|
|||
class I2_ICINGA_API CustomVarObject : public ObjectImpl<CustomVarObject>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(CustomVarObject);
|
||||
DECLARE_OBJECT(CustomVarObject);
|
||||
|
||||
static boost::signals2::signal<void (const CustomVarObject::Ptr&, const Dictionary::Ptr& vars, const MessageOrigin&)> OnVarsChanged;
|
||||
|
||||
|
|
|
@ -37,8 +37,8 @@ class ApplyRule;
|
|||
class I2_ICINGA_API Dependency : public ObjectImpl<Dependency>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Dependency);
|
||||
DECLARE_TYPENAME(Dependency);
|
||||
DECLARE_OBJECT(Dependency);
|
||||
DECLARE_OBJECTNAME(Dependency);
|
||||
|
||||
shared_ptr<Checkable> GetParent(void) const;
|
||||
shared_ptr<Checkable> GetChild(void) const;
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace icinga
|
|||
class I2_ICINGA_API Downtime : public ObjectImpl<Downtime>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Downtime);
|
||||
DECLARE_OBJECT(Downtime);
|
||||
|
||||
bool IsActive(void) const;
|
||||
bool IsTriggered(void) const;
|
||||
|
|
|
@ -34,8 +34,8 @@ namespace icinga
|
|||
class I2_ICINGA_API EventCommand : public ObjectImpl<EventCommand>
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(EventCommand);
|
||||
DECLARE_TYPENAME(EventCommand);
|
||||
DECLARE_OBJECT(EventCommand);
|
||||
DECLARE_OBJECTNAME(EventCommand);
|
||||
|
||||
virtual void Execute(const Checkable::Ptr& checkable);
|
||||
};
|
||||
|
|
|
@ -38,8 +38,8 @@ class Service;
|
|||
class I2_ICINGA_API Host : public ObjectImpl<Host>, public MacroResolver
|
||||
{
|
||||
public:
|
||||
DECLARE_PTR_TYPEDEFS(Host);
|
||||
DECLARE_TYPENAME(Host);
|
||||
DECLARE_OBJECT(Host);
|
||||
DECLARE_OBJECTNAME(Host);
|
||||
|
||||
shared_ptr<Service> GetServiceByShortName(const Value& name);
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue