7 #ifndef __FWMEMORY_CAMP_MAPPER_HPP__ 8 #define __FWMEMORY_CAMP_MAPPER_HPP__ 10 #include <camp/valuemapper.hpp> 12 #include <fwTools/Type.hpp> 22 static const int type = camp::stringType;
23 static const std::string to(
const ReturnType& source)
28 static ReturnType from(
bool source)
30 CAMP_ERROR(camp::BadType(camp::boolType, camp::mapType<ReturnType>()));
32 static ReturnType from(
long source)
34 CAMP_ERROR(camp::BadType(camp::intType, camp::mapType<ReturnType>()));
36 static ReturnType from(
double source)
38 CAMP_ERROR(camp::BadType(camp::realType, camp::mapType<ReturnType>()));
40 static ReturnType from(
const std::string& source)
42 return ::fwTools::Type::create(source);
44 static ReturnType from(
const camp::EnumObject& source)
46 CAMP_ERROR(camp::BadType(camp::enumType, camp::mapType<ReturnType>()));
48 static ReturnType from(
const camp::UserObject& source)
50 CAMP_ERROR(camp::BadType(camp::userType, camp::mapType<ReturnType>()));
57 #endif //__FWMEMORY_CAMP_MAPPER_HPP__