| 24 | |
| 25 | namespace Suscan { |
| 26 | class Serializable { |
| 27 | Object storage; |
| 28 | |
| 29 | public: |
| 30 | void |
| 31 | putStorage(Object &&obj) |
| 32 | { |
| 33 | this->storage = std::move(obj); |
| 34 | } |
| 35 | |
| 36 | Object && |
| 37 | takeStorage(void) |
| 38 | { |
| 39 | return std::move(this->storage); |
| 40 | } |
| 41 | |
| 42 | Object && |
| 43 | persist(Object &obj) |
| 44 | { |
| 45 | this->putStorage(std::move(obj)); |
| 46 | return this->takeStorage(); |
| 47 | } |
| 48 | |
| 49 | virtual void deserialize(Object const &conf) = 0; |
| 50 | virtual Object &&serialize(void) = 0; |
| 51 | virtual ~Serializable(); |
| 52 | }; |
| 53 | } |
| 54 | |
| 55 | #endif // SERIALIZABLE_H |
nothing calls this directly
no test coverage detected