Template Class for doing a split. More...
#include "rdm_time_series_split.h"
|
template<class ANY_NEXT > |
class |
RDM::DB::transaction
|
|
template<class ANY_NEXT_1 , class ANY_NEXT_2 > |
class |
split
|
|
template<uint32_t ANY_N, class ANY_RANGE_T , class ANY_NEXT > |
class |
collect
|
|
template<uint32_t ANY_N, class ANY_RANGE_T , class ANY_INDATA_T , class ANY_NEXT > |
class |
fft
|
|
template<uint32_t ANY_N, class ANY_AGGREGATE_T , class ANY_AGG_ELEMENT_T , class ANY_NEXT > |
class |
mean
|
|
template<class ANY_RATIO , class ANY_NEXT > |
class |
scale
|
|
template<uint32_t ANY_N, class ANY_STATS_T , class ANY_NEXT > |
class |
stats
|
|
template<uint32_t ANY_N, class ANY_NEXT > |
class |
downsample
|
|
template<class ANY_NEXT > |
class |
custom
|
|
template<class NEXT_1, class NEXT_2>
class RDM::TIME_SERIES::split< NEXT_1, NEXT_2 >
Template Class for doing a split.
Template class for 2-way split of data values, ranges, or statistics. What is received by this class will be forwarded to both classes in the split.
- Template Parameters
-
NEXT_1 |
The first class in the chain of classes for the split to receive data, ranges, or statistics. |
NEXT_2 |
The second class in the chain of classes for the split to receive data, ranges, or statistics. |
- Examples
- cpp70Example_main.cpp, time_series_fft.cpp, and time_series_restore_aggregate.cpp.
flush_range()
template<class NEXT_1 , class NEXT_2 >
Flush this object.
Call this method to flush ranges that have been collected so far. A threshold can also be provided. All the data collected for those ranges will be kept as is. The same is the case where the threshold has not been reached.
This operation can be specified as being transactional. However, if the caller always rolls back the transaction in the case of a failure, there is no need to specify single operations to be transactional.
- Return values
-
sOKAY |
Normal, successful return. |
eNOSTARTUPDATE |
An update operation was attempted when no rdm_dbStartUpdate() is active. |
eNOTLOCKED |
Attempt to access a table for reading or update without proper locks. |
eCURSORDB |
Cursor is associated with a different database. |
eDBNOTOPEN |
Database not open. |
ePRECOMMITTED |
A precommitted transaction must be committed or rolled back before further operations on this database are allowed. |
eDUPLICATE |
Attempt to insert a duplicate value as a unique/primary key. |
eREADONLY |
Database is read-only and cannot be updated. |
eREFINTEGRITY |
Integrity constraint violation. |
eROWLIMIT |
Table row limit reached. |
eINVARG |
Invalid argument. |
- Parameters
-
threshold |
[IN] Only flush objects where at least this many elements have been collected |
transactional |
[IN] Is the flush required to be transactional |
flush_stats()
template<class NEXT_1 , class NEXT_2 >
Flush this object.
Call this method to flush statistics that have been collected so far. A threshold can also be provided. All the data collected for those statistics will be kept as is. The same is the case where the threshold has not been reached.
This operation can be specified as being transactional. However, if the caller always rolls back the transaction in the case of a failure, there is no need to specify single operations to be transactional.
- Return values
-
sOKAY |
Normal, successful return. |
eNOSTARTUPDATE |
An update operation was attempted when no rdm_dbStartUpdate() is active. |
eNOTLOCKED |
Attempt to access a table for reading or update without proper locks. |
eCURSORDB |
Cursor is associated with a different database. |
eDBNOTOPEN |
Database not open. |
ePRECOMMITTED |
A precommitted transaction must be committed or rolled back before further operations on this database are allowed. |
eDUPLICATE |
Attempt to insert a duplicate value as a unique/primary key. |
eREADONLY |
Database is read-only and cannot be updated. |
eREFINTEGRITY |
Integrity constraint violation. |
eROWLIMIT |
Table row limit reached. |
eINVARG |
Invalid argument. |
- Parameters
-
threshold |
[IN] Only flush objects where at least this many elements have been collected |
transactional |
[IN] Is the flush required to be transactional |
flush_value()
template<class NEXT_1 , class NEXT_2 >
Flush this object.
Call this method to flush values that have been collected so far. A threshold can also be provided. All the data collected for those values will be kept as is. The same is the case where the threshold has not been reached.
This operation can be specified as being transactional. However, if the caller always rolls back the transaction in the case of a failure, there is no need to specify single operations to be transactional.
- Return values
-
sOKAY |
Normal, successful return. |
eNOSTARTUPDATE |
An update operation was attempted when no rdm_dbStartUpdate() is active. |
eNOTLOCKED |
Attempt to access a table for reading or update without proper locks. |
eCURSORDB |
Cursor is associated with a different database. |
eDBNOTOPEN |
Database not open. |
ePRECOMMITTED |
A precommitted transaction must be committed or rolled back before further operations on this database are allowed. |
eDUPLICATE |
Attempt to insert a duplicate value as a unique/primary key. |
eREADONLY |
Database is read-only and cannot be updated. |
eREFINTEGRITY |
Integrity constraint violation. |
eROWLIMIT |
Table row limit reached. |
eINVARG |
Invalid argument. |
- Parameters
-
threshold |
[IN] Only flush objects where at least this many elements have been collected |
transactional |
[IN] Is the flush required to be transactional |
get_serialize_size()
template<class NEXT_1 , class NEXT_2 >
Get the size of a buffer for serialization to hold its state.
Get the size needed for a buffer to hold the state of this object.
53return NEXT_1::get_serialize_size () + NEXT_2::get_serialize_size ();
init()
template<class NEXT_1 , class NEXT_2 >
Initialize this object.
Call this method before sending it any data values, ranges, or statistics.
- Return values
-
sOKAY |
Normal, successful return. |
eINVARG |
Invalid argument. |
eDBNOTOPEN |
Database not open. |
eCURSORDB |
Cursor is associated with a different database. |
ePRECOMMITTED |
A precommitted transaction must be committed or rolled back before further operations on this database are allowed. |
- Parameters
-
p_db |
[IN] Use this database for chained classes that need to insert rows |
put_range()
template<class NEXT_1 , class NEXT_2 >
template<class SOURCE_RANGE_T >
Template method for receiving ranges.
Receive one range and process it accordingly.
The type for the value provided is required to have columns for 'time_stamp_first', 'time_stamp_last', and 'value_range' with appropriate types. The column 'value_range' must be an array that is able to hold a static number of elements. Such a type can be generated using rdm-compile with a schema including a table similar to this:
CREATE TABLE range
(
value_range DOUBLE ARRAY [32] NOT NULL,
time_stamp_first UINT64 NOT NULL,
time_stamp_last UINT64 PRIMARY KEY
);
- Template Parameters
-
SOURCE_RANGE_T |
The actual type of the range received. |
This operation can be specified as being transactional. However, if the caller always rolls back the transaction in the case of a failure, there is no need to specify single operations to be transactional.
- Return values
-
sOKAY |
Normal, successful return. |
eNOSTARTUPDATE |
An update operation was attempted when no rdm_dbStartUpdate() is active. |
eNOTLOCKED |
Attempt to access a table for reading or update without proper locks. |
eCURSORDB |
Cursor is associated with a different database. |
eDBNOTOPEN |
Database not open. |
ePRECOMMITTED |
A precommitted transaction must be committed or rolled back before further operations on this database are allowed. |
eDUPLICATE |
Attempt to insert a duplicate value as a unique/primary key. |
eREADONLY |
Database is read-only and cannot be updated. |
eREFINTEGRITY |
Integrity constraint violation. |
eROWLIMIT |
Table row limit reached. |
eINVARG |
Invalid argument. |
- Parameters
-
[in] |
source_range |
The source range sent to this class |
|
transactional |
[IN] Is the put required to be transactional |
put_stats()
template<class NEXT_1 , class NEXT_2 >
template<class SOURCE_STATS_T >
Template method for receiving statistics.
Receive one statistic and process it accordingly.
The type for the value provided is required to have columns for 'time_stamp_first', 'time_stamp_last', 'n', 'value_sum', and 'value_sum2' with appropriate types. Such a type can be generated using rdm-compile with a schema including a table similar to this:
CREATE TABLE stats
(
time_stamp_first UINT64 NOT NULL,
time_stamp_last UINT64 PRIMARY KEY,
n UINT64 NOT NULL,
value_sum DOUBLE NOT NULL,
value_sum2 DOUBLE NOT NULL
);
This operation can be specified as being transactional. However, if the caller always rolls back the transaction in the case of a failure, there is no need to specify single operations to be transactional.
- Template Parameters
-
SOURCE_STATS_T |
The actual type of the statistic received. |
- Return values
-
sOKAY |
Normal, successful return. |
eNOSTARTUPDATE |
An update operation was attempted when no rdm_dbStartUpdate() is active. |
eNOTLOCKED |
Attempt to access a table for reading or update without proper locks. |
eCURSORDB |
Cursor is associated with a different database. |
eDBNOTOPEN |
Database not open. |
ePRECOMMITTED |
A precommitted transaction must be committed or rolled back before further operations on this database are allowed. |
eDUPLICATE |
Attempt to insert a duplicate value as a unique/primary key. |
eREADONLY |
Database is read-only and cannot be updated. |
eREFINTEGRITY |
Integrity constraint violation. |
eROWLIMIT |
Table row limit reached. |
eINVARG |
Invalid argument. |
- Parameters
-
[in] |
source_stats |
The source statistics sent to this class |
|
transactional |
[IN] Is the put required to be transactional |
put_value()
template<class NEXT_1 , class NEXT_2 >
template<class SOURCE_VALUE_T >
Template method for receiving a data value.
Receive one data value and process it accordingly.
The type for the value provided is required to have columns for 'time_stamp_current' and 'value_current' with appropriate types. Such a type can be generated using rdm-compile with a schema including a table similar to this:
CREATE TABLE measurement
(
time_stamp_current UINT64 PRIMARY KEY,
value_current DOUBLE NOT NULL
);
This operation can be specified as being transactional. However, if the caller always rolls back the transaction in the case of a failure, there is no need to specify single operations to be transactional.
- Template Parameters
-
SOURCE_VALUE_T |
The actual type of the source values received |
- Return values
-
sOKAY |
Normal, successful return. |
eNOSTARTUPDATE |
An update operation was attempted when no rdm_dbStartUpdate() is active. |
eNOTLOCKED |
Attempt to access a table for reading or update without proper locks. |
eCURSORDB |
Cursor is associated with a different database. |
eDBNOTOPEN |
Database not open. |
ePRECOMMITTED |
A precommitted transaction must be committed or rolled back before further operations on this database are allowed. |
eDUPLICATE |
Attempt to insert a duplicate value as a unique/primary key. |
eREADONLY |
Database is read-only and cannot be updated. |
eREFINTEGRITY |
Integrity constraint violation. |
eROWLIMIT |
Table row limit reached. |
eINVARG |
Invalid argument. |
- Parameters
-
[in] |
source_value |
The source value sent to this class |
|
transactional |
[IN] Is the put required to be transactional |
reset()
template<class NEXT_1 , class NEXT_2 >
Reset this object.
Call this method to discard all internally kept data values, ranges, and statistics that have not yet been persisted and start over from scratch.
serialize()
template<class NEXT_1 , class NEXT_2 >
64 buffer =
next_1.serialize (buffer);
65return next_2.serialize (buffer);
unserialize()
template<class NEXT_1 , class NEXT_2 >
76 buffer =
next_1.unserialize (buffer);
77return next_2.unserialize (buffer);
collect
template<class NEXT_1 , class NEXT_2 >
template<uint32_t ANY_N, class ANY_RANGE_T , class ANY_NEXT >
custom
template<class NEXT_1 , class NEXT_2 >
template<class ANY_NEXT >
downsample
template<class NEXT_1 , class NEXT_2 >
template<uint32_t ANY_N, class ANY_NEXT >
fft
template<class NEXT_1 , class NEXT_2 >
template<uint32_t ANY_N, class ANY_RANGE_T , class ANY_INDATA_T , class ANY_NEXT >
mean
template<class NEXT_1 , class NEXT_2 >
template<uint32_t ANY_N, class ANY_AGGREGATE_T , class ANY_AGG_ELEMENT_T , class ANY_NEXT >
RDM::DB::transaction
template<class NEXT_1 , class NEXT_2 >
template<class ANY_NEXT >
scale
template<class NEXT_1 , class NEXT_2 >
template<class ANY_RATIO , class ANY_NEXT >
split
template<class NEXT_1 , class NEXT_2 >
template<class ANY_NEXT_1 , class ANY_NEXT_2 >
stats
template<class NEXT_1 , class NEXT_2 >
template<uint32_t ANY_N, class ANY_STATS_T , class ANY_NEXT >
next_1
template<class NEXT_1 , class NEXT_2 >
The first class to pass data values, ranges, or statistics to
Referenced by RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::flush_range(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::flush_stats(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::flush_value(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::init(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::put_range(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::put_stats(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::put_value(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::reset(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::serialize(), and RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::unserialize().
next_2
template<class NEXT_1 , class NEXT_2 >
The second class to pass data values, ranges, or statistics to
Referenced by RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::flush_range(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::flush_stats(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::flush_value(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::init(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::put_range(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::put_stats(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::put_value(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::reset(), RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::serialize(), and RDM::TIME_SERIES::split< split< split< split< NEXT_1, NEXT_2 >, NEXT_3 >, NEXT_4 >, NEXT_5 >::unserialize().
The documentation for this class was generated from the following files:
RDM_RETCODE rdm_transEnd(RDM_TRANS trans)
End a transactional operation.
@ NOT_TRANSACTIONAL
Definition: rdm_db_transaction.h:36
RDM_RETCODE rdm_transEndRollback(RDM_TRANS trans)
End a transactional operation with a rollback.
@ sOKAY
Definition: rdmretcodetypes.h:100
struct RDM_TRANS_S * RDM_TRANS
Definition: rdmtypes.h:349
enum RDM_RETCODE_E RDM_RETCODE
RaimaDB status and error return codes.
NEXT_2 next_2
Definition: rdm_time_series_split.h:45
NEXT_1 next_1
Definition: rdm_time_series_split.h:44
RDM_RETCODE rdm_dbStartUpdate(RDM_DB db, const RDM_TABLE_ID *writeTableIds, uint32_t numWriteTableIds, const RDM_TABLE_ID *readTableIds, uint32_t numReadTableIds, RDM_TRANS *pTrans)
Get write locks.
@ TRANSACTIONAL
Definition: rdm_db_transaction.h:35