TwiceAsNice
2019-02-18
|
An actor which can the attached to a Property. Any time its Property value changes the new value is stored in the buffer object together with the timestamp comming either from the Property itself or from the local process (if remote values are bufferd). The Size of the buffer is initially defined by a AttributeMap which contains the Attribute BUFSIZE or can be set during runtime by calling the setBufferSize in microseconds. For performance reasons all internal data is stored as Nice::Any types. When the data vector is requested for a certain data type, the Nice::Any vector has to be coppied to a vector of another type. This is very time consuming and shoould only be done with caution. More...
#include <BridgeBuffer.h>
Public Member Functions | |
PropertyBridgeBuffer (Nice::I64 _bufsize=1000, bool _localTime=false) | |
Contructor. More... | |
PropertyBridgeBuffer (const std::string &_param) | |
String based contructor. More... | |
PropertyBridgeBuffer (const PropertyBridgeBuffer *_buffer) | |
Copyconstructor. More... | |
virtual | ~PropertyBridgeBuffer () |
Destructor. More... | |
virtual void | init (const PropertyPtr &_property) |
Initialize the buffer with a Property to buffer and Attributes which contain the initial buffer size. More... | |
virtual void | clear () |
Clear the buffer content. More... | |
virtual void | setBufferSize (Nice::I64 _size) |
Set the buffer size. More... | |
template<typename E > | |
std::vector< E > | getDataVector () |
Get the vectorized data as a vector of Es. More... | |
std::vector< Nice::Any > | getDataVector () |
Get the vectorized data as a vector of Nice:::Any. More... | |
virtual std::vector< Nice::Date > | getTimeVector () |
Get the vectorized time stamps as a vector of Nice::Date. More... | |
virtual Nice::I64 | bufferSize () |
Get the buffer size in microseconds. More... | |
void | insertSorted (const Nice::Date &_date, const Nice::Any &_value) |
Insert new data according to a timestamp. More... | |
virtual void | set (Nice::CompletionState, const Nice::Any &_value, Nice::I64, const Nice::DateVar &_date) |
Append new data to the buffer. More... | |
virtual std::string | name () const |
return bridge name. More... | |
virtual const std::string & | identity () |
return bridge id. More... | |
virtual const std::string & | type () |
virtual std::string | toString () const |
return bridge name. More... | |
virtual PropertyBridgeBuffer * | clone () |
Clone this instance. More... | |
PropertyBridgeBuffer (Nice::I64 _bufsize=1000, bool _localTime=false) | |
Contructor. More... | |
PropertyBridgeBuffer (const std::string &_param) | |
String based contructor. More... | |
PropertyBridgeBuffer (const PropertyBridgeBuffer *_buffer) | |
Copyconstructor. More... | |
virtual | ~PropertyBridgeBuffer () |
Destructor. More... | |
virtual void | init (const PropertyPtr &_property) |
Initialize the buffer with a Property to buffer and Attributes which contain the initial buffer size. More... | |
virtual void | clear () |
Clear the buffer content. More... | |
virtual void | setBufferSize (Nice::I64 _size) |
Set the buffer size. More... | |
template<typename E > | |
std::vector< E > | getDataVector () |
Get the vectorized data as a vector of Es. More... | |
std::vector< Nice::Any > | getDataVector () |
Get the vectorized data as a vector of Nice:::Any. More... | |
virtual std::vector< Nice::Date > | getTimeVector () |
Get the vectorized time stamps as a vector of Nice::Date. More... | |
virtual Nice::I64 | bufferSize () |
Get the buffer size in microseconds. More... | |
void | insertSorted (const Nice::Date &_date, const Nice::Any &_value) |
Insert new data according to a timestamp. More... | |
virtual void | set (Nice::CompletionState, const Nice::Any &_value, Nice::I64, const Nice::DateVar &_date) |
Append new data to the buffer. More... | |
virtual std::string | name () const |
return bridge name. More... | |
virtual const std::string & | identity () |
return bridge id. More... | |
virtual const std::string & | type () |
virtual std::string | toString () const |
return bridge name. More... | |
virtual PropertyBridgeBuffer * | clone () |
Clone this instance. More... | |
![]() | |
PropertyBridge () | |
Constructor. More... | |
virtual | ~PropertyBridge () |
Destructor. More... | |
virtual void | disconnect () |
Abstract function to connect an instance of THIS bridge to another bridge. More... | |
PropertyBridge () | |
Constructor. More... | |
virtual | ~PropertyBridge () |
Destructor. More... | |
virtual void | disconnect () |
Abstract function to connect an instance of THIS bridge to another bridge. More... | |
Public Attributes | |
std::deque< Nice::Date > | m_time |
std::deque< Nice::Any > | m_data |
Nice::I64 | m_bufsize |
bool | m_localTime |
std::string | m_identity |
Protected Attributes | |
std::string | m_type |
![]() | |
Nice::Property * | m_property |
Private Attributes | |
Nice::Mutex | m_mutex |
An actor which can the attached to a Property. Any time its Property value changes the new value is stored in the buffer object together with the timestamp comming either from the Property itself or from the local process (if remote values are bufferd). The Size of the buffer is initially defined by a AttributeMap which contains the Attribute BUFSIZE or can be set during runtime by calling the setBufferSize in microseconds. For performance reasons all internal data is stored as Nice::Any types. When the data vector is requested for a certain data type, the Nice::Any vector has to be coppied to a vector of another type. This is very time consuming and shoould only be done with caution.
|
inline |
Contructor.
_bufsize | Buffer size in microseconds @ param _localtime If true the time of the current process is taken as the timestamp. Otherwise the Property time stamp is taken. |
|
inline |
String based contructor.
_param | Paramter to contruct an instance of this class. |
|
inline |
Copyconstructor.
_buffer | Buffer to copy. |
|
inlinevirtual |
Destructor.
|
inline |
Contructor.
_bufsize | Buffer size in microseconds @ param _localtime If true the time of the current process is taken as the timestamp. Otherwise the Property time stamp is taken. |
|
inline |
String based contructor.
_param | Paramter to contruct an instance of this class. |
|
inline |
Copyconstructor.
_buffer | Buffer to copy. |
|
inlinevirtual |
Destructor.
|
inlinevirtual |
Get the buffer size in microseconds.
|
inlinevirtual |
Get the buffer size in microseconds.
|
inlinevirtual |
Clear the buffer content.
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
Clear the buffer content.
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
Clone this instance.
Reimplemented in Nice::PropertyBridgePlotBufferImpl< std::vector< T > >, Nice::PropertyBridgePlotBufferImpl< std::vector< T > >, Nice::PropertyBridgePlotBufferImpl< T >, Nice::PropertyBridgePlotBufferImpl< T >, Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
Clone this instance.
Reimplemented in Nice::PropertyBridgePlotBufferImpl< std::vector< T > >, Nice::PropertyBridgePlotBufferImpl< std::vector< T > >, Nice::PropertyBridgePlotBufferImpl< T >, Nice::PropertyBridgePlotBufferImpl< T >, Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inline |
Get the vectorized data as a vector of Es.
|
inline |
Get the vectorized data as a vector of Es.
|
inline |
|
inline |
|
inlinevirtual |
Get the vectorized time stamps as a vector of Nice::Date.
|
inlinevirtual |
Get the vectorized time stamps as a vector of Nice::Date.
|
inlinevirtual |
return bridge id.
Implements Nice::PropertyBridge.
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
return bridge id.
Implements Nice::PropertyBridge.
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
Initialize the buffer with a Property to buffer and Attributes which contain the initial buffer size.
_foo | PropertyFoo pointer containing the data to buffer. |
_attrs | Attribute map which caontains a BUFSIZE attribute. |
Reimplemented from Nice::PropertyBridge.
|
inlinevirtual |
Initialize the buffer with a Property to buffer and Attributes which contain the initial buffer size.
_foo | PropertyFoo pointer containing the data to buffer. |
_attrs | Attribute map which caontains a BUFSIZE attribute. |
Reimplemented from Nice::PropertyBridge.
|
inline |
Insert new data according to a timestamp.
The new data is inserted at the right position into the vector. This function is very time consuming. Only use this function if data is set to the buffer in the wrong chronological order because of multithreading.
_date | Timestamp. |
_value | New value. |
|
inline |
Insert new data according to a timestamp.
The new data is inserted at the right position into the vector. This function is very time consuming. Only use this function if data is set to the buffer in the wrong chronological order because of multithreading.
_date | Timestamp. |
_value | New value. |
|
inlinevirtual |
return bridge name.
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
return bridge name.
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
Append new data to the buffer.
The timestamp is not validated and so the vectors time/data are not kept in the right chronological order.
_date | Timestamp |
Implements Nice::PropertyBridge.
Reimplemented in Nice::PropertyBridgePlotBufferImpl< std::vector< T > >, Nice::PropertyBridgePlotBufferImpl< std::vector< T > >, Nice::PropertyBridgePlotBufferImpl< T >, and Nice::PropertyBridgePlotBufferImpl< T >.
|
inlinevirtual |
Append new data to the buffer.
The timestamp is not validated and so the vectors time/data are not kept in the right chronological order.
_date | Timestamp |
Implements Nice::PropertyBridge.
Reimplemented in Nice::PropertyBridgePlotBufferImpl< std::vector< T > >, Nice::PropertyBridgePlotBufferImpl< std::vector< T > >, Nice::PropertyBridgePlotBufferImpl< T >, and Nice::PropertyBridgePlotBufferImpl< T >.
|
inlinevirtual |
Set the buffer size.
_size | New buffer size in microseconds. |
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
Set the buffer size.
_size | New buffer size in microseconds. |
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
return bridge name.
Implements Nice::PropertyBridge.
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
return bridge name.
Implements Nice::PropertyBridge.
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
Implements Nice::PropertyBridge.
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
|
inlinevirtual |
Implements Nice::PropertyBridge.
Reimplemented in Nice::PropertyBridgePlotBuffer, and Nice::PropertyBridgePlotBuffer.
Nice::I64 Nice::PropertyBridgeBuffer::m_bufsize |
std::deque< Nice::Any > Nice::PropertyBridgeBuffer::m_data |
std::string Nice::PropertyBridgeBuffer::m_identity |
bool Nice::PropertyBridgeBuffer::m_localTime |
|
private |
Mutex
std::deque< Nice::Date > Nice::PropertyBridgeBuffer::m_time |
|
protected |