GDCM: gdcmServiceClassUser.h Source File

GDCM 3.2.11

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
24namespace gdcm
25{
26class ServiceClassUserInternals;
27class BaseRootQuery;
28namespace network{
29class ULEvent;
30class ULConnection;
31class ULConnectionCallback;
32}
36 class GDCM_EXPORT ServiceClassUser : public Subject
37{
38public:
42 ServiceClassUser();
43 ~ServiceClassUser() override;
44 ServiceClassUser(const ServiceClassUser&) = delete;
45 void operator=(const ServiceClassUser &) = delete;
46
48 void SetHostname( const char *hostname );
49
51 void SetPort( uint16_t port );
52
54 void SetPortSCP( uint16_t portscp );
55
57 void SetAETitle(const char *aetitle);
58 const char *GetAETitle() const;
59
61 void SetCalledAETitle(const char *aetitle);
62 const char *GetCalledAETitle() const;
63
65 void SetTimeout(double t);
66 double GetTimeout() const;
67
71 bool InitializeConnection();
72
74 void SetPresentationContexts(std::vector<PresentationContext> const & pcs);
75
77 bool IsPresentationContextAccepted(const PresentationContext& pc) const;
78
80 bool StartAssociation();
81
83 bool StopAssociation();
84
86 bool SendEcho();
87
89 bool SendStore(const char *filename);
92 bool SendStore(File const &file);
94 bool SendStore(DataSet const &ds);
95
97 bool SendFind(const BaseRootQuery* query, std::vector<DataSet> &retDatasets);
98
100 bool SendMove(const BaseRootQuery* query, const char *outputdir);
102 bool SendMove(const BaseRootQuery* query, std::vector<DataSet> &retDatasets);
104 bool SendMove(const BaseRootQuery* query, std::vector<File> &retFile);
105
107 static SmartPointer<ServiceClassUser> New() { return new ServiceClassUser; }
108
109private:
110 network::EStateID RunEventLoop(network::ULEvent& inEvent,
111 network::ULConnection* inWhichConnection,
112 network::ULConnectionCallback* inCallback, const bool& startWaiting);
113 network::EStateID RunMoveEventLoop(network::ULEvent& inEvent,
114 network::ULConnectionCallback* inCallback);
115
116private:
117 ServiceClassUserInternals *Internals;
118};
119
120} // end namespace gdcm
121
122#endif // GDCMSERVICECLASSUSER_H
gdcm::BaseRootQuery
BaseRootQuery.
Definition gdcmBaseRootQuery.h:67
gdcm::DataSet
Class to represent a Data Set (which contains Data Elements).
Definition gdcmDataSet.h:56
gdcm::File
a DICOM File
Definition gdcmFile.h:34
gdcm::PresentationContext
PresentationContext.
Definition gdcmPresentationContext.h:30
gdcm::ServiceClassUser::SendMove
bool SendMove(const BaseRootQuery *query, const char *outputdir)
Execute a C-MOVE, based on query, return files are written in outputdir.
gdcm::ServiceClassUser::operator=
void operator=(const ServiceClassUser &)=delete
gdcm::ServiceClassUser::SendFind
bool SendFind(const BaseRootQuery *query, std::vector< DataSet > &retDatasets)
C-FIND a query, return result are in retDatasets.
gdcm::ServiceClassUser::IsPresentationContextAccepted
bool IsPresentationContextAccepted(const PresentationContext &pc) const
Return if the passed in presentation was accepted during association negotiation.
gdcm::ServiceClassUser::ServiceClassUser
ServiceClassUser(const ServiceClassUser &)=delete
gdcm::ServiceClassUser::SetTimeout
void SetTimeout(double t)
set/get Timeout
gdcm::ServiceClassUser::SendMove
bool SendMove(const BaseRootQuery *query, std::vector< File > &retFile)
Execute a C-MOVE, based on query, returned Files are stored in vector.
gdcm::ServiceClassUser::~ServiceClassUser
~ServiceClassUser() override
gdcm::ServiceClassUser::SetPresentationContexts
void SetPresentationContexts(std::vector< PresentationContext > const &pcs)
Set the Presentation Context used for the Association.
gdcm::ServiceClassUser::SendStore
bool SendStore(const char *filename)
Execute a C-STORE on file on disk, named filename.
gdcm::ServiceClassUser::New
static SmartPointer< ServiceClassUser > New()
for wrapped language: instantiate a reference counted object
Definition gdcmServiceClassUser.h:107
gdcm::ServiceClassUser::SendEcho
bool SendEcho()
C-ECHO.
gdcm::ServiceClassUser::StopAssociation
bool StopAssociation()
Stop the running association.
gdcm::ServiceClassUser::SetPortSCP
void SetPortSCP(uint16_t portscp)
Set the port for any incoming C-STORE-SCP operation (typically in a return of C-MOVE).
gdcm::ServiceClassUser::SetHostname
void SetHostname(const char *hostname)
Set the name of the called hostname (hostname or IP address).
gdcm::ServiceClassUser::SetAETitle
void SetAETitle(const char *aetitle)
set calling ae title
gdcm::ServiceClassUser::SetPort
void SetPort(uint16_t port)
Set port of remote host (called application).
gdcm::ServiceClassUser::GetTimeout
double GetTimeout() const
gdcm::ServiceClassUser::SendMove
bool SendMove(const BaseRootQuery *query, std::vector< DataSet > &retDatasets)
Execute a C-MOVE, based on query, returned dataset are Implicit.
gdcm::ServiceClassUser::GetCalledAETitle
const char * GetCalledAETitle() const
gdcm::ServiceClassUser::GetAETitle
const char * GetAETitle() const
gdcm::ServiceClassUser::StartAssociation
bool StartAssociation()
Start the association. Need to call SetPresentationContexts before.
gdcm::ServiceClassUser::SendStore
bool SendStore(DataSet const &ds)
Execute a C-STORE on a DataSet, the transfer syntax used will be Implicit.
gdcm::ServiceClassUser::ServiceClassUser
ServiceClassUser()
gdcm::ServiceClassUser::InitializeConnection
bool InitializeConnection()
gdcm::ServiceClassUser::SendStore
bool SendStore(File const &file)
gdcm::ServiceClassUser::SetCalledAETitle
void SetCalledAETitle(const char *aetitle)
set called ae title
gdcm::SmartPointer
Class for Smart Pointer.
Definition gdcmSmartPointer.h:40
gdcm::Subject::Subject
Subject()
gdcm::network::ULConnectionCallback
Definition gdcmULConnectionCallback.h:39
gdcm::network::ULConnection
ULConnection.
Definition gdcmULConnection.h:58
gdcm::network::ULEvent
ULEvent.
Definition gdcmULEvent.h:37
gdcmFile.h
gdcmNetworkStateID.h
gdcmPresentationContext.h
gdcmSubject.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm::network::EStateID
EStateID
Definition gdcmNetworkStateID.h:32
gdcm
Definition gdcmASN1.h:21