|
ClockWork DB CoreAPI 1.0.48
Abstract Time Series and Storage/Management Library
|
#include <tom-tsdb/time_series.hpp>
Inheritance diagram for tom::tsdb::time_series:
Collaboration diagram for tom::tsdb::time_series:Public Types | |
| typedef std::map< tom::string, tom::string > | attribute_map_t |
| typedef std::set< tom::string > | attribute_set_t |
| typedef bool(tom::tsdb::datastore::* | populate_data_func) (tom::collections::time_series &ts, const tom::string &name, tom::tsdb::native_data_type data_t, tom::calendars::calendar &cal, tom::calendars::date_int_type from, tom::calendars::date_int_type to) |
Public Member Functions | |
| bool | alias_set_touched () const |
| virtual bool | exists () const |
| size_t | get_added_aliases (alias_set &added) const |
| virtual aggregation_type | get_aggregation_type () const =0 |
| virtual alias_set & | get_alias_set () |
| virtual const alias_set & | get_alias_set () const |
| const tom::String & | get_attribute (const char *att_name, bool check_datastore=true) const |
| const tom::String & | get_attribute (const tom::observation &att_name, bool check_datastore=true) const |
| const tom::String & | get_attribute (const tom::String &att_name, bool check_datastore=true) const |
| virtual const attribute_set_t & | get_changed_attribute_names () const |
| virtual const tom::calendars::date_time & | get_create_date_time () const =0 |
| virtual const values::data_type & | get_data_type () const =0 |
| virtual tom::tsdb::datastore & | get_datastore () const =0 |
| size_t | get_dropped_aliases (alias_set &dropped) const |
| virtual tom::calendars::date_int_type | get_first_dirty_date_int () const =0 |
| virtual tom::calendars::date_int_type | get_last_dirty_date_int () const =0 |
| virtual const tom::calendars::date_time & | get_modify_date_time () const =0 |
| virtual const tom::string & | get_name () const =0 |
| virtual const void * | get_raw_data () const =0 |
| virtual bool | is_sparse_series () const =0 |
| bool | operator!= (const time_series &rhs) const |
| bool | operator== (const time_series &rhs) const |
| virtual void | save (bool overwrite=false) |
| virtual void | set_aggregation_type (aggregation_type)=0 |
| void | set_attribute (const char *att_name, const char *att_value) |
| void | set_attribute (const tom::observation &att_name, const tom::observation &att_value) |
| void | set_attribute (const tom::String &att_name, const tom::String &att_value) |
Public Member Functions inherited from tom::collections::time_series | |
| virtual time_series_iterator & | begin () const =0 |
| virtual const void * | data () const |
| virtual time_series_iterator & | end () const =0 |
| virtual tom::calendars::calendar & | get_calendar () const =0 |
| date | get_first_date () const |
| virtual date_int_type | get_first_date_int () const |
| date | get_last_date () const |
| virtual date_int_type | get_last_date_int () const |
| virtual const observation & | get_observation (date d) const =0 |
| virtual const observation & | get_observation (date_int_type d) const =0 |
| virtual const observation & | operator[] (date d) const =0 |
| virtual observation & | operator[] (date d)=0 |
| virtual const observation & | operator[] (date_int_type d) const =0 |
| virtual observation & | operator[] (date_int_type d)=0 |
| virtual std::ostream & | print (std::ostream &) const =0 |
| void | set_observation (const Date &d, bool f) |
| virtual void | set_observation (const Date &d, const char *f) |
| virtual void | set_observation (const Date &d, const observation &val) |
| virtual void | set_observation (const Date &d, const std::string &f) |
| void | set_observation (const Date &d, double f) |
| void | set_observation (const Date &d, float f) |
| void | set_observation (const Date &d, int f) |
| void | set_observation (const Date &d, tom::value_type f) |
| void | set_observation (date d, bool f) |
| virtual void | set_observation (date d, const char *f) |
| virtual void | set_observation (date d, const Date &)=0 |
| virtual void | set_observation (date d, const observation &val)=0 |
| virtual void | set_observation (date d, const std::string &f) |
| void | set_observation (date d, double f) |
| void | set_observation (date d, float f) |
| void | set_observation (date d, int f) |
| void | set_observation (date d, tom::value_type f) |
| void | set_observation (date_int_type d, bool f) |
| virtual void | set_observation (date_int_type d, const char *f) |
| virtual void | set_observation (date_int_type d, const Date &)=0 |
| virtual void | set_observation (date_int_type d, const observation &val)=0 |
| virtual void | set_observation (date_int_type d, const std::string &f) |
| void | set_observation (date_int_type d, double f) |
| void | set_observation (date_int_type d, float f) |
| void | set_observation (date_int_type d, int f) |
| void | set_observation (date_int_type d, tom::value_type f) |
Protected Member Functions | |
| bool | populate_alias_set () const |
| virtual void | set_create_date_time (const tom::calendars::date_time &)=0 |
| virtual void | set_modify_date_time (const tom::calendars::date_time &)=0 |
Protected Member Functions inherited from tom::collections::time_series | |
| date_int_type | set_first_date_int (const date_int_type d) |
| date_int_type | set_last_date_int (const date_int_type d) |
Protected Attributes | |
| alias_set | m_alias_set |
| bool | m_alias_set_touched |
| attribute_map_t | m_attributes |
| attribute_set_t | m_changed_attributes |
| alias_set | m_original_alias_set |
Protected Attributes inherited from tom::collections::time_series | |
| date_int_type | m_end_date_int |
| date_int_type | m_start_date_int |
Friends | |
| class | ::tom::tsdb::datastore |
time_series derive from tom::collection::time_series adding the requirements needed for persistent management. These include a name, or identifier, alias_sets, data and aggregation information, user defined attributes, indication if the series is sparse, and several others.
Time_series are internally heavily templatized classes that have excellant runtime characteristics and typically amortized constant performance on basic operations like copying, and 0(N) on iterative operations like visiting all data observations.
Time_series are also garbage collected entities and may be passed through out a program without concern for memory management issues.
Finally, while there are concrete template classes, it is far easier to use the datastore::create_time_series(...) methods to create both time_series and sparse_series objects.
|
inlinevirtual |
Reimplemented from tom::collections::time_series.
| bool tom::tsdb::time_series::alias_set_touched | ( | ) | const |
|
virtual |
Does the time_series already exist in the datastore?
| size_t tom::tsdb::time_series::get_added_aliases | ( | alias_set & | added | ) | const |
Get a count of the number of aliases added, and the added aliases added to the passed alias_set. This method is mainly useful for persistence back-ends/
|
pure virtual |
get the aggregation_type for the time_series object
Implemented in tom::tsdb::collections::sparse_series< T, NATIVE_TYPE >, and tom::tsdb::collections::time_series< T, NATIVE_TYPE >.
|
virtual |
get the alias_set for the time_series. this may then be queried and/or updated and will be saved when the time_series object is itself changed.
|
virtual |
get the alias_set for the time_series. this may then be queried but not updated and no changes can be saved when the time_series object is itself changed.
|
inline |
get a user defined attribute for the time_series object. Users may associate any type of observation with time_series objects using a unique key for the object. For instance, users may want to store a description of a time_series, which may later be retrieved with this method, e.g., descr = time_series::get_attribute( "description" );
|
inline |
get a user defined attribute for the time_series object. Users may associate any type of observation with time_series objects using a unique key for the object. For instance, users may want to store a description of a time_series, which may later be retrieved with this method, e.g., descr = time_series::get_attribute( "description" );
| const tom::String & tom::tsdb::time_series::get_attribute | ( | const tom::String & | att_name, |
| bool | check_datastore = true |
||
| ) | const |
get a user defined attribute for the time_series object. Users may associate any type of observation with time_series objects using a unique key for the object. For instance, users may want to store a description of a time_series, which may later be retrieved with this method, e.g., descr = time_series::get_attribute( "description" );
|
pure virtual |
get the date_time of the time_series objects creation within the datastore.
Implemented in tom::tsdb::collections::sparse_series< T, NATIVE_TYPE >, and tom::tsdb::collections::time_series< T, NATIVE_TYPE >.
|
pure virtual |
get the data_type for the time_series object.
Implemented in tom::tsdb::collections::sparse_series< T, NATIVE_TYPE >, and tom::tsdb::collections::time_series< T, NATIVE_TYPE >.
|
pure virtual |
get the parent datastore for the time_series object.
Implemented in tom::tsdb::collections::sparse_series< T, NATIVE_TYPE >, and tom::tsdb::collections::time_series< T, NATIVE_TYPE >.
| size_t tom::tsdb::time_series::get_dropped_aliases | ( | alias_set & | dropped | ) | const |
Get a count of the number of aliases dropped, and the dropped aliases added to the passed alias_set. This method is mainly useful for persistence back-ends/
|
pure virtual |
get the date_int_type for the earliest changed observation. This is mainly useful for persistence back-ends, but may be useful for you too.
Implemented in tom::tsdb::collections::sparse_series< T, NATIVE_TYPE >, and tom::tsdb::collections::time_series< T, NATIVE_TYPE >.
|
pure virtual |
get the date_int_type for the latest changed observation. This is mainly useful for persistence back-ends, but may be useful for you too.
Implemented in tom::tsdb::collections::sparse_series< T, NATIVE_TYPE >, and tom::tsdb::collections::time_series< T, NATIVE_TYPE >.
|
pure virtual |
get the date_time of the time_series objects last modification within the datastore.
Implemented in tom::tsdb::collections::sparse_series< T, NATIVE_TYPE >, and tom::tsdb::collections::time_series< T, NATIVE_TYPE >.
|
pure virtual |
get the name or identifier for a time_series.
Implemented in tom::tsdb::collections::sparse_series< T, NATIVE_TYPE >, and tom::tsdb::collections::time_series< T, NATIVE_TYPE >.
|
pure virtual |
indicates if the time_series contains only sparse data, or data at near regular intervals
Implemented in tom::tsdb::collections::sparse_series< T, NATIVE_TYPE >, and tom::tsdb::collections::time_series< T, NATIVE_TYPE >.
| bool tom::tsdb::time_series::operator!= | ( | const time_series & | rhs | ) | const |
Check for time_series object inequality. This checks all facets of the time_series such as aliases, data, data type, etc.
| bool tom::tsdb::time_series::operator== | ( | const time_series & | rhs | ) | const |
Check for time_series object equality. This checks all facets of the time_series such as aliases, data, data type, etc.
|
virtual |
save the time_series object in the parent datastore. if overwrite is true, objects having the same name but different type, calendar, etc. will be overwritten by this time_series.
This method may throw a derivative of the std::runtime_error if persistence errors occur and hence should be wrapped in a try block for safety.
|
pure virtual |
set the aggregation type for the time_series object
Implemented in tom::tsdb::collections::sparse_series< T, NATIVE_TYPE >, and tom::tsdb::collections::time_series< T, NATIVE_TYPE >.
|
inline |
set a user defined attribute for the time_series object. Users may associate any type of observation with time_series objects using a unique key for the object. For instance, users may want to store a description of a time_series, which may later be retrieved with the get_attribute method, e.g., time_series::set_attribute( "description", "my favorite time-series" );
|
inline |
set a user defined attribute for the time_series object. Users may associate any type of observation with time_series objects using a unique key for the object. For instance, users may want to store a description of a time_series, which may later be retrieved with the get_attribute method, e.g., time_series::set_attribute( "description", "my favorite time-series" );
| void tom::tsdb::time_series::set_attribute | ( | const tom::String & | att_name, |
| const tom::String & | att_value | ||
| ) |
set a user defined attribute for the time_series object. Users may associate any type of observation with time_series objects using a unique key for the object. For instance, users may want to store a description of a time_series, which may later be retrieved with the get_attribute method, e.g., time_series::set_attribute( "description", "my favorite time-series" );