]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/kernel/marObject.h
2d3217c447f39b71bc95d2cd313d12b566a0a80b
[creaMaracasVisu.git] / lib / maracasVisuLib / src / kernel / marObject.h
1 /*=========================================================================
2
3   Program:   wxMaracas
4   Module:    $RCSfile: marObject.h,v $
5   Language:  C++
6   Date:      $Date: 2008/11/06 10:00:59 $
7   Version:   $Revision: 1.2 $
8
9   Copyright: (c) 2002, 2003
10   License:
11   
12      This software is distributed WITHOUT ANY WARRANTY; without even 
13      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14      PURPOSE.  See the above copyright notice for more information.
15
16 =========================================================================*/
17 #ifndef __MAR__KERNEL__OBJECT__HXX__
18 #define __MAR__KERNEL__OBJECT__HXX__
19
20 #include <string>
21 #include "marTypes.h"
22 #include "marParameters.h"
23
24 /** /def marObject
25  *  \brief General maracas object.
26  */
27 class MAR_KERNEL_EXPORT marObject
28 {
29     public:
30
31     /** Default constructor.
32      */
33     marObject( marParameters* p );
34
35     /** Default destructor.
36      */
37     virtual ~marObject( );
38
39     /** Parameters assignation methods.
40      *
41      *  You can assign a marParameters object by reference (setParameters)
42      *  or by value (copyParameters).
43      *  Besides, if you want to make your actual reference to be by value,
44      *  call makeACopyParameters.
45      */
46     void setParameters( marParameters* p );
47     void copyParameters( marParameters* p );
48     void makeACopyParameters( )
49     {
50             copyParameters( _parameters );
51     }
52
53     /** Parameters analizers.
54      */
55     marParameters* getParameters( ) { return( _parameters ); };
56     bool parametersOwned( ) { return( _parametersCopied ); };
57
58     /** Virtual general methods
59      *  (must be defined in each sub-class).
60      */
61     virtual void reset( ) = 0;
62     virtual void copyFrom( const marObject& from ) = 0;
63
64     /** Virtual persistence methods
65      *  (must be defined in each sub-class).
66      */
67     virtual bool save( std::ofstream& os ) = 0;
68     virtual bool load( std::ifstream& is ) = 0;
69
70     /** Persistence methods
71      */
72     bool save( std::string& nw );
73     bool load( std::string& nr );
74
75     private:
76
77     marParameters* _parameters;
78     bool _parametersCopied;
79
80 };
81
82 #endif // __MAR__KERNEL__OBJECT__HXX__
83
84 // eof - marObject.h