8 #include <fwCom/Signal.hpp> 9 #include <fwCom/Signal.hxx> 11 #include "fwData/Node.hpp" 12 #include "fwData/registry/macros.hpp" 13 #include "fwData/Exception.hpp" 14 #include "fwData/Port.hpp" 84 Port::sptr
Node::findPort(
const std::string &identifier,
bool modeInput)
const 90 if ( input->getIdentifier() == identifier)
100 if ( output->getIdentifier() == identifier)
113 Node::csptr other = Node::dynamicConstCast(_source);
115 "Unable to copy" + (_source ? _source->getClassname() : std::string(
"<NULL>"))
122 if( other->getObject())
124 ::fwTools::Object::sptr
object = ::fwData::factory::New( other->getObject()->getClassname() );
125 OSLM_ASSERT(
"The instantiation of '"<<other->getObject()->getClassname()<<
"' failed", object );
126 m_object = ::fwData::Object::dynamicCast(
object);
127 m_object->shallowCopy( other->m_object );
129 for(const ::fwData::Port::sptr& port : other->m_inputs)
133 for(const ::fwData::Port::sptr& port : other->m_outputs)
143 Node::csptr other = Node::dynamicConstCast(_source);
145 "Unable to copy" + (_source ? _source->getClassname() : std::string(
"<NULL>"))
154 for(const ::fwData::Port::sptr &port : other->m_inputs)
156 ::fwData::Port::sptr newPort;
160 for(const ::fwData::Port::sptr &port : other->m_outputs)
162 ::fwData::Port::sptr newPort;
virtual FWDATA_API ~Node()
Destructor.
virtual const std::string & getClassname() const override
return full object's classname with its namespace, i.e. fwCore::BaseObject
FWDATA_API void setObject(const ::fwData::Object::sptr &object)
Set object to the node.
#define OSLM_ASSERT(message, cond)
work like 'assert' from 'cassert', with in addition a message logged by spylog (with FATAL loglevel) ...
#define SLM_TRACE_FUNC()
Trace contextual function signature.
FWDATA_API void addOutputPort(const ::fwData::Port::sptr &port)
Add an output port.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
FWDATA_API::fwData::Object::sptr getObject() const
Get node object.
Implements data exception class.
This class defines a node. A node is represented by input and output ports.
FWDATA_API void shallowCopy(const Object::csptr &_source) override
Defines shallow copy.
std::vector< ::fwData::Port::sptr > PortContainer
Port container.
FWDATA_API PortContainer & getOutputPorts()
Get the container of output ports.
::fwData::Object::sptr m_object
node object
static FWDATA_APIconst::fwCom::Signals::SignalKeyType s_UPDATED_SIG
Updated signal key.
FWDATA_API void fieldDeepCopy(const ::fwData::Object::csptr &source)
A deep copy of fields (objects in m_children)
static FWDATA_API::fwData::Object::sptr copy(const ::fwData::Object::csptr &source)
return a copy of the source. if source is a null pointer, return a null pointer.
PortContainer m_outputs
Output port container.
FWDATA_API void cachedDeepCopy(const Object::csptr &_source, DeepCopyCacheType &cache) override
Defines deep copy.
FWDATA_API Port::sptr findPort(const std::string &_identifier, bool _modeInput) const
Get the port with given identifier.
FWDATA_API PortContainer & getInputPorts()
Get the container of input ports.
UpdatedSignalType::sptr m_sigUpdated
Updated signal.
Contains the representation of the data objects used in the framework.
FWDATA_API void fieldShallowCopy(const ::fwData::Object::csptr &source)
A shallow copy of fields (objects in m_children)
PortContainer m_inputs
Input port container.
FWDATA_API void addInputPort(const ::fwData::Port::sptr &port)
Add an input port.
FWDATA_API Node(::fwData::Object::Key key)
Constructor.