I read the souce code of log4cplus-1.1.2 recently, and found that SharedLoggerImplPtr
seem to be the better type for Loger::value
than spi::LoggerImpl *
。
The definition of Loger::value
in logger.h at line 284-285:
/** This is a pointer to the implementation class. */
spi::LoggerImpl * value;
The implementation of ctor and dtor in logger.cxx at line 105-110, 149-153:
Logger::Logger (spi::LoggerImpl * ptr)
: value (ptr)
{
if (value)
value->addReference ();
}
Logger::~Logger ()
{
if (value)
value->removeReference ();
}
Is that true?