logging-log4cxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Dahl <jdahl1...@yahoo.com>
Subject Forward Declaration
Date Fri, 12 Sep 2008 17:00:39 GMT
Hello,

I'm wondering if it is possible to use forward declaration with log4cxx classes in a class
header file. I would like to exclude the log4cxx headers files in my header files if possible
and include the log4cxx header files in my cpp(source) files.

Should this work?

// Test.hpp
namespace log4cxx {
class LoggerPtr;
}

class Test {
private:
    static log4cxx:LoggerPtr    _logger;

public:
    Test();
};

//Test.cpp

#include <log4cxx/logger.h>

using namespace log4cxx;

LoggerPtr Test::_logger(Logger::getRootLogger());

Test::Test() {
}

// end test.cpp

Thanks,

-jd-



      
Mime
View raw message