![]() |
Trading System API
3.0
Library for Simulating and Deploying Trading and Investment Strategies
|
Class representing a database record. More...
#include <TSADBRecord.h>
Public Member Functions | |
record (const record &record) | |
Copy Constructor. More... | |
record (size_t num_fields) | |
Constructor. Sets record size to num_fields. Do not include the timestamp property in this number of fields as record timestamps are considered implicit to all records. is_init() will return false until a valid timestamp has been set via timstamp(). More... | |
~record (void) | |
Destructor. | |
void | clear (void) |
Sets the record's timestamp member as well as all value fields to an undefined state. | |
void | operator= (fast::db_record *record) |
Copies values from given (internal) record representation. More... | |
const variant & | operator[] (size_t position) const |
Returns the value stored at given position. It is up to the user to ensure that position is does not cause a bounds error. More... | |
variant & | operator[] (size_t position) |
Returns a non const reference to the variant at given position. This reference can be used to update the value. More... | |
void | print (std::ostream &stream) |
Prints the record to given stream. More... | |
size_t | size (void) const |
Returns the size (number of fields) of the record. The timestamp property is not counted as a field! More... | |
Class representing a database record.
tsa::record::record | ( | const record & | record | ) |
Copy Constructor.
record | The other record. |
tsa::record::record | ( | size_t | num_fields | ) |
Constructor. Sets record size to num_fields. Do not include the timestamp property in this number of fields as record timestamps are considered implicit to all records. is_init() will return false until a valid timestamp has been set via timstamp().
num_fields | Number of fields. |
void tsa::record::operator= | ( | fast::db_record * | record | ) |
Copies values from given (internal) record representation.
[in,out] | record | db_record pointer. |
const variant & tsa::record::operator[] | ( | size_t | position | ) | const |
Returns the value stored at given position. It is up to the user to ensure that position is does not cause a bounds error.
position | Zero-based position of the value. |
variant & tsa::record::operator[] | ( | size_t | position | ) |
Returns a non const reference to the variant at given position. This reference can be used to update the value.
position | Zero-based index of the value. |
void tsa::record::print | ( | std::ostream & | stream | ) |
Prints the record to given stream.
[in,out] | stream | The stream. |
size_t tsa::record::size | ( | void | ) | const |
Returns the size (number of fields) of the record. The timestamp property is not counted as a field!