fw4spl
core/fwMedData/src/fwMedData/Equipment.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 "fwMedData/Equipment.hpp"
8 
9 #include <fwData/Exception.hpp>
10 #include <fwData/registry/macros.hpp>
11 
12 fwDataRegisterMacro( ::fwMedData::Equipment );
13 
14 namespace fwMedData
15 {
16 
18 {
19 }
20 
21 //------------------------------------------------------------------------------
22 
24 {
25 }
26 
27 //------------------------------------------------------------------------------
28 
29 void Equipment::shallowCopy(const ::fwData::Object::csptr &_source)
30 {
31  Equipment::csptr other = Equipment::dynamicConstCast(_source);
32  FW_RAISE_EXCEPTION_IF( ::fwData::Exception(
33  "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>"))
34  + " to " + this->getClassname()), !bool(other) );
35 
36  this->fieldShallowCopy( _source );
37  m_institutionName = other->m_institutionName;
38 }
39 
40 //------------------------------------------------------------------------------
41 
42 void Equipment::cachedDeepCopy(const ::fwData::Object::csptr &_source, DeepCopyCacheType &cache)
43 {
44  Equipment::csptr other = Equipment::dynamicConstCast(_source);
45  FW_RAISE_EXCEPTION_IF( ::fwData::Exception(
46  "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>"))
47  + " to " + this->getClassname()), !bool(other) );
48 
49  this->fieldDeepCopy( _source, cache );
50  m_institutionName = other->m_institutionName;
51 }
52 
53 //------------------------------------------------------------------------------
54 
55 } // namespace fwMedData
56 
FWMEDDATA_API void cachedDeepCopy(const ::fwData::Object::csptr &_source, DeepCopyCacheType &cache) override
Defines deep copy.
FWMEDDATA_API Equipment(::fwData::Object::Key key)
Constructor.
Namespace containing medical data.
virtual const std::string & getClassname() const override
return full object&#39;s classname with its namespace, i.e. fwCore::BaseObject
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Implements data exception class.
DicomValueType m_institutionName
Institution name.
FWDATA_API void fieldDeepCopy(const ::fwData::Object::csptr &source)
A deep copy of fields (objects in m_children)
FWMEDDATA_API void shallowCopy(const ::fwData::Object::csptr &_source) override
Defines shallow copy.
virtual FWMEDDATA_API ~Equipment()
Destructor.
FWDATA_API void fieldShallowCopy(const ::fwData::Object::csptr &source)
A shallow copy of fields (objects in m_children)