# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = @top_srcdir@/base @top_srcdir@/jsonrpc @top_srcdir@/icinga @top_srcdir@/components @top_srcdir@/icinga-app
+INPUT = lib/base lib/config lib/icinga lib/remoting components icinga-app
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
namespace icinga
{
+/**
+ * Interface for application extensions.
+ *
+ * @ingroup base
+ */
class I2_BASE_API IComponent : public Object
{
public:
}
/**
- * Converts a dictionary to a JSON object.
+ * Converts this dictionary to a JSON object.
*
- * @param dictionary The dictionary.
* @returns A JSON object that is equivalent to the dictionary. Values that
* cannot be represented in JSON are omitted.
*/
namespace icinga
{
+/**
+ * The type of an attribute for a DynamicObject.
+ */
enum DynamicAttributeType
{
Attribute_Transient = 1,
Attribute_All = Attribute_Transient | Attribute_Local | Attribute_Replicated | Attribute_Config
};
+/**
+ * An attribute for a DynamicObject.
+ */
struct DynamicAttribute
{
Value Data;
};
/**
- * A dynamic object that can be instantiated from the configuration file.
+ * A dynamic object that can be instantiated from the configuration file
+ * and that supports attribute replication to remote application instances.
*
* @ingroup base
*/
void InternalApplyUpdate(const Dictionary::Ptr& serializedUpdate, int allowedTypes, bool suppressEvents);
};
+/**
+ * Helper class for registering DynamicObject implementation classes.
+ *
+ * @ingroup base
+ */
class RegisterClassHelper
{
public:
namespace icinga
{
+/**
+ * A thread-safe event that can be posted to the main thread's event queue.
+ *
+ * @ingroup base
+ */
class I2_BASE_API Event
{
public:
Optimize();
}
-/**
- * Returns a pointer to the start of the write buffer.
- *
- * @param count Minimum size of the buffer; on return this parameter
- * contains the actual size of the available buffer which can
- * be larger than the requested size.
- */
-/*void *FIFO::GetWriteBuffer(size_t *count)
-{
- ResizeBuffer(m_Offset + m_DataSize + *count);
- *count = m_AllocSize - m_Offset - m_DataSize;
-
- return m_Buffer + m_Offset + m_DataSize;
-}*/
-
/**
* Implements IOQueue::Write.
*/
/**
* An I/O queue.
+ *
+ * @ingroup base
*/
class IOQueue
{
* to read more data than is available in the queue is a programming error.
* Use GetBytesAvailable() to check how much data is available.
*
- * @buffer The buffer where data should be stored. May be NULL if you're
- * not actually interested in the data.
+ * @param buffer The buffer where data should be stored. May be NULL if
+ * you're not actually interested in the data.
* @param count The number of bytes to read from the queue.
*/
virtual void Peek(void *buffer, size_t count) = 0;
REGISTER_CLASS(Logger);
/**
- * Constructor for the logger class.
+ * Constructor for the Logger class.
*
- * @param minSeverity The minimum severity of log messages that should be sent
- * to this logger.
+ * @param properties A serialized dictionary containing attributes.
*/
Logger::Logger(const Dictionary::Ptr& properties)
: DynamicObject(properties)
/**
* Base class for all loggers.
+ *
+ * @ingroup base
*/
class I2_BASE_API ILogger : public Object
{
friend class Logger;
};
+/**
+ * A log provider. Can be instantiated from the config.
+ *
+ * @ingroup base
+ */
class I2_BASE_API Logger : public DynamicObject
{
public:
/**
* Reads data from an IOQueue in netString format.
*
- * @param fifo The IOQueue to read from.
- * @param[out] str The String that has been read from the FIFO.
- * @returns true if a complete String was read from the FIFO, false otherwise.
+ * @param queue The IOQueue to read from.
+ * @param[out] str The String that has been read from the IOQueue.
+ * @returns true if a complete String was read from the IOQueue, false otherwise.
* @exception invalid_argument The input stream is invalid.
* @see https://github.com/PeterScott/netString-c/blob/master/netString.c
*/
free(buffer);
- /* remove the data from the fifo */
+ /* remove the data from the IOQueue */
queue->Read(NULL, buffer_length);
return true;
}
/**
- * Writes data into a FIFO using the netString format.
+ * Writes data into an IOQueue using the netString format.
*
- * @param fifo The FIFO.
+ * @param queue The IOQueue.
* @param str The String that is to be written.
*/
void NetString::WriteStringToIOQueue(IOQueue *queue, const String& str)
namespace icinga
{
+/**
+ * The result of a Process task.
+ *
+ * @ingroup base
+ */
struct ProcessResult
{
double ExecutionStart;
String Output;
};
+/**
+ * A process task. Executes an external application and returns the exit
+ * code and console output.
+ *
+ * @ingroup base
+ */
class I2_BASE_API Process : public AsyncTask<Process, ProcessResult>
{
public:
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012 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 "i2-base.h"
using namespace icinga;
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012 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. *
+ ******************************************************************************/
+
#ifndef STRING_H
#define STRING_H
/**
* String class.
*
- * Rationale: The std::string class has an ambiguous assignment
+ * Rationale for having this: The std::string class has an ambiguous assignment
* operator when used in conjunction with the Value class.
*/
class I2_BASE_API String
namespace icinga
{
+/**
+ * A ring buffer that holds a pre-defined number of integers.
+ *
+ * @ingroup base
+ */
class I2_BASE_API RingBuffer
{
public:
class ScriptTask;
+/**
+ * A script function that can be used to execute a script task.
+ *
+ * @ingroup base
+ */
class I2_BASE_API ScriptFunction : public Object
{
public:
namespace icinga
{
+/**
+ * A script task.
+ *
+ * @ingroup base
+ */
class I2_BASE_API ScriptTask : public AsyncTask<ScriptTask, Value>
{
public:
* Constructor for the StreamLogger class.
*
* @param stream The stream.
- * @param minSeverity Minimum severity for log messages.
*/
StreamLogger::StreamLogger(ostream *stream)
: ILogger(), m_Stream(stream), m_OwnsStream(false)
{
/**
- * A logger that logs to stdout.
+ * A logger that logs to an iostream.
+ *
+ * @ingroup base
*/
class I2_BASE_API StreamLogger : public ILogger
{
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012 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 "i2-base.h"
#ifndef _WIN32
+/******************************************************************************
+ * Icinga 2 *
+ * Copyright (C) 2012 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. *
+ ******************************************************************************/
+
#ifndef SYSLOGLOGGER_H
#define SYSLOGLOGGER_H
/**
* A logger that logs to syslog.
+ *
+ * @ingroup base
*/
class I2_BASE_API SyslogLogger : public ILogger
{
TcpServer(void);
- void SetClientFactory(const ClientFactory& function);
+ void SetClientFactory(const ClientFactory& clientFactory);
ClientFactory GetFactoryFunction(void) const;
void Listen(void);
/**
* Null deleter. Used as a parameter for the shared_ptr constructor.
*
- * @param -- The object that should be deleted.
+ * @param - The object that should be deleted.
*/
void Utility::NullDeleter(void *)
{
static String DirName(const String& path);
static String BaseName(const String& path);
- static void NullDeleter(void *obj);
+ static void NullDeleter(void *);
static double GetTime(void);
/**
* Deserializes the string representation of a variant.
*
- * @params jsonString A JSON string obtained from Value::Serialize
+ * @param jsonString A JSON string obtained from Value::Serialize
* @returns The newly deserialized variant.
*/
Value Value::Deserialize(const String& jsonString)
#define I2CONFIG_H
/**
- * @defgroup config Dynamic object library
+ * @defgroup config Configuration library
*
- * The dynamic object library implements serializable objects which support
- * inheritance.
+ * The configuration library implements a compiler for Icinga 2's configuration
+ * format. It also provides functionality to create configuration objects
+ * at runtime.
*/
#include <i2-base.h>
namespace icinga
{
+/**
+ * Common Information Base class. Holds some statistics (and will likely be
+ * removed/refactored).
+ *
+ * @ingroup icinga
+ */
class I2_ICINGA_API CIB
{
public:
namespace icinga
{
+/**
+ * An Icinga host.
+ *
+ * @ingroup icinga
+ */
class I2_ICINGA_API Host : public DynamicObject
{
public:
namespace icinga
{
+/**
+ * An Icinga host group.
+ *
+ * @ingroup icinga
+ */
class I2_ICINGA_API HostGroup : public DynamicObject
{
public:
#define I2ICINGA_H
/**
- * @defgroup icinga Icinga application
+ * @defgroup icinga Icinga library
*
- * The Icinga application is in charge of boot-strapping the Icinga
- * environment and loading additional components.
+ * The Icinga library implements all Icinga-specific functionality that is
+ * common to all components (e.g. hosts, services, etc.).
*/
#include <i2-base.h>
namespace icinga
{
+/**
+ * Resolves macros.
+ *
+ * @ingroup icinga
+ */
class I2_ICINGA_API MacroProcessor
{
public:
namespace icinga
{
+/**
+ * Implements Nagios(TM)-style checks.
+ *
+ * @ingroup icinga
+ */
class I2_ICINGA_API NagiosCheckTask
{
public:
namespace icinga
{
+/**
+ * Test class for additional check types. Implements the "null" check type.
+ *
+ * @ingroup icinga
+ */
class I2_ICINGA_API NullCheckTask
{
public:
namespace icinga
{
+/**
+ * The state of a service.
+ *
+ * @ingroup icinga
+ */
enum ServiceState
{
StateOK,
StateUncheckable,
};
+/**
+ * The state type of a service.
+ *
+ * @ingroup icinga
+ */
enum ServiceStateType
{
StateTypeSoft,
class CheckResultMessage;
class ServiceStatusMessage;
+/**
+ * An Icinga service.
+ *
+ * @ingroup icinga
+ */
class I2_ICINGA_API Service : public DynamicObject
{
public:
namespace icinga
{
+/**
+ * An Icinga service group.
+ *
+ * @ingroup icinga
+ */
class I2_ICINGA_API ServiceGroup : public DynamicObject
{
public:
namespace icinga
{
+/**
+ * A state change message for a service.
+ *
+ * @ingroup icinga
+ */
class I2_ICINGA_API ServiceStateChangeMessage : public MessagePart
{
public:
/**
* An endpoint that can be used to send and receive messages.
*
- * @ingroup icinga
+ * @ingroup remoting
*/
class I2_REMOTING_API Endpoint : public DynamicObject
{
/**
* Forwards messages between endpoints.
*
- * @ingroup icinga
+ * @ingroup remoting
*/
class I2_REMOTING_API EndpointManager : public Object
{
void ProcessResponseMessage(const Endpoint::Ptr& sender, const ResponseMessage& message);
-// void ForEachEndpoint(function<void (const EndpointManager::Ptr&, const Endpoint::Ptr&)> callback);
-// Iterator Begin(void);
-// Iterator End(void);
-
boost::signal<void (const EndpointManager::Ptr&, const Endpoint::Ptr&)> OnNewEndpoint;
private:
/**
* Information about a pending API request.
*
- * @ingroup icinga
+ * @ingroup remoting
*/
struct I2_REMOTING_API PendingRequest
{
#define I2REMOTING_H
/**
- * @defgroup remoting JSON-RPC library
+ * @defgroup remoting Remoting library
*
- * The JSON-RPC library implements server and client classes for the JSON-RPC
- * protocol.
+ * Implements server and client classes for the JSON-RPC protocol. Also
+ * supports endpoint-based communication using messages.
*/
#include <i2-base.h>
* Retrieves a property's value.
*
* @param key The name of the property.
- * @param[out] The value.
+ * @param[out] value The value.
* @returns true if the value was retrieved, false otherwise.
*/
bool MessagePart::Get(String key, MessagePart *value) const
* Retrieves a property's value.
*
* @param key The name of the property.
- * @param[out] The value.
+ * @param[out] value The value.
* @returns true if the value was retrieved, false otherwise.
*/
template<typename T>