* Interface for save and load functionality */
| 17 | * Interface for save and load functionality |
| 18 | */ |
| 19 | class Saveable |
| 20 | { |
| 21 | public: |
| 22 | Saveable() {} |
| 23 | virtual ~Saveable() {} |
| 24 | |
| 25 | /** |
| 26 | * Serialize and save object to fileName |
| 27 | * Should throw exception if file could not be opened |
| 28 | */ |
| 29 | virtual void save(const std::string &fileName) const = 0; |
| 30 | |
| 31 | protected: |
| 32 | /** |
| 33 | * Deserialize and load object from fileName |
| 34 | * Should throw exception if file could not be opened |
| 35 | * or if the file format is wrong |
| 36 | */ |
| 37 | virtual void load(const std::string &fileName) = 0; |
| 38 | }; |
| 39 | |
| 40 | } // namespace SPLINTER |
| 41 |
nothing calls this directly
no outgoing calls
no test coverage detected