13 #ifndef CROSS_THREAD_BUF_HPP
14 #define CROSS_THREAD_BUF_HPP
16 #include <Poco/Condition.h>
17 #include <Poco/Mutex.h>
18 #include <Poco/Random.h>
19 #include <Poco/ScopedLock.h>
20 #include <Poco/SharedPtr.h>
21 #include <Poco/Timestamp.h>
25 #include <msgpack.hpp>
29 #define MICRO_SEC_MULTIPLIER 1000
39 unsigned int highlightCounter;
40 unsigned long long id;
41 unsigned long long resCrc;
42 msgpack::sbuffer msgPackBuf;
44 ResElement(
const ResElement &element): inData(element.inData), outData(element.outData), highlightCounter(element.highlightCounter), id(element.id), resCrc(element.resCrc), msgPackBuf() {}
45 ResElement():inData(
""), outData(
""), highlightCounter(0), id(0), resCrc(0), msgPackBuf() {}
49 unsigned long long getId()
const {
return id;}
50 unsigned long long getResCrc()
const {
return resCrc;}
55 outData = elem.outData;
56 highlightCounter = elem.highlightCounter;
59 msgPackBuf.write(elem.msgPackBuf.data(), elem.msgPackBuf.size());
62 void setInData(std::string _inData) {inData = _inData;}
63 void setOutData(std::string _outData) {outData = _outData;}
64 void setId(
unsigned long long _id) {
id = _id;}
65 void setResCrc(
unsigned long long _resCrc) {resCrc = _resCrc;}
87 ResElement&
getElem(
unsigned int index);
88 std::string &
getIntData(
unsigned int &index,
unsigned long long &
id,
unsigned long long &resCrc);
89 void setOutData(std::string &outData,
unsigned int highlightCounter,
unsigned int index);
93 void waitCv(
long milliseconds);