00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TORC_GENERIC_OM_CLONEABLE_HPP
00017 #define TORC_GENERIC_OM_CLONEABLE_HPP
00018
00019 #include "torc/generic/om/DumpRestoreConfig.hpp"
00020
00021
00022 #include <boost/shared_ptr.hpp>
00023
00024 #ifdef GENOM_SERIALIZATION
00025 #include <boost/serialization/access.hpp>
00026 #include <boost/serialization/weak_ptr.hpp>
00027 #endif //GENOM_SERIALIZATION
00028
00029
00030
00031
00032
00033
00034
00035 namespace torc {
00036
00037 namespace generic {
00038
00039
00040
00041
00042
00043
00044 template<class _CloneableType>
00045 class Cloneable
00046 {
00047 #ifdef GENOM_SERIALIZATION
00048 friend class boost::serialization::access;
00049 #endif
00050 protected:
00051
00052
00053
00054 Cloneable() throw();
00055
00056
00057 public:
00058 virtual
00059 ~Cloneable() throw();
00060
00061
00062 private:
00063 Cloneable(const Cloneable<_CloneableType> & source) throw();
00064
00065 Cloneable<_CloneableType> &
00066 operator=(const Cloneable<_CloneableType> & source) throw();
00067
00068
00069 public:
00070
00071
00072
00073
00074
00075 virtual boost::shared_ptr<_CloneableType>
00076 clone() throw() = 0;
00077
00078 #ifdef GENOM_SERIALIZATION
00079 template<class Archive> void
00080 serialize( Archive &ar, unsigned int );
00081 #endif //GENOM_SERIALIZATION
00082
00083 };
00084
00085
00086
00087 template<class _CloneableType>
00088 Cloneable<_CloneableType>::Cloneable() throw() {
00089 }
00090
00091 template<class _CloneableType>
00092 Cloneable<_CloneableType>::~Cloneable() throw() {
00093 }
00094
00095 #ifdef GENOM_SERIALIZATION
00096 template<class _CloneableType>
00097 template<class Archive> void
00098 Cloneable<_CloneableType>::serialize( Archive &ar, unsigned int ) {
00099 }
00100 #endif //GENOM_SERIALIZATION
00101
00102 }
00103
00104 }
00105
00106 #endif // TORC_GENERIC_OM_CLONEABLE_HPP