fw4spl
PacsConfiguration.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
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 "fwPacsIO/data/PacsConfiguration.hpp"
8 
9 #include <fwData/Exception.hpp>
10 #include <fwData/registry/macros.hpp>
11 
12 fwDataRegisterMacro( ::fwPacsIO::data::PacsConfiguration );
13 
14 namespace fwPacsIO
15 {
16 namespace data
17 {
18 
20  m_localApplicationTitle(""),
21  m_pacsHostName(""),
22  m_pacsApplicationTitle(""),
23  m_pacsApplicationPort(0),
24  m_moveApplicationTitle(""),
25  m_moveApplicationPort(0),
26  m_retrieveMethod(MOVE_RETRIEVE_METHOD)
27 {
28 }
29 
30 //------------------------------------------------------------------------------
31 
33 {
34 }
35 
36 //------------------------------------------------------------------------------
37 
38 void PacsConfiguration::shallowCopy(const Object::csptr& _source )
39 {
40  PacsConfiguration::csptr other = PacsConfiguration::dynamicConstCast(_source);
41  FW_RAISE_EXCEPTION_IF( ::fwData::Exception(
42  "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>"))
43  + " to " + this->getClassname()), !bool(other) );
44  this->fieldShallowCopy( _source );
45 
46  m_localApplicationTitle = other->m_localApplicationTitle;
47  m_pacsHostName = other->m_pacsHostName;
48  m_pacsApplicationTitle = other->m_pacsApplicationTitle;
49  m_pacsApplicationPort = other->m_pacsApplicationPort;
50  m_moveApplicationTitle = other->m_moveApplicationTitle;
51  m_moveApplicationPort = other->m_moveApplicationPort;
52  m_retrieveMethod = other->m_retrieveMethod;
53 }
54 
55 //------------------------------------------------------------------------------
56 
57 void PacsConfiguration::cachedDeepCopy(const Object::csptr& _source, DeepCopyCacheType& cache)
58 {
59  PacsConfiguration::csptr other = PacsConfiguration::dynamicConstCast(_source);
60  FW_RAISE_EXCEPTION_IF( ::fwData::Exception(
61  "Unable to copy" + (_source ? _source->getClassname() : std::string("<NULL>"))
62  + " to " + this->getClassname()), !bool(other) );
63  this->fieldDeepCopy( _source, cache );
64 
65  m_localApplicationTitle = other->m_localApplicationTitle;
66  m_pacsHostName = other->m_pacsHostName;
67  m_pacsApplicationTitle = other->m_pacsApplicationTitle;
68  m_pacsApplicationPort = other->m_pacsApplicationPort;
69  m_moveApplicationTitle = other->m_moveApplicationTitle;
70  m_moveApplicationPort = other->m_moveApplicationPort;
71  m_retrieveMethod = other->m_retrieveMethod;
72 }
73 
74 //------------------------------------------------------------------------------
75 
76 } //namespace data
77 } //namespace fwPacsIO
unsigned short m_pacsApplicationPort
Pacs application port.
std::string m_pacsApplicationTitle
Pacs application title.
fwPacsIO contains classes used to communicate with a PACS.
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.
std::string m_pacsHostName
Pacs host name.
Implements data exception class.
FWPACSIO_API void shallowCopy(const Object::csptr &_source) override
Defines shallow copy.
RETRIEVE_METHOD m_retrieveMethod
Retrieve method.
This class defines a Pacs configuration.
std::string m_localApplicationTitle
Local application title.
FWPACSIO_API PacsConfiguration(::fwData::Object::Key key)
Constructor.
FWDATA_API void fieldDeepCopy(const ::fwData::Object::csptr &source)
A deep copy of fields (objects in m_children)
std::string m_moveApplicationTitle
Move application title.
unsigned short m_moveApplicationPort
Move application port.
virtual FWPACSIO_API ~PacsConfiguration()
Destructor.
FWDATA_API void fieldShallowCopy(const ::fwData::Object::csptr &source)
A shallow copy of fields (objects in m_children)
FWPACSIO_API void cachedDeepCopy(const Object::csptr &_source, DeepCopyCacheType &cache) override
Defines deep copy.