ROOT_Application
2.0
C++ Core modules and GUIStock
|
Generalisation of SimpleData, contains a vector of type_value_data values. More...
#include <DataStock.h>
Public Member Functions | |
MultiData () | |
Default constructor, set number of data to 1 and a default value of 0. More... | |
MultiData (unsigned int nbdata) | |
Set the size of the vector, fill with 0. More... | |
MultiData (time_t d, std::vector< type_value_data > ivalues) | |
Set date and copy the vector given as parameter. More... | |
MultiData (const MultiData &rhs) | |
Copy constructor. More... | |
MultiData (MultiData &&rhs) | |
Move copy constructor. More... | |
virtual | ~MultiData () |
Assignment operators | |
MultiData & | operator= (const MultiData &rhs) |
Normal assignment. More... | |
MultiData & | operator= (MultiData &&rhs) |
Move assignment. More... | |
Implementation of pure virtual functions for MultiData | |
void | SetData (const time_t d, const std::vector< type_value_data > &vec) |
Set a full Data : date + value(s) in a vector. More... | |
virtual std::vector < type_value_data > | GetValues () const |
Return the value(s) in a vector. More... | |
void | SetValues (std::vector< type_value_data > &vec) |
Set only values, do not modify the date. More... | |
virtual type_value_data | GetMaximum () const |
Get the maximum value. More... | |
virtual type_value_data | GetMinimum () const |
Get the minimum value. More... | |
virtual bool | HasChanged (const DataStock &data_to_check) const |
Check if data are different. More... | |
virtual void | ExtractCSVLine (std::vector< std::string > &linecsv) |
Extract date and data from a split string. More... | |
void | PrintData (const unsigned int verbose=0) const |
User friendly output on screen. More... | |
Public Member Functions inherited from DataStock | |
DataStock () | |
Default constructor set date to 0. More... | |
DataStock (time_t d) | |
Set the date, used in initialization of derived classes. More... | |
DataStock (const DataStock &rhs) | |
Copy constructor. More... | |
DataStock (DataStock &&rhs) | |
Move copy constructor. More... | |
virtual | ~DataStock () |
Destructor. More... | |
DataStock & | operator= (const DataStock &rhs) |
Normal assignment. More... | |
DataStock & | operator= (DataStock &&rhs) |
Move assignment. More... | |
time_t | GetDate () const |
Get the date data member. More... | |
void | SetDate (const time_t d) |
Modify the date. More... | |
std::string | GetDateString (const bool bhours=true) const |
Return the date in a string format: "YEAR-MOnth-DAy HH:MM:SS" (2014-11-10 13::25::00) More... | |
struct tm | GetDateTm () const |
Get a tm structure of the date. More... | |
Protected Member Functions | |
Specific to input/output of MultiData | |
virtual void | helper_operator_write (std::ostream &os) const |
virtual void | helper_operator_read (std::iostream &ios) |
Protected Member Functions inherited from DataStock | |
int | helper_operator_read_base (std::iostream &ios) |
Helper function for operator<< for reading date from input streams. More... | |
void | helper_operator_write_base (std::ostream &os) const |
Helper function for operator>> for writing date to output. More... | |
Private Attributes | |
const unsigned int | nb_data |
Number of data stored in the vector. More... | |
std::vector< type_value_data > | values |
Vector for storing values. More... | |
Friends | |
bool | operator== (const MultiData &lhs, const MultiData &rhs) |
Additional Inherited Members | |
Protected Attributes inherited from DataStock | |
time_t | date |
All data have a date associated. More... | |
Generalisation of SimpleData, contains a vector of type_value_data values.
Used for indicators with multiple data, e.g., MACD, BOLL...
Once the object is created the size of the vector is fixed
It cannot be extended during the life time of the object (use of const nb_data as data member).
Definition at line 432 of file DataStock.h.
MultiData::MultiData | ( | ) |
Default constructor, set number of data to 1 and a default value of 0.
Definition at line 398 of file DataStock.cpp.
References values.
MultiData::MultiData | ( | unsigned int | nbdata | ) |
Set the size of the vector, fill with 0.
Definition at line 412 of file DataStock.cpp.
MultiData::MultiData | ( | time_t | d, |
std::vector< type_value_data > | ivalues | ||
) |
Set date and copy the vector given as parameter.
Definition at line 423 of file DataStock.cpp.
MultiData::MultiData | ( | const MultiData & | rhs | ) |
MultiData::MultiData | ( | MultiData && | rhs | ) |
|
inlinevirtual |
Definition at line 453 of file DataStock.h.
|
virtual |
Extract date and data from a split string.
vec | vector of string containing the date and the value(s) |
Implements DataStock.
Definition at line 562 of file DataStock.cpp.
References nb_data, SetData(), and Utils::StringToTime_t().
|
virtual |
Get the maximum value.
Implements DataStock.
Definition at line 504 of file DataStock.cpp.
References values.
|
virtual |
Get the minimum value.
Implements DataStock.
Definition at line 516 of file DataStock.cpp.
References values.
|
virtual |
Return the value(s) in a vector.
Implements DataStock.
Definition at line 529 of file DataStock.cpp.
References values.
Referenced by HasChanged().
|
virtual |
Check if data are different.
To compare all fields use operator==
Exact implementation is different for each derived class:
Implements DataStock.
Definition at line 544 of file DataStock.cpp.
References DataStock::GetValues(), GetValues(), and nb_data.
Normal assignment.
Size of the vector should be equal, enforced by assert
Definition at line 461 of file DataStock.cpp.
References nb_data, DataStock::operator=(), and values.
Move assignment.
Definition at line 484 of file DataStock.cpp.
References DataStock::operator=(), and values.
|
virtual |
User friendly output on screen.
verbose level:
1 : add a header before the line
verbose | level of output |
Implements DataStock.
Definition at line 582 of file DataStock.cpp.
References FDS::WCOL.
|
inlinevirtual |
Set a full Data : date + value(s) in a vector.
Implements DataStock.
Definition at line 467 of file DataStock.h.
References DataStock::date, and values.
Referenced by ExtractCSVLine().
|
virtual |
Set only values, do not modify the date.
Implements DataStock.
Definition at line 534 of file DataStock.cpp.
References nb_data, and values.
Referenced by helper_operator_read().
Definition at line 916 of file DataStock.cpp.
|
private |
Number of data stored in the vector.
Because of const specifier cannot be changed during the life time of the object
Definition at line 437 of file DataStock.h.
Referenced by ExtractCSVLine(), HasChanged(), helper_operator_read(), helper_operator_write(), MultiData(), operator=(), and SetValues().
|
private |
Vector for storing values.
Definition at line 440 of file DataStock.h.
Referenced by GetMaximum(), GetMinimum(), GetValues(), helper_operator_write(), MultiData(), operator=(), operator==(), SetData(), and SetValues().