fw4spl
fwAtomConversion Namespace Reference

This namespace contains the necessary class for fwData <-> fwAtoms conversion. More...

Namespaces

 exception
 This namespace contains the exception raised by fwData <-> fwAtoms conversion.
 
 mapper
 This namespace contains the specific mappers used to convert few data.
 

Classes

class  AtomToDataMappingVisitor
 This visitor visits data object to fill it with associated atom object attributes. This class is used by AtomVisitor to convert an fwData::Object. More...
 
class  AtomVisitor
 This class is used to convert a fwAtoms to a fwData. More...
 
struct  DataConversionValueVisitor
 
class  DataVisitor
 Visitor used to convert a fwData to a fwAtoms. fwData camp property names are used like key to store attributes in fwAtoms::Object. More...
 
class  NumericArrayPropertyVisitor
 
class  NumericMapPropertyVisitor
 
class  NumericSimplePropertyVisitor
 

Functions

FWATOMCONVERSION_API std::shared_ptr< ::fwAtoms::Objectconvert (const std::shared_ptr< ::fwData::Object > &data)
 Helper to convert a fwData::Object to a fwAtoms::Object. More...
 
FWATOMCONVERSION_API std::shared_ptr< ::fwAtoms::Objectconvert (const std::shared_ptr< ::fwData::Object > &dataObj, DataVisitor::AtomCacheType &cache)
 Converts a fwData::Object to a fwAtoms::Object. More...
 
FWATOMCONVERSION_API std::shared_ptr< ::fwData::Objectconvert (const std::shared_ptr< ::fwAtoms::Object > &atom, const AtomVisitor::IReadPolicy &uuidPolicy=AtomVisitor::ChangePolicy())
 Helper to convert a fwAtoms::Object to a fwData::Object. More...
 
FWATOMCONVERSION_API std::shared_ptr< ::fwData::Objectconvert (const std::shared_ptr< ::fwAtoms::Object > &atomObj, AtomVisitor::DataCacheType &cache, const AtomVisitor::IReadPolicy &uuidPolicy)
 Converts a fwAtoms::Object to a fwData::Object. More...
 
::fwAtoms::Object::sptr convert (const ::fwData::Object::sptr &data)
 
::fwAtoms::Object::sptr convert (const ::fwData::Object::sptr &dataObj, DataVisitor::AtomCacheType &cache)
 
::fwData::Object::sptr convert (const ::fwAtoms::Object::sptr &atom, const AtomVisitor::IReadPolicy &uuidPolicy)
 
::fwData::Object::sptr convert (const ::fwAtoms::Object::sptr &atomObj, AtomVisitor::DataCacheType &cache, const AtomVisitor::IReadPolicy &uuidPolicy)
 

Detailed Description

This namespace contains the necessary class for fwData <-> fwAtoms conversion.

Date
2012- 2013

Function Documentation

FWATOMCONVERSION_API std::shared_ptr< ::fwAtoms::Object > fwAtomConversion::convert ( const std::shared_ptr< ::fwData::Object > &  data)

Helper to convert a fwData::Object to a fwAtoms::Object.

Parameters
datadata object to convert
Returns
Converted fwAtoms::Object
Exceptions
::camp::ClassNotFoundif data class is not found in camp world during visit
fwAtomConversion::exception::ConversionNotManagedif data has attribute type not managed by algorithm
Note
All data must be camped or mapped by a specific fwAtomConversion::mapper::Base
fwData camp property names are used like key to store attributes in fwAtoms::Object
sub objects multi-referenced in the fwData structure are represented by the same fwAtoms::Object ( also multi-referenced in fwAtoms structure )
null ::fwData::Object::sptr are kept and are converted in null ::fwAtoms::Base::sptr
Only std::vector of type fwData::Object::sptr, enum, bool, string, int or real are managed
Only std::map with key value : string, int or real are managed
Only std::map with type value : fwData::Object::sptr, bool, enum, string, int or real are managed
FWATOMCONVERSION_API std::shared_ptr< ::fwAtoms::Object > fwAtomConversion::convert ( const std::shared_ptr< ::fwData::Object > &  dataObj,
DataVisitor::AtomCacheType &  cache 
)

Converts a fwData::Object to a fwAtoms::Object.

Parameters
dataObjdata to convert
cachecache to register already converted data, used when a data is referenced multiple times.
Returns
Returns the converted atom.
Exceptions
::camp::ClassNotFoundif data class is not found in camp world during visit
FWATOMCONVERSION_API std::shared_ptr< ::fwData::Object > fwAtomConversion::convert ( const std::shared_ptr< ::fwAtoms::Object > &  atom,
const AtomVisitor::IReadPolicy uuidPolicy = AtomVisitor::ChangePolicy() 
)

Helper to convert a fwAtoms::Object to a fwData::Object.

Parameters
atomatom to convert
uuidPolicyAtomVisitor policy
Returns
Converted fwData::Object
Exceptions
::camp::ClassNotFoundif data class is not found in camp world during visit
fwAtomConversion::exception::DataFactoryNotFoundif the data class is not found in fwData::factory
fwAtomConversion::exception::DuplicatedDataUUIDif the data uuid already exists in the system.
fwAtomConversion::exception::ConversionNotManagedif atom is not data compliant
Note
see notes of convert(::fwData::Object::sptr data) method
FWATOMCONVERSION_API std::shared_ptr< ::fwData::Object > fwAtomConversion::convert ( const std::shared_ptr< ::fwAtoms::Object > &  atomObj,
AtomVisitor::DataCacheType &  cache,
const AtomVisitor::IReadPolicy uuidPolicy 
)

Converts a fwAtoms::Object to a fwData::Object.

Parameters
atomObjatom to convert
cachecache to register the atoms already converted, used when an atom is referenced multiple times
uuidPolicyAtomVisitor policy
Returns
Converted fwData::Object.
Exceptions
fwAtomConversion::exception::DataFactoryNotFoundif the data class is not found in fwData::factory
fwAtomConversion::exception::DuplicatedDataUUIDif the data uuid already exists in the system.