GDCM: gdcmULConnection.h Source File

GDCM 3.2.10

gdcmULConnection.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef GDCMULCONNECTION_H
19#define GDCMULCONNECTION_H
20
21#include "gdcmNetworkStateID.h"
22#include "gdcmARTIMTimer.h"
23#include "gdcmULConnectionInfo.h"
24#include "gdcmPresentationContextRQ.h"
25#include "gdcmDataElement.h"
26#include "gdcmPresentationContextAC.h"
27#include "gdcmPresentationContext.h"
28
29class iosockinet;
30class echo;
31namespace gdcm{
32 namespace network{
33
57 class GDCM_EXPORT ULConnection
58{
59 ULConnectionInfo mInfo;
60 //this is a dirty dirty hack
61 //but to establish an outgoing connection (scu), we need the echo service
62 //to establish incoming, we just need a port and localhost, so an iosockinet works while an
63 //echo would fail (probably because one already exists)
64 echo* mEcho;
65 iosockinet* mSocket;//of the three protocols offered by socket++-- echo, smtp, and ftp--
66 //echo most closely matches what the DICOM standard describes as a network connection
67 ARTIMTimer mTimer;
68
69 EStateID mCurrentState;
70
71 std::vector<PresentationContextRQ> mPresentationContexts;
72 //this is our list of presentation contexts of what we can send
73 uint32_t mMaxPDUSize;
74
75 std::vector<PresentationContextAC> mAcceptedPresentationContexts;//these come back from the server
76 //and tell us what can be sent over this connection
77
78 TransferSyntaxSub cstorets;
79
80 friend class ULActionAE6;
81 void SetCStoreTransferSyntax( TransferSyntaxSub const & ts );
82 friend class ULConnectionManager;
83 TransferSyntaxSub const & GetCStoreTransferSyntax( ) const;
84 public:
85
86 ULConnection(const ULConnectionInfo& inUserInformation);
87 //destructors are virtual to prevent memory leaks by inherited classes
88 virtual ~ULConnection();
89
90 EStateID GetState() const;
91 void SetState(const EStateID& inState);//must be able to update state...
92
93 //echo* GetProtocol();
94 std::iostream* GetProtocol();
95 void StopProtocol();
96
97 ARTIMTimer& GetTimer();
98
99 const ULConnectionInfo &GetConnectionInfo() const;
100
101 //when the connection is first associated, the connection is told
102 //the max packet/PDU size and the way in which to present data
103 //(presentation contexts, etc). Store that here.
104 void SetMaxPDUSize(uint32_t inSize);
105 uint32_t GetMaxPDUSize() const;
106
107 const PresentationContextAC *GetPresentationContextACByID(uint8_t id) const;
108 const PresentationContextRQ *GetPresentationContextRQByID(uint8_t id) const;
109
111 uint8_t GetPresentationContextIDFromPresentationContext(PresentationContextRQ const & pc) const;
112
113 std::vector<PresentationContextRQ> const & GetPresentationContexts() const;
114 void SetPresentationContexts(const std::vector<PresentationContextRQ>& inContexts);
115
116 void SetPresentationContexts(const std::vector<PresentationContext>& inContexts);
117
118 //given a particular data element, presumably the SOP class,
119 //find the presentation context for that SOP
120 //NOT YET IMPLEMENTED
121 PresentationContextRQ FindContext(const DataElement& de) const;
122
123 std::vector<PresentationContextAC> const & GetAcceptedPresentationContexts() const;
124 std::vector<PresentationContextAC> & GetAcceptedPresentationContexts();
125 void AddAcceptedPresentationContext(const PresentationContextAC& inPC);
126
128 bool InitializeConnection();
129
131 bool InitializeIncomingConnection();
132
133 ULConnection(const ULConnection&) = delete;
134 void operator=(const ULConnection&) = delete;
135 };
136 }
137}
138
139#endif // ULCONNECTION_H
gdcm::DataElement
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
gdcm::network::ARTIMTimer
ARTIMTimer.
Definition gdcmARTIMTimer.h:39
gdcm::network::PresentationContextAC
PresentationContextAC.
Definition gdcmPresentationContextAC.h:33
gdcm::network::PresentationContextRQ
PresentationContextRQ.
Definition gdcmPresentationContextRQ.h:35
gdcm::network::TransferSyntaxSub
TransferSyntaxSub.
Definition gdcmTransferSyntaxSub.h:38
gdcm::network::ULConnectionInfo
ULConnectionInfo.
Definition gdcmULConnectionInfo.h:38
gdcm::network::ULConnection::ULActionAE6
friend class ULActionAE6
Definition gdcmULConnection.h:80
gdcm::network::ULConnection::FindContext
PresentationContextRQ FindContext(const DataElement &de) const
gdcm::network::ULConnection::GetState
EStateID GetState() const
gdcm::network::ULConnection::GetAcceptedPresentationContexts
std::vector< PresentationContextAC > & GetAcceptedPresentationContexts()
gdcm::network::ULConnection::SetPresentationContexts
void SetPresentationContexts(const std::vector< PresentationContextRQ > &inContexts)
gdcm::network::ULConnection::GetTimer
ARTIMTimer & GetTimer()
gdcm::network::ULConnection::InitializeIncomingConnection
bool InitializeIncomingConnection()
used to establish scp connections
gdcm::network::ULConnection::GetAcceptedPresentationContexts
std::vector< PresentationContextAC > const & GetAcceptedPresentationContexts() const
gdcm::network::ULConnection::GetMaxPDUSize
uint32_t GetMaxPDUSize() const
gdcm::network::ULConnection::GetPresentationContextRQByID
const PresentationContextRQ * GetPresentationContextRQByID(uint8_t id) const
gdcm::network::ULConnection::GetPresentationContexts
std::vector< PresentationContextRQ > const & GetPresentationContexts() const
gdcm::network::ULConnection::AddAcceptedPresentationContext
void AddAcceptedPresentationContext(const PresentationContextAC &inPC)
gdcm::network::ULConnection::ULConnection
ULConnection(const ULConnectionInfo &inUserInformation)
gdcm::network::ULConnection::GetProtocol
std::iostream * GetProtocol()
gdcm::network::ULConnection::SetState
void SetState(const EStateID &inState)
gdcm::network::ULConnection::SetMaxPDUSize
void SetMaxPDUSize(uint32_t inSize)
gdcm::network::ULConnection::ULConnection
ULConnection(const ULConnection &)=delete
gdcm::network::ULConnection::GetPresentationContextACByID
const PresentationContextAC * GetPresentationContextACByID(uint8_t id) const
gdcm::network::ULConnection::~ULConnection
virtual ~ULConnection()
gdcm::network::ULConnection::SetPresentationContexts
void SetPresentationContexts(const std::vector< PresentationContext > &inContexts)
gdcm::network::ULConnection::StopProtocol
void StopProtocol()
gdcm::network::ULConnection::GetConnectionInfo
const ULConnectionInfo & GetConnectionInfo() const
gdcm::network::ULConnection::ULConnectionManager
friend class ULConnectionManager
Definition gdcmULConnection.h:82
gdcm::network::ULConnection::operator=
void operator=(const ULConnection &)=delete
gdcm::network::ULConnection::GetPresentationContextIDFromPresentationContext
uint8_t GetPresentationContextIDFromPresentationContext(PresentationContextRQ const &pc) const
return 0 upon error
gdcm::network::ULConnection::InitializeConnection
bool InitializeConnection()
used to establish scu connections
gdcmARTIMTimer.h
gdcmDataElement.h
gdcmNetworkStateID.h
gdcmPresentationContextAC.h
gdcmPresentationContextRQ.h
gdcmPresentationContext.h
gdcmULConnectionInfo.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