35 #ifndef H_DC_DATA_TABLE_INCLUDED
36 #define H_DC_DATA_TABLE_INCLUDED
38 #include <Dynacoe/Component.h>
39 #include <unordered_map>
72 DataTable & Write(
const std::string & name,
int i);
73 DataTable & Write(
const std::string & name, uint32_t i);
74 DataTable & Write(
const std::string & name, uint64_t i);
75 DataTable & Write(
const std::string & name,
float i);
76 DataTable & Write(
const std::string & name,
double i);
77 DataTable & Write(
const std::string & name,
const std::string & i);
78 DataTable & Write(
const std::string & name,
const std::vector<uint8_t> & i);
89 DataTable & Read(
const std::string & name,
int & i);
90 DataTable & Read(
const std::string & name, uint32_t & i);
91 DataTable & Read(
const std::string & name, uint64_t & i);
92 DataTable & Read(
const std::string & name,
float & i);
93 DataTable & Read(
const std::string & name,
double & i);
94 DataTable & Read(
const std::string & name, std::string & i);
95 DataTable & Read(
const std::string & name, std::vector<uint8_t> & i);
101 void Remove(
const std::string &);
106 bool Query(
const std::string &)
const;
127 bool ReadState(
const std::vector<uint8_t> &);
143 DataEntry(uint64_t b, uint64_t c) :
150 std::unordered_map<std::string, uint64_t> nameTable;
151 std::vector<DataEntry> entryTable;
152 std::vector<uint8_t> data;
154 DataEntry & Find(
const std::string &, uint64_t);
155 uint64_t GetNewBlock(uint64_t);
std::vector< uint8_t > WriteState()
Writes a pure data-form of the table's contents. This can then be passed into ReadState() turn the ca...
void Clear()
Removes all stored associations and data entries, restoring the container back to a default state...
void Remove(const std::string &)
Removes any datum-name association.
bool ReadState(const std::vector< uint8_t > &)
Sets the DataTable state to reflect the state defined by the input buffer.
A container meant to share values across program invocations.
Definition: DataTable.h:61
bool Query(const std::string &) const
Returns whether there is a datum-name association with the given name.
Class that extends the functionality of an Entity, but as a removable and addable object...
Definition: Component.h:66