33 #ifndef __XPLC_TRACE_H__
34 #define __XPLC_TRACE_H__
36 #if defined(__GNUC__) && __GNUC__ > 3
37 # pragma GCC system_header
48 template<
class Component>
49 class TraceComponent:
public Component {
52 fprintf(stderr,
"%s: instantiated (%p)\n", __PRETTY_FUNCTION__,
this);
54 virtual unsigned int addRef() {
55 unsigned int refcount = Component::addRef();
57 fprintf(stderr,
"%s = %i (%p)\n", __PRETTY_FUNCTION__, refcount,
this);
61 virtual unsigned int release() {
62 unsigned int refcount = Component::release();
64 fprintf(stderr,
"%s = %i (%p)\n", __PRETTY_FUNCTION__, refcount,
this);
68 virtual ~TraceComponent() {
69 fprintf(stderr,
"%s: destroyed (%p)\n", __PRETTY_FUNCTION__,
this);
75 #error "this header should not be used other than for debugging"