comparison OrthancCppClient/OrthancConnection.h @ 573:8fb9867d8089 laaw

documentation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 26 Sep 2013 17:52:11 +0200
parents eaca3d38b2aa
children 9d2592c08919
comparison
equal deleted inserted replaced
572:e5eaef9cad80 573:8fb9867d8089
36 36
37 #include "Patient.h" 37 #include "Patient.h"
38 38
39 namespace OrthancClient 39 namespace OrthancClient
40 { 40 {
41 /**
42 * {summary}{Connection to an instance of %Orthanc.}
43 * {description}{This class encapsulates a connection to an instance
44 * of %Orthanc through its REST API.}
45 **/
41 class LAAW_API OrthancConnection : 46 class LAAW_API OrthancConnection :
42 public boost::noncopyable, 47 public boost::noncopyable,
43 private Orthanc::ArrayFilledByThreads::IFiller 48 private Orthanc::ArrayFilledByThreads::IFiller
44 { 49 {
45 private: 50 private:
56 } 61 }
57 62
58 virtual Orthanc::IDynamicObject* GetFillerItem(size_t index); 63 virtual Orthanc::IDynamicObject* GetFillerItem(size_t index);
59 64
60 public: 65 public:
66 /**
67 * {summary}{Create a connection to an instance of %Orthanc.}
68 * {param}{orthancUrl URL to which the REST API of %Orthanc is listening.}
69 **/
61 OrthancConnection(const char* orthancUrl); 70 OrthancConnection(const char* orthancUrl);
62 71
72 /**
73 * {summary}{Create a connection to an instance of %Orthanc, with authentication.}
74 * {param}{orthancUrl URL to which the REST API of %Orthanc is listening.}
75 * {param}{username The username.}
76 * {param}{password The password.}
77 **/
63 OrthancConnection(const char* orthancUrl, 78 OrthancConnection(const char* orthancUrl,
64 const char* username, 79 const char* username,
65 const char* password); 80 const char* password);
66 81
67 virtual ~OrthancConnection() 82 virtual ~OrthancConnection()
68 { 83 {
69 } 84 }
70 85
86 /**
87 * {summary}{Returns the number of threads for this connection.}
88 * {description}{Returns the number of simultaneous connections
89 * that are used when downloading information from this instance
90 * of %Orthanc.}
91 * {returns}{The number of threads.}
92 **/
71 uint32_t GetThreadCount() const 93 uint32_t GetThreadCount() const
72 { 94 {
73 return patients_.GetThreadCount(); 95 return patients_.GetThreadCount();
74 } 96 }
75 97
98 /**
99 * {summary}{Sets the number of threads for this connection.}
100 * {description}{Sets the number of simultaneous connections
101 * that are used when downloading information from this instance
102 * of %Orthanc.}
103 * {param}{threadCount The number of threads.}
104 **/
76 void SetThreadCount(uint32_t threadCount) 105 void SetThreadCount(uint32_t threadCount)
77 { 106 {
78 patients_.SetThreadCount(threadCount); 107 patients_.SetThreadCount(threadCount);
79 } 108 }
80 109
110 /**
111 * {summary}{Refresh the list of the patients.}
112 * {description}{This method will reload the list of the patients from the remote instance of %Orthanc. Pay attention to the fact that the patients that have been previously returned by GetPatient() will be invalidated.}
113 **/
81 void Refresh() 114 void Refresh()
82 { 115 {
83 ReadPatients(); 116 ReadPatients();
84 patients_.Invalidate(); 117 patients_.Invalidate();
85 } 118 }
87 LAAW_API_INTERNAL const Orthanc::HttpClient& GetHttpClient() const 120 LAAW_API_INTERNAL const Orthanc::HttpClient& GetHttpClient() const
88 { 121 {
89 return client_; 122 return client_;
90 } 123 }
91 124
125 /**
126 * {summary}{Returns the URL of this instance of %Orthanc.}
127 * {description}{Returns the URL of the remote %Orthanc instance to which this object is connected.}
128 * {returns}{The URL.}
129 **/
92 const char* GetOrthancUrl() const 130 const char* GetOrthancUrl() const
93 { 131 {
94 return orthancUrl_.c_str(); 132 return orthancUrl_.c_str();
95 } 133 }
96 134
135 /**
136 * {summary}{Returns the number of patients.}
137 * {description}{Returns the number of patients that are stored in the remote instance of %Orthanc.}
138 * {returns}{The number of patients.}
139 **/
97 uint32_t GetPatientCount() 140 uint32_t GetPatientCount()
98 { 141 {
99 return patients_.GetSize(); 142 return patients_.GetSize();
100 } 143 }
101 144
145 /**
146 * {summary}{Get some patient.}
147 * {description}{This method will return an object that contains information about some patient. The patients are indexed by a number between 0 (inclusive) and the result of GetPatientCount() (exclusive).}
148 * {param}{index The index of the patient of interest.}
149 * {returns}{The patient.}
150 **/
102 Patient& GetPatient(uint32_t index); 151 Patient& GetPatient(uint32_t index);
103 152
153 /**
154 * {summary}{Delete some patient.}
155 * {description}{Delete some patient from the remote instance of %Orthanc. Pay attention to the fact that the patients that have been previously returned by GetPatient() will be invalidated.}
156 * {param}{index The index of the patient of interest.}
157 * {returns}{The patient.}
158 **/
104 void DeletePatient(uint32_t index) 159 void DeletePatient(uint32_t index)
105 { 160 {
106 GetPatient(index).Delete(); 161 GetPatient(index).Delete();
107 Refresh(); 162 Refresh();
108 } 163 }
109 164
165 /**
166 * {summary}{Send a DICOM file.}
167 * {description}{This method will store a DICOM file in the remote instance of %Orthanc. Pay attention to the fact that the patients that have been previously returned by GetPatient() will be invalidated.}
168 * {param}{filename Path to the DICOM file}
169 **/
110 void StoreFile(const char* filename); 170 void StoreFile(const char* filename);
111 171
172 /**
173 * {summary}{Send a DICOM file that is contained inside a memory buffer.}
174 * {description}{This method will store a DICOM file in the remote instance of %Orthanc. Pay attention to the fact that the patients that have been previously returned by GetPatient() will be invalidated.}
175 * {param}{dicom The memory buffer containing the DICOM file.}
176 * {param}{size The size of the DICOM file.}
177 **/
112 void Store(const void* dicom, uint64_t size); 178 void Store(const void* dicom, uint64_t size);
113 }; 179 };
114 } 180 }