comparison OrthancServer/DicomProtocol/RemoteModalityParameters.h @ 806:557575fd93e9

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 07 May 2014 15:22:28 +0200
parents 31cc399c7762
children 566a2fb3c1fb
comparison
equal deleted inserted replaced
805:56a813a4714d 806:557575fd93e9
41 class RemoteModalityParameters 41 class RemoteModalityParameters
42 { 42 {
43 // TODO Use the flyweight pattern for this class 43 // TODO Use the flyweight pattern for this class
44 44
45 private: 45 private:
46 std::string symbolicName_; 46 std::string name_;
47 std::string aet_; 47 std::string aet_;
48 std::string host_; 48 std::string host_;
49 int port_; 49 int port_;
50 ModalityManufacturer manufacturer_; 50 ModalityManufacturer manufacturer_;
51 51
52 public: 52 public:
53 RemoteModalityParameters() : 53 RemoteModalityParameters();
54 symbolicName_(""), 54
55 aet_(""), 55 const std::string& GetName() const
56 host_(""),
57 port_(104),
58 manufacturer_(ModalityManufacturer_Generic)
59 { 56 {
57 return name_;
60 } 58 }
61 59
62 RemoteModalityParameters(const std::string& symbolic, 60 void SetName(const std::string& name)
63 const std::string& aet,
64 const std::string& host,
65 int port,
66 ModalityManufacturer manufacturer) :
67 symbolicName_(symbolic),
68 aet_(aet),
69 host_(host),
70 port_(port),
71 manufacturer_(manufacturer)
72 { 61 {
73 } 62 name_ = name;
74
75 RemoteModalityParameters(const std::string& aet,
76 const std::string& host,
77 int port,
78 ModalityManufacturer manufacturer) :
79 symbolicName_(""),
80 aet_(aet),
81 host_(host),
82 port_(port),
83 manufacturer_(manufacturer)
84 {
85 }
86
87 const std::string& GetSymbolicName() const
88 {
89 return symbolicName_;
90 } 63 }
91 64
92 const std::string& GetApplicationEntityTitle() const 65 const std::string& GetApplicationEntityTitle() const
93 { 66 {
94 return aet_; 67 return aet_;
95 } 68 }
96 69
70 void SetApplicationEntityTitle(const std::string& aet)
71 {
72 aet_ = aet;
73 }
74
97 const std::string& GetHost() const 75 const std::string& GetHost() const
98 { 76 {
99 return host_; 77 return host_;
100 } 78 }
101 79
80 void SetHost(const std::string& host)
81 {
82 host_ = host;
83 }
84
102 int GetPort() const 85 int GetPort() const
103 { 86 {
104 return port_; 87 return port_;
105 } 88 }
106 89
90 void SetPort(int port);
91
107 ModalityManufacturer GetManufacturer() const 92 ModalityManufacturer GetManufacturer() const
108 { 93 {
109 return manufacturer_; 94 return manufacturer_;
110 } 95 }
96
97 void SetManufacturer(ModalityManufacturer manufacturer)
98 {
99 manufacturer_ = manufacturer;
100 }
101
102 void SetManufacturer(const std::string& manufacturer)
103 {
104 manufacturer_ = StringToModalityManufacturer(manufacturer);
105 }
111 }; 106 };
112 } 107 }