+//
+const Kumu::Result_t&
+Kumu::Result_t::operator=(const Result_t& rhs)
+{
+ value = rhs.value;
+ symbol = rhs.symbol;
+ label = rhs.label;
+ message = rhs.message;
+ return *this;
+}
+
+//
+const Kumu::Result_t
+Kumu::Result_t::operator()(const std::string& message) const
+{
+ Result_t result = *this;
+ result.message = message;
+ return result;
+}
+
+static int const MESSAGE_BUF_MAX = 2048;
+
+//
+const Kumu::Result_t
+Kumu::Result_t::operator()(const int& line, const char* filename) const
+{
+ assert(filename);
+ char buf[MESSAGE_BUF_MAX];
+ snprintf(buf, MESSAGE_BUF_MAX-1, "%s, line %d", filename, line);
+
+ Result_t result = *this;
+ result.message = buf;
+ return result;
+}
+
+//
+const Kumu::Result_t
+Kumu::Result_t::operator()(const std::string& message, const int& line, const char* filename) const
+{
+ assert(filename);
+ char buf[MESSAGE_BUF_MAX];
+ snprintf(buf, MESSAGE_BUF_MAX-1, "%s, line %d", filename, line);
+
+ Result_t result = *this;
+ result.message = message + buf;
+ return result;
+}
+
+
+//------------------------------------------------------------------------------------------
+// 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);
+}