GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

gdcmServiceClassUser.h
Go to the documentation of this file.
1 /*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13 =========================================================================*/
14 #ifndef GDCMSERVICECLASSUSER_H
15 #define GDCMSERVICECLASSUSER_H
16
17 #include "gdcmSubject.h"
18
19 #include "gdcmPresentationContext.h"
20 #include "gdcmFile.h"
21
22 #include "gdcmNetworkStateID.h" // EStateID
23
24 namespace gdcm
25 {
26 class ServiceClassUserInternals;
27 class BaseRootQuery;
28 namespace network{
29 class ULEvent;
30 class ULConnection;
31 class ULConnectionCallback;
32 }
36 class GDCM_EXPORT ServiceClassUser : public Subject
37 {
38 public:
42 ServiceClassUser();
43 ~ServiceClassUser();
44
46 void SetHostname( const char *hostname );
47
49 void SetPort( uint16_t port );
50
52 void SetPortSCP( uint16_t portscp );
53
55 void SetAETitle(const char *aetitle);
56 const char *GetAETitle() const;
57
59 void SetCalledAETitle(const char *aetitle);
60 const char *GetCalledAETitle() const;
61
63 void SetTimeout(time_t t);
64 time_t GetTimeout() const;
65
69 bool InitializeConnection();
70
72 void SetPresentationContexts(std::vector<PresentationContext> const & pcs);
73
75 bool IsPresentationContextAccepted(const PresentationContext& pc) const;
76
78 bool StartAssociation();
79
81 bool StopAssociation();
82
84 bool SendEcho();
85
87 bool SendStore(const char *filename);
90 bool SendStore(File const &file);
92 bool SendStore(DataSet const &ds);
93
95 bool SendFind(const BaseRootQuery* query, std::vector<DataSet> &retDatasets);
96
98 bool SendMove(const BaseRootQuery* query, const char *outputdir);
100 bool SendMove(const BaseRootQuery* query, std::vector<DataSet> &retDatasets);
102 bool SendMove(const BaseRootQuery* query, std::vector<File> &retFile);
103
104 private:
105 network::EStateID RunEventLoop(network::ULEvent& inEvent,
106 network::ULConnection* inWhichConnection,
107 network::ULConnectionCallback* inCallback, const bool& startWaiting);
108 network::EStateID RunMoveEventLoop(network::ULEvent& inEvent,
109 network::ULConnectionCallback* inCallback);
110
111 private:
112 ServiceClassUser(const ServiceClassUser&);
113 void operator=(const ServiceClassUser &);
114
115 private:
116 ServiceClassUserInternals *Internals;
117 };
118
119 } // end namespace gdcm
120
121 #endif // GDCMSERVICECLASSUSER_H