1 /*=========================================================================
4 Module: $RCSfile: marObject.h,v $
6 Date: $Date: 2008/11/06 10:00:59 $
7 Version: $Revision: 1.2 $
9 Copyright: (c) 2002, 2003
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.
16 =========================================================================*/
17 #ifndef __MAR__KERNEL__OBJECT__HXX__
18 #define __MAR__KERNEL__OBJECT__HXX__
22 #include "marParameters.h"
25 * \brief General maracas object.
27 class MAR_KERNEL_EXPORT marObject
31 /** Default constructor.
33 marObject( marParameters* p );
35 /** Default destructor.
37 virtual ~marObject( );
39 /** Parameters assignation methods.
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.
46 void setParameters( marParameters* p );
47 void copyParameters( marParameters* p );
48 void makeACopyParameters( )
50 copyParameters( _parameters );
53 /** Parameters analizers.
55 marParameters* getParameters( ) { return( _parameters ); };
56 bool parametersOwned( ) { return( _parametersCopied ); };
58 /** Virtual general methods
59 * (must be defined in each sub-class).
61 virtual void reset( ) = 0;
62 virtual void copyFrom( const marObject& from ) = 0;
64 /** Virtual persistence methods
65 * (must be defined in each sub-class).
67 virtual bool save( std::ofstream& os ) = 0;
68 virtual bool load( std::ifstream& is ) = 0;
70 /** Persistence methods
72 bool save( std::string& nw );
73 bool load( std::string& nr );
77 marParameters* _parameters;
78 bool _parametersCopied;
82 #endif // __MAR__KERNEL__OBJECT__HXX__