29 #ifndef DATATOOLS_I_CLONEABLE_H 30 #define DATATOOLS_I_CLONEABLE_H 93 template<
class Copyable>
94 static Copyable*
clone_it(
const Copyable& a_copyable)
96 return new Copyable(a_copyable);
99 template<
class Cand
idateType>
103 return tc !=
nullptr;
113 #define DATATOOLS_CLONEABLE_DECLARATION(Copyable) \ 115 virtual Copyable* clone(void) const; \ 118 #define DATATOOLS_CLONEABLE_INLINE(Copyable) \ 120 virtual Copyable* clone(void) const { \ 121 return datatools::i_cloneable::clone_it<Copyable>(*this); \ 125 #define DATATOOLS_CLONEABLE_IMPLEMENTATION(Copyable) \ 126 Copyable* Copyable::clone(void) const { \ 127 return datatools::i_cloneable::clone_it<Copyable>(*this); \ 131 #define DATATOOLS_CLONEABLE_TO_SERIALIZABLE_CASTER_DECLARATION(Cloneable) \ 132 DATATOOLS_CASTER_DECLARATION(datatools::i_cloneable,datatools::i_serializable, Cloneable,g_cloneable_to_serializable_caster,get_cloneable_to_serializable_caster) \ 135 #define DATATOOLS_CLONEABLE_TO_SERIALIZABLE_CASTER_IMPLEMENTATION(Cloneable) \ 136 DATATOOLS_CASTER_IMPLEMENTATION(datatools::i_cloneable,datatools::i_serializable, Cloneable,g_cloneable_to_serializable_caster,get_cloneable_to_serializable_caster) \ 139 #endif // DATATOOLS_I_CLONEABLE_H