summaryrefslogtreecommitdiff
path: root/orkbasecxx
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2007-04-12 22:07:45 +0000
committerHenri Herscher <henri@oreka.org>2007-04-12 22:07:45 +0000
commitc78e205237f0fd156f46ca104ee188107c53a1af (patch)
tree732c3be1f9d18492b2f1491f5fbec155050349d6 /orkbasecxx
parent99f1724a10f8a892cb354d827fff7d21050eb8f3 (diff)
Key-Value CaptureEvent messages are now reported as tags to orktrack.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@436 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkbasecxx')
-rw-r--r--orkbasecxx/AudioTape.cpp10
-rw-r--r--orkbasecxx/AudioTape.h2
-rw-r--r--orkbasecxx/messages/TapeMsg.cpp2
-rw-r--r--orkbasecxx/messages/TapeMsg.h3
4 files changed, 16 insertions, 1 deletions
diff --git a/orkbasecxx/AudioTape.cpp b/orkbasecxx/AudioTape.cpp
index 7f0aadf..593f7c3 100644
--- a/orkbasecxx/AudioTape.cpp
+++ b/orkbasecxx/AudioTape.cpp
@@ -278,14 +278,19 @@ void AudioTape::AddCaptureEvent(CaptureEventRef eventRef, bool send)
break;
}
- // Store the capture event locally
{
MutexSentinel sentinel(m_mutex);
+ // Store the capture event locally
m_eventQueue.push(eventRef);
if (send)
{
m_toSendEventQueue.push(eventRef);
}
+ // Store the tags
+ if(eventRef->m_type == CaptureEvent::EtKeyValue && eventRef->m_value.size() > 0 && eventRef->m_key.size() > 0)
+ {
+ m_tags.insert(std::make_pair(eventRef->m_key, eventRef->m_value));
+ }
}
}
@@ -333,6 +338,9 @@ void AudioTape::PopulateTapeMessage(TapeMsg* msg, CaptureEvent::EventTypeEnum ev
msg->m_timestamp = m_beginDate;
msg->m_localIp = m_localIp;
msg->m_remoteIp = m_remoteIp;
+
+ MutexSentinel sentinel(m_mutex);;
+ std::copy(m_tags.begin(), m_tags.end(), std::inserter(msg->m_tags, msg->m_tags.begin()));
}
void AudioTape::GenerateCaptureFilePathAndIdentifier()
diff --git a/orkbasecxx/AudioTape.h b/orkbasecxx/AudioTape.h
index 6690316..91ffccb 100644
--- a/orkbasecxx/AudioTape.h
+++ b/orkbasecxx/AudioTape.h
@@ -116,6 +116,8 @@ private:
bool m_shouldStop;
bool m_readyForBatchProcessing;
CStdString m_orkUid;
+
+ std::map<CStdString, CStdString> m_tags;
};
typedef boost::shared_ptr<AudioTape> AudioTapeRef;
diff --git a/orkbasecxx/messages/TapeMsg.cpp b/orkbasecxx/messages/TapeMsg.cpp
index 9297973..755048c 100644
--- a/orkbasecxx/messages/TapeMsg.cpp
+++ b/orkbasecxx/messages/TapeMsg.cpp
@@ -48,6 +48,8 @@ void TapeMsg::Define(Serializer* s)
//s->StringValue(LOCAL_MAC_PARAM, m_localMac);
//s->StringValue(REMOTE_MAC_PARAM, m_remoteMac);
+ s->CsvMapValue(TAGS_PARAM, m_tags);
+
DefineMessage(s);
}
diff --git a/orkbasecxx/messages/TapeMsg.h b/orkbasecxx/messages/TapeMsg.h
index 09a95d8..7f17faf 100644
--- a/orkbasecxx/messages/TapeMsg.h
+++ b/orkbasecxx/messages/TapeMsg.h
@@ -31,6 +31,7 @@
#define REMOTE_IP_PARAM "remoteip"
#define LOCAL_MAC_PARAM "localmac"
#define REMOTE_MAC_PARAM "remotemac"
+#define TAGS_PARAM "tags"
class DLL_IMPORT_EXPORT_ORKBASE TapeMsg : public SyncMessage
{
@@ -59,6 +60,8 @@ public:
CStdString m_remoteIp;
CStdString m_localMac;
CStdString m_remoteMac;
+
+ std::map<CStdString, CStdString> m_tags;
};
typedef boost::shared_ptr<TapeMsg> TapeMsgRef;