 |
log4cplus
2.0.6
|
Go to the documentation of this file.
24 #ifndef LOG4CPLUS_SPI_FACTORY_HEADER_
25 #define LOG4CPLUS_SPI_FACTORY_HEADER_
29 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
164 bool put(std::unique_ptr<T>
object) {
165 bool putValResult = putVal(object->getTypeName(),
object.get());
175 return static_cast<T*
>(getVal(name));
180 delete static_cast<T*
>(object);
212 template <
typename ProductFactoryBase>
214 :
public ProductFactoryBase
231 template <
typename LocalProduct,
typename ProductFactoryBase>
249 #define LOG4CPLUS_REG_PRODUCT(reg, productprefix, productname, productns, productfact) \
251 std::unique_ptr<productfact> ( \
252 new log4cplus::spi::FactoryTempl<productns productname, productfact> ( \
253 LOG4CPLUS_TEXT(productprefix) \
254 LOG4CPLUS_TEXT(#productname))))
256 #define LOG4CPLUS_REG_APPENDER(reg, appendername) \
257 LOG4CPLUS_REG_PRODUCT (reg, "log4cplus::", appendername, log4cplus::, \
258 log4cplus::spi::AppenderFactory)
260 #define LOG4CPLUS_REG_LAYOUT(reg, layoutname) \
261 LOG4CPLUS_REG_PRODUCT (reg, "log4cplus::", layoutname, log4cplus::, \
262 log4cplus::spi::LayoutFactory)
264 #define LOG4CPLUS_REG_FILTER(reg, filtername) \
265 LOG4CPLUS_REG_PRODUCT (reg, "log4cplus::spi::", filtername, log4cplus::spi::, \
266 log4cplus::spi::FilterFactory)
268 #define LOG4CPLUS_REG_LOCALE(reg, name, factory) \
269 reg.put (std::unique_ptr<log4cplus::spi::LocaleFactory> ( \
275 #endif // LOG4CPLUS_SPI_FACTORY_HEADER_
This abstract class defines the "Factory" interface to create std::locale instances.
LOG4CPLUS_EXPORT LocaleFactoryRegistry & getLocaleFactoryRegistry()
Returns the "singleton" LocaleFactoryRegistry.
std::basic_string< tchar > tstring
This is the base class for all factories.
virtual ProductPtr createObject(helpers::Properties const &props)
bool put(std::unique_ptr< T > object)
Used to enter an object into the registry.
FactoryRegistry< AppenderFactory > AppenderFactoryRegistry
FactoryTempl(tchar const *n)
virtual const log4cplus::tstring & getTypeName() const
LOG4CPLUS_EXPORT FilterFactoryRegistry & getFilterFactoryRegistry()
Returns the "singleton" FilterFactoryRegistry.
This abstract class defines the "Factory" interface to create "Appender" objects.
This abstract class defines the "Factory" interface to create "Appender" objects.
LOG4CPLUS_EXPORT LayoutFactoryRegistry & getLayoutFactoryRegistry()
Returns the "singleton" LayoutFactoryRegistry.
LocalFactoryBase(tchar const *n)
ProductFactoryBase::ProductPtr ProductPtr
This class is used to layout strings sent to an {}.
virtual ~FactoryRegistry()
This template class is used as a "Factory Registry".
FactoryRegistry< LayoutFactory > LayoutFactoryRegistry
Users should extend this class to implement customized logging event filtering.
std::unique_ptr< Layout > ProductPtr
FactoryRegistry< FilterFactory > FilterFactoryRegistry
FactoryRegistry< LocaleFactory > LocaleFactoryRegistry
virtual void deleteObject(void *object) const
Deletes object.
T * get(const log4cplus::tstring &name) const
Used to retrieve an object from the registry.
SharedAppenderPtr ProductPtr
Extend this class for implementing your own strategies for printing log statements.
This abstract class defines the "Factory" interface to create "Layout" objects.
This is the base class used to implement the functionality required by the ObjectRegistry template cl...
LOG4CPLUS_EXPORT AppenderFactoryRegistry & getAppenderFactoryRegistry()
Returns the "singleton" AppenderFactoryRegistry.