Stores data of many different kinds in string-based hash maps. The Data class provides public read-access to data, but gives no public method for changing data, which must be provided by derived classes. By using hash maps with strings as keys, any class with write access can add new data fields dynamically and instantly, with little overhead. Data provides data hashes for the following types: integer, integer arrays, two-dimensional integer arrays, integer hashes, floats, strings, string arrays, and date/times.
Data.h
Stores data of many different kinds in string-based hash maps. | |
Reads a keyed value from a hash map. | |
Provides specialized read-only access for integer hash data. | |
The Data destructor. | |
Gives direct access to data in a hash map. | |
Erases the given key from the hash map. | |
Copies data from a given Data class to this one. | |
Reads data from an input stream. | |
Writes data to an output stream. | |
The hash of integers. | |
The hash of arrays of integers. | |
The hash of two-dimensional arrays of integers. | |
The hash of hashes of integers. | |
The hash of floats. | |
The hash of wxStrings. | |
The hash of arrays of wxStrings. | |
The hash of date/times. |
|
Reads a keyed value from a hash map. If the key does not exist in the hash map, an error is raised in a popup window specifying the key and the type of data that was attempting to be read.
| key | The key to look up in the data hash. |
A const reference to the data corresponding to the key. It is read-only.
|
Provides specialized read-only access for integer hash data. Because a wxWidgets hash map does not have a const [] operator, it is unsafe to just look up specific integer hash data without a key, so this function is necessary.
| key | The key that finds an integer hash. |
| hashKey | The key to look up in the integer hash. |
The data corresponding to the key.
|
Gives direct access to data in a hash map. If the type of the data does not match one of the hash maps, the code will not compile.
| key | The key to access in the hash. |
| safety | A flag to ensure the key exists. If true, the key is first searched for before writing to it, and if the key does not exist, an error message is shown on the screen and the default constructed value for that data type. |
A reference to the data corresponding to the key. It is writable.
|
| virtual ~Data()=0 |
|
|
|
|
|
| IntHash mInts |
| IntArrayHash mIntArrays |
| IntArray2Hash mInt2Arrays |
| IntHashHash mIntHashes |
| FloatHash mFloats |
| StringHash mStrings |
| StringArrayHash mStringArrays |
| DateTimeHash mTimes |