7 #ifndef __FWDATATOOLS_HELPER_FIELD_HPP__ 8 #define __FWDATATOOLS_HELPER_FIELD_HPP__ 10 #include "fwDataTools/config.hpp" 12 #include <fwData/Object.hpp> 22 class FWDATATOOLS_CLASS_API
Field 28 FWDATATOOLS_API
Field( ::fwData::Object::sptr
object );
31 FWDATATOOLS_API ~Field();
40 template<
typename DATA_TYPE >
41 SPTR(DATA_TYPE) setDefaultField( const ::fwData::Object::FieldNameType& name,
SPTR(DATA_TYPE) defaultValue );
47 FWDATATOOLS_API
void setField( const ::fwData::Object::FieldNameType& name, ::fwData::Object::sptr obj );
52 FWDATATOOLS_API
void setFields( const ::fwData::Object::FieldMapType& newFields );
58 FWDATATOOLS_API
void removeField( const ::fwData::Object::FieldNameType& name );
68 FWDATATOOLS_API
void add( const ::fwData::Object::FieldNameType& _name, ::fwData::Object::sptr _obj );
79 FWDATATOOLS_API
void swap( const ::fwData::Object::FieldNameType& _name, ::fwData::Object::sptr _obj );
88 FWDATATOOLS_API
void addOrSwap( const ::fwData::Object::FieldNameType& _name, ::fwData::Object::sptr _obj );
98 FWDATATOOLS_API
void remove( const ::fwData::Object::FieldNameType& _name );
105 FWDATATOOLS_API
void clear();
108 FWDATATOOLS_API
void notify();
111 FWDATATOOLS_API
void buildMessage(
112 const ::fwData::Object::FieldMapType& oldFields,
113 const ::fwData::Object::FieldMapType& newFields
129 template<
typename DATA_TYPE>
130 inline SPTR(DATA_TYPE)
Field::setDefaultField(const
fwData::Object::FieldNameType& name,
SPTR(DATA_TYPE) defaultValue)
132 SLM_ASSERT(
"Field helper need a non-null object pointer", !m_object.expired());
133 ::fwData::Object::sptr
object = m_object.lock();
134 ::fwData::Object::sptr field =
object->getField(name);
137 m_addedFields[name] = defaultValue;
139 return object->setDefaultField(name, defaultValue);
145 #endif // __FWDATATOOLS_HELPER_FIELD_HPP__
std::map< std::string,::fwData::Object::sptr > FieldsContainerType
Type of signal m_sigModified.
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
Contains the representation of the data objects used in the framework.