GDCM  2.2.6
gdcmULConnection.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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"
25 #include "gdcmDataElement.h"
28 
29 class iosockinet;
30 class echo;
31 namespace gdcm{
32  namespace network{
33 
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  public:
79 
80  ULConnection(const ULConnectionInfo& inUserInformation);
81  //destructors are virtual to prevent memory leaks by inherited classes
82  virtual ~ULConnection();
83 
84  EStateID GetState() const;
85  void SetState(const EStateID& inState);//must be able to update state...
86 
87  //echo* GetProtocol();
88  std::iostream* GetProtocol();
89  void StopProtocol();
90 
92 
93  const ULConnectionInfo &GetConnectionInfo() const;
94 
95  //when the connection is first associated, the connection is told
96  //the max packet/PDU size and the way in which to present data
97  //(presentation contexts, etc). Store that here.
98  void SetMaxPDUSize(uint32_t inSize);
99  uint32_t GetMaxPDUSize() const;
100 
101  const PresentationContextAC *GetPresentationContextACByID(uint8_t id) const;
102  const PresentationContextRQ *GetPresentationContextRQByID(uint8_t id) const;
103 
106 
107  std::vector<PresentationContextRQ> const & GetPresentationContexts() const;
108  void SetPresentationContexts(const std::vector<PresentationContextRQ>& inContexts);
109 
110  void SetPresentationContexts(const std::vector<PresentationContext>& inContexts);
111 
112  //given a particular data element, presumably the SOP class,
113  //find the presentation context for that SOP
114  //NOT YET IMPLEMENTED
116 
117  std::vector<PresentationContextAC> const & GetAcceptedPresentationContexts() const;
118  std::vector<PresentationContextAC> & GetAcceptedPresentationContexts();
120 
122  bool InitializeConnection();
123 
126 private:
127  ULConnection(const ULConnection&); // Not implemented.
128  void operator=(const ULConnection&); // Not implemented.
129 
130  };
131  }
132 }
133 
134 #endif // ULCONNECTION_H
ULConnection This is the class that contains the socket to another machine, and passes data through i...
Definition: gdcmULConnection.h:57
EStateID
Definition: gdcmNetworkStateID.h:32
void AddAcceptedPresentationContext(const PresentationContextAC &inPC)
ULConnection(const ULConnectionInfo &inUserInformation)
bool InitializeIncomingConnection()
used to establish scp connections
const PresentationContextRQ * GetPresentationContextRQByID(uint8_t id) const
void SetPresentationContexts(const std::vector< PresentationContextRQ > &inContexts)
PresentationContextRQ FindContext(const DataElement &de) const
Class to represent a Data Element either Implicit or Explicit.
Definition: gdcmDataElement.h:58
std::iostream * GetProtocol()
void SetMaxPDUSize(uint32_t inSize)
const PresentationContextAC * GetPresentationContextACByID(uint8_t id) const
ULConnectionInfo this class contains all the information about a particular connection as established...
Definition: gdcmULConnectionInfo.h:38
uint8_t GetPresentationContextIDFromPresentationContext(PresentationContextRQ const &pc) const
return 0 upon error
const ULConnectionInfo & GetConnectionInfo() const
ARTIMTimer This file contains the code for the ARTIM timer.
Definition: gdcmARTIMTimer.h:38
PresentationContextAC Table 9-18 PRESENTATION CONTEXT ITEM FIELDS.
Definition: gdcmPresentationContextAC.h:32
uint32_t GetMaxPDUSize() const
bool InitializeConnection()
used to establish scu connections
EStateID GetState() const
std::vector< PresentationContextAC > const & GetAcceptedPresentationContexts() const
std::vector< PresentationContextRQ > const & GetPresentationContexts() const
PresentationContextRQ Table 9-13 PRESENTATION CONTEXT ITEM FIELDS.
Definition: gdcmPresentationContextRQ.h:34
void SetState(const EStateID &inState)

Generated on Sat Dec 21 2013 05:56:18 for GDCM by doxygen 1.8.5
SourceForge.net Logo