fw4spl
src/fwData/StructureTraits.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include "fwData/registry/macros.hpp"
8 #include "fwData/Exception.hpp"
9 #include "fwData/StructureTraits.hpp"
10 
11 #include <fwCore/base.hpp>
12 
13 fwDataRegisterMacro( ::fwData::StructureTraits );
14 
15 namespace fwData
16 {
17 //------------------------------------------------------------------------------
18 
20  m_propertyCategory(""),
21  m_propertyType("")
22 {
23  m_color = ::fwData::Color::New();
24 }
25 
26 //------------------------------------------------------------------------------
27 
29 {
30 }
31 
32 //------------------------------------------------------------------------------
33 
34 void StructureTraits::cachedDeepCopy(const Object::csptr &source, DeepCopyCacheType &cache)
35 {
36  StructureTraits::csptr other = StructureTraits::dynamicConstCast(source);
37  FW_RAISE_EXCEPTION_IF( ::fwData::Exception(
38  "Unable to copy" + (source ? source->getClassname() : std::string("<NULL>"))
39  + " to " + this->getClassname()), !bool(other) );
40  this->fieldDeepCopy( source, cache );
41 
42  SLM_FATAL("Not implemented." );
43 }
44 
45 } // namespace fwData
46 
47 
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Implements data exception class.
FWDATA_API void cachedDeepCopy(const Object::csptr &_source, DeepCopyCacheType &cache) override
Defines deep copy.
virtual FWDATA_API ~StructureTraits()
Destructor. Does nothing.
#define SLM_FATAL(message)
Definition: spyLog.hpp:283
FWDATA_API void fieldDeepCopy(const ::fwData::Object::csptr &source)
A deep copy of fields (objects in m_children)
virtual const std::string & getClassname() const override
return full object&#39;s classname with its namespace, i.e. fwCore::BaseObject
Contains the representation of the data objects used in the framework.
This class defines structure traits.
FWDATA_API StructureTraits(::fwData::Object::Key key)
Constructor.