# against the file with absolute path, so to exclude all test directories
# for example use the pattern */test/*
-EXCLUDE_PATTERNS =
+EXCLUDE_PATTERNS = */lib/config/config_parser* */lib/config/config_lexer*
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
int Run(int argc, char **argv);
+ /**
+ * Starts the application.
+ *
+ * @param args Arguments for the application.
+ * @returns The exit code of the application.
+ */
virtual int Main(const vector<String>& args) = 0;
static void Shutdown(void);
}
protected:
+ /**
+ * Begins executing the task. The Run method must ensure
+ * that one of the Finish*() functions is executed on the task
+ * object (possibly after the Run method has returned).
+ */
virtual void Run(void) = 0;
private:
}
}
-DynamicObject::AttributeConstIterator DynamicObject::AttributeBegin(void) const
-{
- return m_Attributes.begin();
-}
-
-DynamicObject::AttributeConstIterator DynamicObject::AttributeEnd(void) const
-{
- return m_Attributes.end();
-}
-
String DynamicObject::GetType(void) const
{
return Get("__type");
*/
struct DynamicAttribute
{
- Value Data;
- DynamicAttributeType Type;
- double Tx;
+ Value Data; /**< The current value of the attribute. */
+ DynamicAttributeType Type; /**< The type of the attribute. */
+ double Tx; /**< The timestamp of the last value change. */
};
/**
void ClearAttributesByType(DynamicAttributeType type);
- AttributeConstIterator AttributeBegin(void) const;
- AttributeConstIterator AttributeEnd(void) const;
-
static boost::signal<void (const DynamicObject::Ptr&)> OnRegistered;
static boost::signal<void (const DynamicObject::Ptr&)> OnUnregistered;
static boost::signal<void (const set<DynamicObject::Ptr>&)> OnTransactionClosing;
else
throw_exception(invalid_argument("Invalid severity: " + severity));
}
+
+/**
+ * Retrieves the configuration object that belongs to this logger.
+ *
+ * @returns The configuration object.
+ */
+DynamicObject::Ptr ILogger::GetConfig(void) const
+{
+ return m_Config->GetSelf();
+}
+
* @ingroup base
*/
struct LogEntry {
- double Timestamp;
- LogSeverity Severity;
- String Facility;
- String Message;
+ double Timestamp; /**< The timestamp when this log entry was created. */
+ LogSeverity Severity; /**< The severity of this log entry. */
+ String Facility; /**< The facility this log entry belongs to. */
+ String Message; /**< The log entry's message. */
};
/**
typedef shared_ptr<ILogger> Ptr;
typedef weak_ptr<ILogger> WeakPtr;
+ /**
+ * Processes the log entry and writes it to the log that is
+ * represented by this ILogger object.
+ *
+ * @param entry The log entry that is to be processed.
+ */
virtual void ProcessLogEntry(const LogEntry& entry) = 0;
protected:
namespace icinga
{
+/**
+ * The configuration compiler can be used to compile a configuration file
+ * into a number of configuration objects.
+ *
+ * @ingroup config
+ */
class I2_CONFIG_API ConfigCompiler
{
public:
namespace icinga
{
+/**
+ * A configuration item. Can be used to create a configuration object at
+ * runtime.
+ *
+ * @ingroup config
+ */
class I2_CONFIG_API ConfigItem : public Object {
public:
typedef shared_ptr<ConfigItem> Ptr;
namespace icinga
{
+/**
+ * Config item builder. Used to dynamically build configuration objects
+ * at runtime.
+ *
+ * @ingroup config
+ */
class I2_CONFIG_API ConfigItemBuilder : public Object
{
public:
namespace icinga
{
+/**
+ * Debug information for a configuration element.
+ *
+ * @ingroup config
+ */
struct DebugInfo
{
String Path;
namespace icinga
{
+/**
+ * The operator in a configuration expression.
+ *
+ * @ingroup config
+ */
enum ExpressionOperator
{
OperatorExecute,
OperatorDivide
};
+/**
+ * A configuration expression.
+ *
+ * @ingroup config
+ */
struct I2_CONFIG_API Expression
{
public:
namespace icinga
{
+/**
+ * A list of configuration expressions.
+ *
+ * @ingroup config
+ */
class I2_CONFIG_API ExpressionList : public Object
{
public:
boost::signal<void (const Endpoint::Ptr&, const String& topic)> Endpoint::OnSubscriptionRegistered;
boost::signal<void (const Endpoint::Ptr&, const String& topic)> Endpoint::OnSubscriptionUnregistered;
+/**
+ * Constructor for the Endpoint class.
+ *
+ * @param properties A serialized dictionary containing attributes.
+ */
Endpoint::Endpoint(const Dictionary::Ptr& serializedUpdate)
: DynamicObject(serializedUpdate)
{
RegisterAttribute("client", Attribute_Transient);
}
+/**
+ * Checks whether an endpoint with the specified name exists.
+ *
+ * @param name The name of the endpoint.
+ * @returns true if the endpoint exists, false otherwise.
+ */
bool Endpoint::Exists(const String& name)
{
return (DynamicObject::GetObject("Endpoint", name));
}
+/**
+ * Retrieves an endpoint by name.
+ *
+ * @param name The name of the endpoint.
+ * @returns The endpoint.
+ */
Endpoint::Ptr Endpoint::GetByName(const String& name)
{
DynamicObject::Ptr configObject = DynamicObject::GetObject("Endpoint", name);
return dynamic_pointer_cast<Endpoint>(configObject);
}
+/**
+ * Helper function for creating new endpoint objects.
+ *
+ * @param name The name of the new endpoint.
+ * @param local Whether the new endpoint should be local.
+ * @returns The new endpoint.
+ */
Endpoint::Ptr Endpoint::MakeEndpoint(const String& name, bool local)
{
ConfigItemBuilder::Ptr endpointConfig = boost::make_shared<ConfigItemBuilder>();
OnDisconnected(GetSelf());
}
+/**
+ * Gets the node address for this endpoint.
+ *
+ * @returns The node address (hostname).
+ */
String Endpoint::GetNode(void) const
{
return Get("node");
}
+/**
+ * Gets the service name for this endpoint.
+ *
+ * @returns The service name (port).
+ */
String Endpoint::GetService(void) const
{
return Get("service");