Homepage | Demos | Overview | Downloads | Tutorials | Reference | Credits |
#include <LoadSave.h>
Inheritance diagram for LoadSave:
Be mindful of version differences - better safe than sorry - put a version number as the first field, just in case
Definition at line 10 of file LoadSave.h.
Public Member Functions | |
Constructors/Destructors | |
LoadSave () | |
constructor | |
LoadSave (const char *filename) | |
constructor | |
virtual | ~LoadSave () |
destructor | |
Buffer Operations | |
These are useful for sending the data across a network as well as to a file. These are the only ones that MUST be overridden, as the file ops can be based on calling these, tho feel free to override the file ops as well if speed or temp. memory is tight. | |
virtual unsigned int | getBinSize () const=0 |
calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work. | |
virtual unsigned int | LoadBuffer (const char buf[], unsigned int len)=0 |
Load from a saved buffer. | |
virtual unsigned int | SaveBuffer (char buf[], unsigned int len) const=0 |
Save to a given buffer. | |
File Operations | |
These are called to load and save to files | |
virtual unsigned int | LoadFile (const char *filename) |
initiate opening of the specified file and loading/saving of all appropriate information. | |
virtual unsigned int | SaveFile (const char *filename) const |
initiate opening of the specified file and loading/saving of all appropriate information. | |
virtual unsigned int | LoadFile (FILE *f) |
Used recursively on member objects once a file is already open - DON'T CLOSE the file in your overridden functions. | |
virtual unsigned int | SaveFile (FILE *f) const |
Used recursively on member objects once a file is already open - DON'T CLOSE the file in your overridden functions. | |
Creator Utilities | |
These are for putting creator codes at the beginning of your data to check for sanity, just optional | |
virtual unsigned int | creatorSize (const char creator[]) const |
Returns size of the creator code. | |
virtual unsigned int | checkCreator (const char *creator, const char buf[], unsigned int len, bool isLoading=true) const |
Compares the creator code in the buffer to the one given. | |
virtual unsigned int | checkCreator (const char *creator, FILE *f, bool isLoading=true) const |
Compares the creator code in the file to the one given, will attempt to reset the file position if fails (so you can check for one of several types). | |
virtual unsigned int | saveCreator (const char *creator, char buf[], unsigned int len) const |
Saves a creator code to a buffer. | |
virtual unsigned int | saveCreator (const char *creator, FILE *f) const |
Saves a creator code directly to a file. | |
Static Public Member Functions | |
Encode/Decode Utils | |
encode/decode cross-platform compatable (byte order consistancy) | |
unsigned int | encode (const LoadSave &x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (LoadSave &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const LoadSave &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (LoadSave &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const double x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (double &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const double x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (double &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const float x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (float &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const float x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (float &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const long x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (long &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const long x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (long &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const unsigned long x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (unsigned long &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const unsigned long x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (unsigned long &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const int x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (int &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const int x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (int &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const unsigned int x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (unsigned int &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const unsigned int x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (unsigned int &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const short x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (short &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const short x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (short &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const unsigned short x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (unsigned short &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const unsigned short x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (unsigned short &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const std::string &x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (std::string &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const std::string &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (std::string &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const char *x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (char *&x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const char *x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (char *&x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const char x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (char &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const char x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (char &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const unsigned char x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (unsigned char &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const unsigned char x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (unsigned char &x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | encode (const bool x, char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | decode (bool &x, const char buf[], unsigned int cap) |
encode or decode with byte order consistancy | |
unsigned int | encode (const bool x, FILE *f) |
encode or decode with byte order consistancy | |
unsigned int | decode (bool &x, FILE *f) |
encode or decode with byte order consistancy | |
Static Public Attributes | |
const unsigned int | stringpad = sizeof(unsigned int)+1 |
This is the amount of extra space needed to store a string (int for len of string plus 1 for null term. | |
Static Protected Member Functions | |
template<class T> void | byteswap (T &dstc, const T &srcc) |
templated function to swap byte ordering, should allow compiler to unroll the loop
|
|
constructor
Definition at line 17 of file LoadSave.h. |
|
constructor
Definition at line 18 of file LoadSave.h. References LoadFile(). |
|
destructor
Definition at line 5 of file LoadSave.cc. |
|
templated function to swap byte ordering, should allow compiler to unroll the loop
Definition at line 217 of file LoadSave.h. |
|
Compares the creator code in the file to the one given, will attempt to reset the file position if fails (so you can check for one of several types).
Definition at line 20 of file LoadSave.cc. References decode(). |
|
Compares the creator code in the buffer to the one given.
Definition at line 7 of file LoadSave.cc. References decode(). |
|
Returns size of the creator code.
Definition at line 72 of file LoadSave.h. References stringpad. |
|
encode or decode with byte order consistancy
Definition at line 213 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 211 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 208 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 206 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 204 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 202 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 199 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 197 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 194 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 192 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 188 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 186 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 184 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 182 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 179 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 177 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 175 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 173 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 171 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 169 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 167 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 165 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 162 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 160 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 157 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 155 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 112 of file LoadSave.h. References LoadFile(). |
|
encode or decode with byte order consistancy
Definition at line 110 of file LoadSave.h. References LoadBuffer(). |
|
encode or decode with byte order consistancy
Definition at line 212 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 210 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 207 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 205 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 203 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 201 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 198 of file LoadSave.h. References encode(). |
|
encode or decode with byte order consistancy
Definition at line 196 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 193 of file LoadSave.h. References encode(). |
|
encode or decode with byte order consistancy
Definition at line 191 of file LoadSave.h. |
|
encode or decode with byte order consistancy
Definition at line 187 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 185 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 183 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 181 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 178 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 176 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 174 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 172 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 170 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 168 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 166 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 164 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 161 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 159 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 156 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 154 of file LoadSave.h. References byteswap(). |
|
encode or decode with byte order consistancy
Definition at line 111 of file LoadSave.h. References SaveFile(). |
|
encode or decode with byte order consistancy
Definition at line 109 of file LoadSave.h. References SaveBuffer(). |
|
calculates space needed to save - if you can't precisely add up the size, overestimate and things will still work.
Implemented in EventBase, LocomotionEvent, TextMsgEvent, VisionEvent, MotionSequence, and PostureEngine. |
|
Load from a saved buffer.
Implemented in EventBase, LocomotionEvent, TextMsgEvent, VisionEvent, MotionSequence, PostureEngine, and PostureMC. |
|
Used recursively on member objects once a file is already open - DON'T CLOSE the file in your overridden functions.
Definition at line 84 of file LoadSave.cc. References LoadBuffer(). |
|
initiate opening of the specified file and loading/saving of all appropriate information.
Definition at line 47 of file LoadSave.cc. |
|
Save to a given buffer.
Implemented in EventBase, LocomotionEvent, TextMsgEvent, VisionEvent, MotionSequence, and PostureEngine. |
|
Saves a creator code directly to a file.
Definition at line 43 of file LoadSave.cc. References encode(). |
|
Saves a creator code to a buffer.
Definition at line 39 of file LoadSave.cc. References encode(). |
|
Used recursively on member objects once a file is already open - DON'T CLOSE the file in your overridden functions.
Definition at line 114 of file LoadSave.cc. References getBinSize(), and SaveBuffer(). |
|
initiate opening of the specified file and loading/saving of all appropriate information.
Definition at line 65 of file LoadSave.cc. |
|
This is the amount of extra space needed to store a string (int for len of string plus 1 for null term.
Definition at line 13 of file LoadSave.h. |
Tekkotsu v1.4 |
Generated Sat Jul 19 00:09:02 2003 by Doxygen 1.3.2 |