9 #include <fwAtoms/Blob.hpp> 11 #include <fwMemory/BufferObject.hpp> 13 #include <camp/valuemapper.hpp> 20 struct ValueMapper< ::fwAtoms::Blob::sptr >
22 typedef ::fwAtoms::Blob::sptr ReturnType;
24 static const int type = camp::userType;
28 static const ::fwMemory::BufferObject::sptr to(
const ReturnType& source)
30 return source->getBufferObject();
35 static ReturnType from(
bool source)
37 CAMP_ERROR(camp::BadType(camp::boolType, camp::mapType<ReturnType>()));
42 static ReturnType from(
long source)
44 CAMP_ERROR(camp::BadType(camp::intType, camp::mapType<ReturnType>()));
49 static ReturnType from(
double source)
51 CAMP_ERROR(camp::BadType(camp::realType, camp::mapType<ReturnType>()));
56 static ReturnType from(
const std::string& source)
58 CAMP_ERROR(camp::BadType(camp::realType, camp::mapType<ReturnType>()));
63 static ReturnType from(
const camp::EnumObject& source)
65 CAMP_ERROR(camp::BadType(camp::enumType, camp::mapType<ReturnType>()));
70 static ReturnType from(
const camp::UserObject& source)
72 ::fwMemory::BufferObject::sptr tmp = source.get< ::fwMemory::BufferObject::sptr>()->getSptr();
73 return ::fwAtoms::Blob::New(tmp);