diff options
| author | jhurst <jhurst@cinecert.com> | 2007-07-20 05:12:53 +0000 |
|---|---|---|
| committer | jhurst <> | 2007-07-20 05:12:53 +0000 |
| commit | deaf5cf9df866a1632a310ae4e5e774ae7aeca68 (patch) | |
| tree | 2f718c6d4ccac17ce10976beaf73569ab4cbe7f8 /src | |
| parent | fe443bd90d915478994953b56836577a96ea4a28 (diff) | |
templates like this->
Diffstat (limited to 'src')
| -rw-r--r-- | src/AS_DCP_TimedText.cpp | 2 | ||||
| -rwxr-xr-x | src/KM_error.h | 29 | ||||
| -rw-r--r-- | src/KM_platform.h | 2 | ||||
| -rwxr-xr-x | src/KM_util.cpp | 20 |
4 files changed, 51 insertions, 2 deletions
diff --git a/src/AS_DCP_TimedText.cpp b/src/AS_DCP_TimedText.cpp index 84dd3ac..7f434a7 100644 --- a/src/AS_DCP_TimedText.cpp +++ b/src/AS_DCP_TimedText.cpp @@ -163,7 +163,7 @@ ASDCP::TimedText::MXFReader::h__Reader::MD_to_TimedText_TDesc(TimedText::TimedTe } } - return RESULT_OK; + return result; } // diff --git a/src/KM_error.h b/src/KM_error.h index a91d416..2d3513a 100755 --- a/src/KM_error.h +++ b/src/KM_error.h @@ -114,6 +114,35 @@ namespace Kumu return Kumu::RESULT_NULL_STR; \ } +namespace Kumu +{ + // simple tracing mechanism + class DTrace_t + { + DTrace_t(); + + protected: + const char* m_Label; + Result_t* m_Watch; + int m_Line; + const char* m_File; + int m_Sequence; + + public: + DTrace_t(const char* Label, Result_t* Watch, int Line, const char* File); + ~DTrace_t(); + }; +} + +#ifdef KM_TRACE +#define WDTRACE(l) DTrace_t __wl__Trace__((l), 0, __LINE__, __FILE__) +#define WDTRACER(l,r) DTrace_t __wl__Trace__((l), &(r), __LINE__, __FILE__) +#else +#define WDTRACE(l) +#define WDTRACER(l,r) +#endif + + #endif // _KM_ERROR_H_ // diff --git a/src/KM_platform.h b/src/KM_platform.h index 0c577a1..111cbbf 100644 --- a/src/KM_platform.h +++ b/src/KM_platform.h @@ -166,7 +166,7 @@ namespace Kumu inline T& operator*() const { return *m_p; } inline T* operator->() const { return m_p; } inline operator T*()const { return m_p; } - inline const mem_ptr<T>& operator=(T* p) { set(p); return *this; } + inline const mem_ptr<T>& operator=(T* p) { this->set(p); return *this; } inline T* set(T* p) { delete m_p; m_p = p; return m_p; } inline T* get() const { return m_p; } inline void release() { m_p = 0; } diff --git a/src/KM_util.cpp b/src/KM_util.cpp index 99bb4a9..6dd3d33 100755 --- a/src/KM_util.cpp +++ b/src/KM_util.cpp @@ -111,6 +111,26 @@ Kumu::Result_t::~Result_t() {} //------------------------------------------------------------------------------------------ +// DTrace internals + +static int s_DTraceSequence = 0; + +Kumu::DTrace_t::DTrace_t(const char* Label, Kumu::Result_t* Watch, int Line, const char* File) + : m_Label(Label), m_Watch(Watch), m_Line(Line), m_File(File) +{ + m_Sequence = s_DTraceSequence++; + DefaultLogSink().Debug("@enter %s[%d] (%s at %d)\n", m_Label, m_Sequence, m_File, m_Line); +} + +Kumu::DTrace_t::~DTrace_t() +{ + if ( m_Watch != 0 ) + DefaultLogSink().Debug("@exit %s[%d]: %s\n", m_Label, m_Sequence, m_Watch->Label()); + else + DefaultLogSink().Debug("@exit %s[%d]\n", m_Label, m_Sequence); +} + +//------------------------------------------------------------------------------------------ const char fill = '='; |
