Go to the source code of this file.
|
| log4cxx::helpers::LOG4CXX_PTR_DEF (Object) |
|
template<typename Ret , typename Type , bool = std::is_base_of<Ret, helpers::Object>::value, bool = std::is_base_of<Type, helpers::Object>::value> |
std::shared_ptr< Ret > | log4cxx::cast (const std::shared_ptr< Type > &incoming) |
| Attempt to cast one Object to another kind of Object.
|
|
◆ BEGIN_LOG4CXX_CAST_MAP
#define BEGIN_LOG4CXX_CAST_MAP |
( |
| ) |
|
Value: const void * cast(const helpers::Class& clazz) const override\
{\
const void * object = 0;\
if (&clazz == &helpers::Object::getStaticClass()) return (const helpers::Object *)this;
- Examples
- custom-appender.cpp.
◆ DECLARE_ABSTRACT_LOG4CXX_OBJECT
#define DECLARE_ABSTRACT_LOG4CXX_OBJECT |
( |
|
object | ) |
|
Value:
const helpers::Class& getClass() const override;
#define DECLARE_LOG4CXX_CLAZZ_OBJECT(object)
Definition: object.h:27
◆ DECLARE_LOG4CXX_CLAZZ_OBJECT
#define DECLARE_LOG4CXX_CLAZZ_OBJECT |
( |
|
object | ) |
|
Value: public:\
class Clazz##object : public helpers::Class\
{\
public:\
Clazz##object() : helpers::Class() {}\
virtual ~Clazz##object() {}\
virtual LOG4CXX_NS::LogString getName() const { return LOG4CXX_STR(#object); } \
};\
static const helpers::Class& getStaticClass(); \
static const LOG4CXX_NS::helpers::ClassRegistration& registerClass();
◆ DECLARE_LOG4CXX_OBJECT
#define DECLARE_LOG4CXX_OBJECT |
( |
|
object | ) |
|
Value: public:\
class Clazz##object : public helpers::Class\
{\
public:\
Clazz##object() : helpers::Class() {}\
virtual ~Clazz##object() {}\
virtual LOG4CXX_NS::LogString getName() const { return LOG4CXX_STR(#object); } \
virtual object* newInstance() const\
{\
return new object();\
}\
};\
const helpers::Class& getClass() const override;\
static const helpers::Class& getStaticClass(); \
static const LOG4CXX_NS::helpers::ClassRegistration& registerClass();
- Examples
- custom-appender.cpp.
◆ DECLARE_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS
#define DECLARE_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS |
( |
|
object, |
|
|
|
class |
|
) |
| |
Value: public:\
const helpers::Class& getClass() const override;\
static const helpers::Class& getStaticClass();\
static const LOG4CXX_NS::helpers::ClassRegistration& registerClass();
◆ END_LOG4CXX_CAST_MAP
#define END_LOG4CXX_CAST_MAP |
( |
| ) |
|
Value: return object;\
}\
bool instanceof(const helpers::Class& clazz) const override\
{ return cast(clazz) != 0; }
- Examples
- custom-appender.cpp.
◆ IMPLEMENT_LOG4CXX_OBJECT
#define IMPLEMENT_LOG4CXX_OBJECT |
( |
|
object | ) |
|
Value: const ::LOG4CXX_NS::helpers::Class& object::getClass() const { return getStaticClass(); }\
const ::LOG4CXX_NS::helpers::Class& object::getStaticClass() { \
static ::LOG4CXX_NS::helpers::WideLife<Clazz##object> theClass; \
return theClass; \
} \
const LOG4CXX_NS::helpers::ClassRegistration& object::registerClass() { \
static ::LOG4CXX_NS::helpers::WideLife<::LOG4CXX_NS::helpers::ClassRegistration> classReg(object::getStaticClass); \
return classReg; \
}\
const ::LOG4CXX_NS::helpers::ClassRegistration& object##Registration = object::registerClass(); \
} }
#define LOG4CXX_NS
Definition: log4cxx.h:104
- Examples
- custom-appender.cpp.
◆ IMPLEMENT_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS
#define IMPLEMENT_LOG4CXX_OBJECT_WITH_CUSTOM_CLASS |
( |
|
object, |
|
|
|
class |
|
) |
| |
Value: const LOG4CXX_NS::helpers::Class& object::getClass() const { return getStaticClass(); }\
const LOG4CXX_NS::helpers::Class& object::getStaticClass() { \
static LOG4CXX_NS::helpers::WideLife<class> theClass; \
return theClass; \
} \
const LOG4CXX_NS::helpers::ClassRegistration& object::registerClass() { \
static LOG4CXX_NS::helpers::WideLife<LOG4CXX_NS::helpers::ClassRegistration> classReg(object::getStaticClass); \
return classReg; \
}\
const LOG4CXX_NS::helpers::ClassRegistration& object##Registration = object::registerClass(); \
} }
◆ LOG4CXX_CAST_ENTRY
#define LOG4CXX_CAST_ENTRY |
( |
|
Interface | ) |
if (&clazz == &Interface::getStaticClass()) return (const Interface *)this; |
◆ LOG4CXX_CAST_ENTRY2
#define LOG4CXX_CAST_ENTRY2 |
( |
|
Interface, |
|
|
|
interface2 |
|
) |
| if (&clazz == &Interface::getStaticClass()) return (Interface *)(interface2 *)this; |
◆ LOG4CXX_CAST_ENTRY_CHAIN
#define LOG4CXX_CAST_ENTRY_CHAIN |
( |
|
Interface | ) |
|
Value: object = Interface::cast(clazz);\
if (object != 0) return object;
- Examples
- custom-appender.cpp.