#include <factory.h>
Public Types | |
typedef Appender *(* | AppenderFactoryFunc )() |
typedef Filter *(* | FilterFactoryFunc )() |
typedef Layout *(* | LayoutFactoryFunc )() |
Static Public Member Functions | |
static Appender * | createAppender (const QString &rAppenderClassName) |
static Appender * | createAppender (const char *pAppenderClassName) |
static Filter * | createFilter (const QString &rFilterClassName) |
static Filter * | createFilter (const char *pFilterClassName) |
static Layout * | createLayout (const QString &rLayoutClassName) |
static Layout * | createLayout (const char *pLayoutClassName) |
static Factory * | instance () |
static void | registerAppender (const QString &rAppenderClassName, AppenderFactoryFunc pAppenderFactoryFunc) |
static void | registerAppender (const char *pAppenderClassName, AppenderFactoryFunc pAppenderFactoryFunc) |
static void | registerFilter (const QString &rFilterClassName, FilterFactoryFunc pFilterFactoryFunc) |
static void | registerFilter (const char *pFilterClassName, FilterFactoryFunc pFilterFactoryFunc) |
static void | registerLayout (const QString &rLayoutClassName, LayoutFactoryFunc pLayoutFactoryFunc) |
static void | registerLayout (const char *pLayoutClassName, LayoutFactoryFunc pLayoutFactoryFunc) |
static QStringList | registeredAppenders () |
static QStringList | registeredFilters () |
static QStringList | registeredLayouts () |
static void | setObjectProperty (QObject *pObject, const QString &rProperty, const QString &rValue) |
static void | setObjectProperty (QObject *pObject, const char *pProperty, const QString &rValue) |
static void | unregisterAppender (const QString &rAppenderClassName) |
static void | unregisterAppender (const char *pAppenderClassName) |
static void | unregisterFilter (const QString &rFilterClassName) |
static void | unregisterFilter (const char *pFilterClassName) |
static void | unregisterLayout (const QString &rLayoutClassName) |
static void | unregisterLayout (const char *pLayoutClassName) |
Related Functions | |
(Note that these are not member functions.) | |
QDebug | operator<< (QDebug debug, const Factory &rFactory) |
The functions createAppender(), createFilter() and createLayout() allow to create objects by specifying their class names. By default all classes of the package are recognised with their Log4j and Log4Qt classanmes. For example an object of the class FileAppender can be craeted using "org.apache.log4j.FileAppender" or "Log4Qt::FileAppender". Additional classes can be registered using registerAppender(), registerFilter() and registerLayout().
An QObject property can be set from a string value with setObjectProperty(). The function handles the required error checking and type conversion.
typedef Appender*(* Log4Qt::Factory::AppenderFactoryFunc)() |
Prototype for an Appender factory function. The function creates an Appender object on the heap and returns a pointer to it.
typedef Filter*(* Log4Qt::Factory::FilterFactoryFunc)() |
Prototype for a Filter factory function. The function creates a Filter object on the heap and returns a pointer to it.
typedef Layout*(* Log4Qt::Factory::LayoutFactoryFunc)() |
Prototype for a Layout factory function. The function creates a Layout object on the heap and returns a pointer to it.
Appender * Log4Qt::Factory::createAppender | ( | const QString & | rAppenderClassName | ) | [inline, static] |
Creates an object for the class rAppenderClassName on the heap and returns a pointer to it. If the class has no registered factory function a null pointer is returned.
References doCreateAppender(), and instance().
Appender * Log4Qt::Factory::createAppender | ( | const char * | pAppenderClassName | ) | [inline, static] |
This is an overloaded member function, provided for convenience.
References doCreateAppender(), and instance().
Filter * Log4Qt::Factory::createFilter | ( | const QString & | rFilterClassName | ) | [inline, static] |
Creates an object for the class rFilterClassName on the heap and returns a pointer to it. If the class has no registered factory function a null pointer is returned.
References doCreateFilter(), and instance().
Filter * Log4Qt::Factory::createFilter | ( | const char * | pFilterClassName | ) | [inline, static] |
This is an overloaded member function, provided for convenience.
References doCreateFilter(), and instance().
Layout * Log4Qt::Factory::createLayout | ( | const QString & | rLayoutClassName | ) | [inline, static] |
Creates an object for the class rLayoutClassName on the heap and returns a pointer to it. If the class has no registered factory function a null pointer is returned.
References doCreateLayout(), and instance().
Layout * Log4Qt::Factory::createLayout | ( | const char * | pLayoutClassName | ) | [inline, static] |
This is an overloaded member function, provided for convenience.
References doCreateLayout(), and instance().
static Factory* Log4Qt::Factory::instance | ( | ) | [static] |
Returns the Factory instance.
Referenced by createAppender(), createFilter(), createLayout(), registerAppender(), registeredAppenders(), registeredFilters(), registeredLayouts(), registerFilter(), registerLayout(), setObjectProperty(), unregisterAppender(), unregisterFilter(), and unregisterLayout().
void Log4Qt::Factory::registerAppender | ( | const QString & | rAppenderClassName, | |
AppenderFactoryFunc | pAppenderFactoryFunc | |||
) | [inline, static] |
Registers the Appender factory function pAppenderFactoryFunc for the class rAppenderClassName. If a registered factory function exists for the class, it is replaced with pAppenderFactoryFunc.
References doRegisterAppender(), and instance().
void Log4Qt::Factory::registerAppender | ( | const char * | pAppenderClassName, | |
AppenderFactoryFunc | pAppenderFactoryFunc | |||
) | [inline, static] |
This is an overloaded member function, provided for convenience.
References doRegisterAppender(), and instance().
void Log4Qt::Factory::registerFilter | ( | const QString & | rFilterClassName, | |
FilterFactoryFunc | pFilterFactoryFunc | |||
) | [inline, static] |
Registers the Filter factory function pFilterFactoryFunc for the class rFilterClassName. If a registered factory function exists for the class, it is replaced with pFilterFactoryFunc.
References doRegisterFilter(), and instance().
void Log4Qt::Factory::registerFilter | ( | const char * | pFilterClassName, | |
FilterFactoryFunc | pFilterFactoryFunc | |||
) | [inline, static] |
This is an overloaded member function, provided for convenience.
References doRegisterFilter(), and instance().
void Log4Qt::Factory::registerLayout | ( | const QString & | rLayoutClassName, | |
LayoutFactoryFunc | pLayoutFactoryFunc | |||
) | [inline, static] |
Registers the Layout factory function pLayoutFactoryFunc for the class rLayoutClassName. If a registered factory function exists for the class, it is replaced with pLayoutFactoryFunc.
References doRegisterLayout(), and instance().
void Log4Qt::Factory::registerLayout | ( | const char * | pLayoutClassName, | |
LayoutFactoryFunc | pLayoutFactoryFunc | |||
) | [inline, static] |
This is an overloaded member function, provided for convenience.
References doRegisterLayout(), and instance().
QStringList Log4Qt::Factory::registeredAppenders | ( | ) | [inline, static] |
Returns a list of the class names for registered Appender factory functions.
References instance(), and mAppenderRegistry.
QStringList Log4Qt::Factory::registeredFilters | ( | ) | [inline, static] |
Returns a list of the class names for registered Filter factory functions.
References instance(), and mFilterRegistry.
QStringList Log4Qt::Factory::registeredLayouts | ( | ) | [inline, static] |
Returns a list of the class names for registered Layout factory functions.
References instance(), and mLayoutRegistry.
void Log4Qt::Factory::setObjectProperty | ( | QObject * | pObject, | |
const QString & | rProperty, | |||
const QString & | rValue | |||
) | [inline, static] |
Sets the property rProperty of the object pObject to the value rValue. The function will test that the property rProperty is writeable and of a type the function can convert to. The types bool, int, Level and QString are supported.
References doSetObjectProperty(), and instance().
void Log4Qt::Factory::setObjectProperty | ( | QObject * | pObject, | |
const char * | pProperty, | |||
const QString & | rValue | |||
) | [inline, static] |
This is an overloaded member function, provided for convenience.
References doSetObjectProperty(), and instance().
void Log4Qt::Factory::unregisterAppender | ( | const QString & | rAppenderClassName | ) | [inline, static] |
Unregisters the Appender factory function for the class rAppenderClassName.
References doUnregisterAppender(), and instance().
void Log4Qt::Factory::unregisterAppender | ( | const char * | pAppenderClassName | ) | [inline, static] |
This is an overloaded member function, provided for convenience.
References doUnregisterAppender(), and instance().
void Log4Qt::Factory::unregisterFilter | ( | const QString & | rFilterClassName | ) | [inline, static] |
Unregisters the Filter factory function for the class rFilterClassName.
References doUnregisterFilter(), and instance().
void Log4Qt::Factory::unregisterFilter | ( | const char * | pFilterClassName | ) | [inline, static] |
This is an overloaded member function, provided for convenience.
References doUnregisterFilter(), and instance().
void Log4Qt::Factory::unregisterLayout | ( | const QString & | rLayoutClassName | ) | [inline, static] |
Unregisters the Layout factory function for the class rLayoutClassName.
References doUnregisterLayout(), and instance().
void Log4Qt::Factory::unregisterLayout | ( | const char * | pLayoutClassName | ) | [inline, static] |
This is an overloaded member function, provided for convenience.
References doUnregisterLayout(), and instance().
QDebug operator<< | ( | QDebug | debug, | |
const Factory & | rFactory | |||
) | [related] |
Writes all object member variables to the given debug stream rDebug and returns the stream.
Factory(appenderfactories:("Log4Qt::DebugAppender", "Log4Qt::NullAppender", "Log4Qt::ConsoleAppender", "org.apache.log4j.varia.DebugAppender", "org.apache.log4j.FileAppender", "org.apache.log4j.RollingFileAppender", "org.apache.log4j.DailyRollingFileAppender", "org.apache.log4j.varia.ListAppender", "org.apache.log4j.varia.NullAppender", "Log4Qt::FileAppender", "org.apache.log4j.ConsoleAppender", "Log4Qt::DailyRollingFileAppender", "Log4Qt::ListAppender", "Log4Qt::RollingFileAppender") filterfactories: ("Log4Qt::DenyAllFilter", "Log4Qt::StringMatchFilter", "Log4Qt::LevelRangeFilter", "org.apache.log4j.varia.DenyAllFilter", "org.apache.log4j.varia.LevelRangeFilter", "org.apache.log4j.varia.StringMatchFilter", "Log4Qt::LevelMatchFilter", "org.apache.log4j.varia.LevelMatchFilter") layoutfactories: ("org.apache.log4j.SimpleLayout", "Log4Qt::PatternLayout", "Log4Qt::SimpleLayout", "org.apache.log4j.TTCCLayout", "Log4Qt::TTCCLayout", "org.apache.log4j.PatternLayout") )