fw4spl
core/fwMedData/src/fwMedData/Study.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 
8 #include "fwMedData/Study.hpp"
9 
10 #include <fwData/Exception.hpp>
11 #include <fwData/registry/macros.hpp>
12 
13 fwDataRegisterMacro( ::fwMedData::Study );
14 
15 namespace fwMedData
16 {
17 
19 {
20 }
21 
22 //------------------------------------------------------------------------------
23 
25 {
26 }
27 
28 //------------------------------------------------------------------------------
29 
30 void Study::shallowCopy(const ::fwData::Object::csptr &_source)
31 {
32  Study::csptr other = Study::dynamicConstCast(_source);
33  FW_RAISE_EXCEPTION_IF( ::fwData::Exception(
34  "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>"))
35  + " to " + this->getClassname()), !bool(other) );
36 
37  this->fieldShallowCopy( other );
38  m_instanceUID = other->m_instanceUID;
39  m_date = other->m_date;
40  m_time = other->m_time;
41  m_referringPhysicianName = other->m_referringPhysicianName;
42  m_description = other->m_description;
43  m_patientAge = other->m_patientAge;
44 }
45 
46 //------------------------------------------------------------------------------
47 
48 void Study::cachedDeepCopy(const ::fwData::Object::csptr &_source, DeepCopyCacheType &cache)
49 {
50  Study::csptr other = Study::dynamicConstCast(_source);
51  FW_RAISE_EXCEPTION_IF( ::fwData::Exception(
52  "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>"))
53  + " to " + this->getClassname()), !bool(other) );
54 
55  this->fieldDeepCopy( other, cache );
56  m_instanceUID = other->m_instanceUID;
57  m_date = other->m_date;
58  m_time = other->m_time;
59  m_referringPhysicianName = other->m_referringPhysicianName;
60  m_description = other->m_description;
61  m_patientAge = other->m_patientAge;
62 }
63 
64 //------------------------------------------------------------------------------
65 
66 } // namespace fwMedData
67 
Namespace containing medical data.
Key class used to restrict access to Object construction. See http://www.drdobbs.com/184402053.
Implements data exception class.
DicomValueType m_instanceUID
Study unique identifier.
virtual FWMEDDATA_API ~Study()
Destructor.
DicomValueType m_referringPhysicianName
Referring physician name.
FWMEDDATA_API void shallowCopy(const ::fwData::Object::csptr &_source) override
Defines shallow copy.
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
DicomValueType m_description
Description.
DicomValueType m_patientAge
Patient age.
FWDATA_API void fieldShallowCopy(const ::fwData::Object::csptr &source)
A shallow copy of fields (objects in m_children)
FWMEDDATA_API Study(::fwData::Object::Key key)
Constructor.
FWMEDDATA_API void cachedDeepCopy(const ::fwData::Object::csptr &_source, DeepCopyCacheType &cache) override
Defines deep copy.