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_ LOG4CPLUS_EXPORT LayoutFactoryRegistry & getLayoutFactoryRegistry()
Returns the "singleton" LayoutFactoryRegistry.
std::unique_ptr< Layout > ProductPtr
virtual void deleteObject(void *object) const
Deletes object.
This header defines Filter and all of it's subclasses.
virtual ProductPtr createObject(helpers::Properties const &props)
This class is used to layout strings sent to an {}.
virtual ~FactoryRegistry()
Users should extend this class to implement customized logging event filtering.
This is the base class for all factories.
This template class is used as a "Factory Registry".
FactoryRegistry< FilterFactory > FilterFactoryRegistry
LOG4CPLUS_EXPORT FilterFactoryRegistry & getFilterFactoryRegistry()
Returns the "singleton" FilterFactoryRegistry.
virtual log4cplus::tstring const & getTypeName() const
FactoryTempl(tchar const *n)
This abstract class defines the "Factory" interface to create "Appender" objects.
FactoryRegistry< LocaleFactory > LocaleFactoryRegistry
This is the base class used to implement the functionality required by the ObjectRegistry template cl...
This abstract class defines the "Factory" interface to create std::locale instances.
LOG4CPLUS_EXPORT LocaleFactoryRegistry & getLocaleFactoryRegistry()
Returns the "singleton" LocaleFactoryRegistry.
ProductFactoryBase::ProductPtr ProductPtr
LOG4CPLUS_EXPORT AppenderFactoryRegistry & getAppenderFactoryRegistry()
Returns the "singleton" AppenderFactoryRegistry.
std::basic_string< tchar > tstring
This abstract class defines the "Factory" interface to create "Layout" objects.
bool put(std::unique_ptr< T > object)
Used to enter an object into the registry.
LocalFactoryBase(tchar const *n)
FactoryRegistry< AppenderFactory > AppenderFactoryRegistry
SharedAppenderPtr ProductPtr
FactoryRegistry< LayoutFactory > LayoutFactoryRegistry
Extend this class for implementing your own strategies for printing log statements.
This abstract class defines the "Factory" interface to create "Appender" objects.
T * get(const log4cplus::tstring &name) const
Used to retrieve an object from the registry.