Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
storeable.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2011 LpzRobots development team *
3  * Georg Martius <georg dot martius at web dot de> *
4  * Frank Guettler <guettler at informatik dot uni-leipzig dot de *
5  * Frank Hesse <frank at nld dot ds dot mpg dot de> *
6  * Ralf Der <ralfder at mis dot mpg dot de> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
22  * *
23  ***************************************************************************/
24 #ifndef __STOREABLE_H
25 #define __STOREABLE_H
26 
27 #include<stdio.h>
28 
29 /**
30  * Interface for objects, that can be stored and restored to/from a file stream (binary).
31 */
32 
33 class Storeable {
34 public:
35  virtual ~Storeable(){}
36  /** stores the object to the given file stream (ASCII preferred).
37  */
38  virtual bool store(FILE* f) const = 0;
39 
40  /** loads the object from the given file stream (ASCII preferred).
41  */
42  virtual bool restore(FILE* f) = 0;
43 
44  /** Provided for convenience.
45  Stores the object into a new file with the given filename
46  */
47  bool storeToFile(const char* filename) const;
48 
49  /** Provided for convenience.
50  restores the object from the file given by filename
51  */
52  bool restoreFromFile(const char* filename);
53 
54 };
55 
56 #endif
bool storeToFile(const char *filename) const
Provided for convenience.
Definition: storeable.cpp:27
Interface for objects, that can be stored and restored to/from a file stream (binary).
Definition: storeable.h:33
bool restoreFromFile(const char *filename)
Provided for convenience.
Definition: storeable.cpp:35
virtual ~Storeable()
Definition: storeable.h:35
virtual bool store(FILE *f) const =0
stores the object to the given file stream (ASCII preferred).
virtual bool restore(FILE *f)=0
loads the object from the given file stream (ASCII preferred).