Odil
A C++11 library for the DICOM standard
GetSCU.h
Go to the documentation of this file.
1/*************************************************************************
2 * odil - Copyright (C) Universite de Strasbourg
3 * Distributed under the terms of the CeCILL-B license, as published by
4 * the CEA-CNRS-INRIA. Refer to the LICENSE file or to
5 * http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
6 * for details.
7 ************************************************************************/
8
9#ifndef _f82a15e2_fd13_44b5_af7d_c6983494c9c6
10#define _f82a15e2_fd13_44b5_af7d_c6983494c9c6
11
12#include <functional>
13#include <vector>
14
15#include "odil/Association.h"
16#include "odil/DataSet.h"
17#include "odil/odil.h"
18#include "odil/SCU.h"
22
23namespace odil
24{
25
27class ODIL_API GetSCU: public SCU
28{
29public:
31 typedef std::function<void(std::shared_ptr<DataSet>)> StoreCallback;
32
38
40 typedef std::function<
41 void(std::shared_ptr<message::CGetResponse>)
43
45 GetSCU(Association & association);
46
48 void get(
49 std::shared_ptr<DataSet> query, StoreCallback store_callback,
50 GetCallback get_callback=GetCallback()) const;
51
55 std::vector<std::shared_ptr<DataSet>> get(
56 std::shared_ptr<DataSet> query) const;
57
58private:
59 void _get(
60 std::shared_ptr<message::CGetRequest const> request,
61 StoreCallback store_callback, GetCallback get_callback) const;
62 bool _handle_get_response(
63 std::shared_ptr<message::CGetResponse> response,
64 GetCallback callback) const;
65 void _handle_store_request(
66 std::shared_ptr<message::CStoreRequest> request,
67 StoreCallback callback) const;
68};
69
70}
71
72#endif // _f82a15e2_fd13_44b5_af7d_c6983494c9c6
Association.
Definition: Association.h:31
SCU for C-GET services.
Definition: GetSCU.h:28
void get(std::shared_ptr< DataSet > query, StoreCallback store_callback, GetCallback get_callback=GetCallback()) const
Perform the C-GET using callbacks.
std::vector< std::shared_ptr< DataSet > > get(std::shared_ptr< DataSet > query) const
Return a list of datasets matching the query.
StoreCallback Callback
Typedef to keep compatibility with previous versions.
Definition: GetSCU.h:37
std::function< void(std::shared_ptr< message::CGetResponse >) > GetCallback
Callback called when a C-GET response is received.
Definition: GetSCU.h:42
std::function< void(std::shared_ptr< DataSet >)> StoreCallback
Callback called when a C-STORE request is received.
Definition: GetSCU.h:31
GetSCU(Association &association)
Constructor.
Base class for all Service Class Users.
Definition: SCU.h:22
Definition: Association.h:25
#define ODIL_API
Definition: odil.h:28