GDCM
2.2.3
|
00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 00005 Copyright (c) 2006-2011 Mathieu Malaterre 00006 All rights reserved. 00007 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 #ifndef GDCMSERVICECLASSUSER_H 00015 #define GDCMSERVICECLASSUSER_H 00016 00017 #include "gdcmSubject.h" 00018 00019 #include "gdcmPresentationContext.h" 00020 #include "gdcmFile.h" 00021 00022 #include "gdcmNetworkStateID.h" // EStateID 00023 00024 namespace gdcm 00025 { 00026 class ServiceClassUserInternals; 00027 class BaseRootQuery; 00028 namespace network{ 00029 class ULEvent; 00030 class ULConnection; 00031 class ULConnectionCallback; 00032 } 00036 class GDCM_EXPORT ServiceClassUser : public Subject 00037 { 00038 public: 00042 ServiceClassUser(); 00043 ~ServiceClassUser(); 00044 00046 void SetHostname( const char *hostname ); 00047 00049 void SetPort( uint16_t port ); 00050 00052 void SetPortSCP( uint16_t portscp ); 00053 00055 void SetAETitle(const char *aetitle); 00056 const char *GetAETitle() const; 00057 00059 void SetCalledAETitle(const char *aetitle); 00060 const char *GetCalledAETitle() const; 00061 00063 void SetTimeout(double t); 00064 double GetTimeout() const; 00065 00069 bool InitializeConnection(); 00070 00072 void SetPresentationContexts(std::vector<PresentationContext> const & pcs); 00073 00075 bool IsPresentationContextAccepted(const PresentationContext& pc) const; 00076 00078 bool StartAssociation(); 00079 00081 bool StopAssociation(); 00082 00084 bool SendEcho(); 00085 00087 bool SendStore(const char *filename); 00090 bool SendStore(File const &file); 00092 bool SendStore(DataSet const &ds); 00093 00095 bool SendFind(const BaseRootQuery* query, std::vector<DataSet> &retDatasets); 00096 00098 bool SendMove(const BaseRootQuery* query, const char *outputdir); 00100 bool SendMove(const BaseRootQuery* query, std::vector<DataSet> &retDatasets); 00102 bool SendMove(const BaseRootQuery* query, std::vector<File> &retFile); 00103 00104 private: 00105 network::EStateID RunEventLoop(network::ULEvent& inEvent, 00106 network::ULConnection* inWhichConnection, 00107 network::ULConnectionCallback* inCallback, const bool& startWaiting); 00108 network::EStateID RunMoveEventLoop(network::ULEvent& inEvent, 00109 network::ULConnectionCallback* inCallback); 00110 00111 private: 00112 ServiceClassUser(const ServiceClassUser&); 00113 void operator=(const ServiceClassUser &); 00114 00115 private: 00116 ServiceClassUserInternals *Internals; 00117 }; 00118 00119 } // end namespace gdcm 00120 00121 #endif // GDCMSERVICECLASSUSER_H