GDCM  2.2.0
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 #include "gdcmScanner.h" // FIXME
30 
31 class iosockinet;
32 class echo;
33 namespace gdcm{
34  namespace network{
35 
60 {
61  ULConnectionInfo mInfo;
62  //this is a dirty dirty hack
63  //but to establish an outgoing connection (scu), we need the echo service
64  //to establish incoming, we just need a port and localhost, so an iosockinet works while an
65  //echo would fail (probably because one already exists)
66  echo* mEcho;
67  iosockinet* mSocket;//of the three protocols offered by socket++-- echo, smtp, and ftp--
68  //echo most closely matches what the DICOM standard describes as a network connection
69  ARTIMTimer mTimer;
70 
71  ULConnection(ULConnection& inConnection); //no copy construction allowed
72 
73  EStateID mCurrentState;
74 
75  std::vector<PresentationContextRQ> mPresentationContexts;
76  //this is our list of presentation contexts of what we can send
77  uint32_t mMaxPDUSize;
78 
79  std::vector<PresentationContextAC> mAcceptedPresentationContexts;//these come back from the server
80  //and tell us what can be sent over this connection
81 
82  public:
83 
84  ULConnection(const ULConnectionInfo& inUserInformation);
85  //destructors are virtual to prevent memory leaks by inherited classes
86  virtual ~ULConnection();
87 
88  EStateID GetState() const;
89  void SetState(const EStateID& inState);//must be able to update state...
90 
91  //echo* GetProtocol();
92  std::iostream* GetProtocol();
93  void StopProtocol();
94 
96 
97  const ULConnectionInfo &GetConnectionInfo() const;
98 
99  //when the connection is first associated, the connection is told
100  //the max packet/PDU size and the way in which to present data
101  //(presentation contexts, etc). Store that here.
102  void SetMaxPDUSize(uint32_t inSize);
103  uint32_t GetMaxPDUSize() const;
104 
105  const PresentationContextAC *GetPresentationContextACByID(uint8_t id) const;
106  const PresentationContextRQ *GetPresentationContextRQByID(uint8_t id) const;
107 
110 
111  std::vector<PresentationContextRQ> const & GetPresentationContexts() const;
112  void SetPresentationContexts(const std::vector<PresentationContextRQ>& inContexts);
113 
114  void SetPresentationContexts(const std::vector<PresentationContext>& inContexts);
115 
116  //given a particular data element, presumably the SOP class,
117  //find the presentation context for that SOP
118  //NOT YET IMPLEMENTED
120 
121  std::vector<PresentationContextAC> const & GetAcceptedPresentationContexts() const;
122  std::vector<PresentationContextAC> & GetAcceptedPresentationContexts();
124 
126  bool InitializeConnection();
127 
130  };
131  }
132 }
133 
134 #endif // ULCONNECTION_H

Generated on Wed Jun 13 2012 20:40:37 for GDCM by doxygen 1.8.1
SourceForge.net Logo