00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "torc/generic/om/DumpRestoreConfig.hpp"
00017
00018 #ifndef HAVE_CONFIG_H
00019 #include "torc/generic/config.h"
00020 #endif
00021
00022 #ifdef GENOM_SERIALIZATION
00023 #include <boost/archive/binary_iarchive.hpp>
00024 #include <boost/archive/binary_oarchive.hpp>
00025 #include <boost/serialization/string.hpp>
00026 #endif //GENOM_SERIALIZATION
00027
00028 #include "torc/generic/om/Nameable.hpp"
00029
00030 namespace torc {
00031
00032 namespace generic {
00033
00034 Nameable::Nameable() {
00035 }
00036
00037 Nameable::~Nameable() throw() {
00038 }
00039
00040
00041
00042
00043
00044
00045
00046
00047 void
00048 Nameable::setName(const std::string & inSource) throw(Error) {
00049 if( inSource.empty() )
00050 {
00051 Error e( eMessageIdErrorEmptyItemName,
00052 __FUNCTION__, __FILE__, __LINE__ );
00053 e.saveContextData("Nameable", inSource);
00054 throw e;
00055 }
00056 mName = inSource;
00057 }
00058
00059 #ifdef GENOM_SERIALIZATION
00060 template<class Archive> void
00061 Nameable::serialize( Archive &ar, unsigned int ) {
00062 ar & mName;
00063 }
00064
00065
00066 template void
00067 Nameable::serialize<boost::archive::binary_iarchive>(
00068 boost::archive::binary_iarchive & ar, const unsigned int);
00069
00070 template void
00071 Nameable::serialize<boost::archive::binary_oarchive>(
00072 boost::archive::binary_oarchive & ar, const unsigned int);
00073
00074 #endif //GENOM_SERIALIZATION
00075 }
00076
00077 }