|
|
virtual std::string | header (void) const =0 |
| |
|
void | read_binary (std::istream &str) |
| |
|
void | write_binary (std::ostream &str) const |
| |
|
| Data (std::vector< std::string > &) |
| |
|
virtual const std::string | get_file_name () const |
| |
|
virtual const std::string | get_table_name () const |
| |
|
virtual const bool | indexed () const |
| |
|
virtual const bool | get_binary () const |
| |
|
virtual const std::string | sql_header (void) const |
| | Return the names of the columns, along with variable type.
|
| |
|
virtual const std::string | sql_column_names (void) const |
| | Return the names of the columns.
|
| |
|
virtual const std::string | sql_values (void) const |
| | Return the values to be placed in columns.
|
| |
|
virtual void | sql_read (std::istream &) |
| | Reads the values...
|
| |
|
virtual size_t | size (void) const |
| | The size of the class in bytes.
|
| |
A class which can be written as flat text file or into an SQL database.
Data can be written in a plain text representation (the overloaded >> and <<), in a binary representation which requires accurate information from the size() function, or be given to an SQL database (the sql_ functions). Additionally, all Data must have a static Registration, which uses the static table_name to write the derived class into new_data_. The static member new_data_ is a map between strings and constructors for the derived classes, so that derived Data classes can be created from strings. Ultimately my goal is to require Data classes to define a transformations between each other, so that mapgd can convert between exteranal data schemes and internal schemes as easily as possible, and maybe even aid in determining when data in the SQL data base needs to be updated. Notes to self: I can implement his be defining a bijection between the sets {X, Y, ... } and {Z}, meaning that I can construct {X, Y, ... } whenever I know {Z} and visa versa. In order to know how to define a bijection we need to define injective and surjective function between Data. If {X, Y} are surjective on {Z} but not injective, then we can define a bijection by removing elements from {X} or {Y}. TODO: Find a way to establish which elements of {X} or {Y} are extraneous. Also, is this injective/surjective language actually helpful?