7 #include "ctrlSelection/SAddField.hpp" 9 #include <fwDataTools/helper/Field.hpp> 11 #include <fwServices/macros.hpp> 13 #include <boost/foreach.hpp> 38 BOOST_FOREACH(const ::fwServices::IService::ConfigType::value_type& v, srvConfig.equal_range(
"inout"))
40 const ::fwServices::IService::ConfigType& inout = v.second;
41 const ::fwServices::IService::ConfigType& attrInOut = inout.get_child(
"<xmlattr>");
42 if(attrInOut.get(
"group",
"" ) ==
"source")
44 BOOST_FOREACH(const ::fwServices::IService::ConfigType::value_type& v, inout.equal_range(
"key"))
46 const ::fwServices::IService::ConfigType& specAssoc = v.second;
47 const ::fwServices::IService::ConfigType& attr = specAssoc.get_child(
"<xmlattr>");
48 const std::string field = attr.get(
"field",
"");
49 m_fields.push_back(field);
59 FW_DEPRECATED(
"::ctrlSelection::SAddField",
"::crrlSelection::SManage",
"18.0");
72 ::fwData::Object::sptr target = this->getInOut< ::fwData::Object>(
"target");
77 for(
const auto& elt : m_fields)
79 ::fwData::Object::sptr fieldObject = this->getInOut< ::fwData::Object>(
"source", i++);
80 SLM_ASSERT(
"'source' object for field '" + elt +
"'not found.", fieldObject);
virtual ~SAddField() noexcept
Destructor.
CTRLSELECTION_API void updating() override
Add the source object as fields of the target object.
Add one or several fields to an object.
CTRLSELECTION_API void starting() override
Do nothing.
This interface defines control service API. Does nothing particularly, can be considered as a default...
#define SLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
CTRLSELECTION_API void configuring() override
Configure the service.
CTRLSELECTION_API SAddField() noexcept
Constructor.
CTRLSELECTION_API void stopping() override
Do nothing.
The namespace ctrlSelection contains several interfaces for manager, updater and wrapper.
#define FW_DEPRECATED(oldFnName, newFnName, version)
Use this macro when deprecating a function to warn the developer.
FWSERVICES_API ConfigType getConfigTree() const
Return the configuration, in an boost property tree.