GDCM  2.2.3
gdcmAAssociateRQPDU.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 GDCMAASSOCIATERQPDU_H
15 #define GDCMAASSOCIATERQPDU_H
16 
17 #include "gdcmTypes.h"
18 #include "gdcmVR.h" // AEComp
19 #include "gdcmApplicationContext.h"
21 #include "gdcmUserInformation.h"
22 #include "gdcmBasePDU.h"
23 
24 namespace gdcm
25 {
26 
27 namespace network
28 {
29 
30 class AAssociateACPDU;
35 class AAssociateRQPDU : public BasePDU
36 {
37 public:
39  std::istream &Read(std::istream &is);
40  const std::ostream &Write(std::ostream &os) const;
41  size_t Size() const;
43 
45  void SetCalledAETitle(const char calledaetitle[16]);
46  std::string GetCalledAETitle() const { return std::string(CalledAETitle,16); }
47 
49  void SetCallingAETitle(const char callingaetitle[16]);
50  std::string GetCallingAETitle() const { return std::string(CallingAETitle,16); }
51 
53  static bool IsAETitleValid(const char title[16]);
54 
57  //void InitFromRQ( AAssociateACPDU & acpdu );
58 
59  void Print(std::ostream &os) const;
60 
62  {
63  assert( 0 );
64  }
65  //this function fails to compile on windows.
66 // AAssociateRQPDU &operator=(const AAssociateRQPDU &_val)
67 // {
68 // assert( 0 );
69 // }
70 
71  typedef std::vector<PresentationContextRQ>::size_type SizeType;
73  return PresContext.size();
74  }
76  assert( !PresContext.empty() && i < PresContext.size() );
77  return PresContext[i];
78  }
79  typedef std::vector<PresentationContextRQ> PresentationContextArrayType;
80  PresentationContextArrayType const &GetPresentationContexts() { return PresContext; }
81 
82  const PresentationContextRQ *GetPresentationContextByID(uint8_t i) const;
84  bool IsLastFragment() const { return true; }
85 
86 protected:
87  friend class AAssociateACPDU;
88  std::string GetReserved43_74() const;
89 
90 private:
91  // 1 PDU-type 01H
92  static const uint8_t ItemType; // PDUType ?
93  // 2 Reserved This reserved field shall be sent with a value 00H but not tested to this value when received.
94  static const uint8_t Reserved2;
95  /* 3-6 PDU-length This PDU-length shall be the number of bytes from the first byte of the
96  following field to the last byte of the variable field. It shall be encoded as
97  an unsigned binary number
98  */
99  uint32_t ItemLength; // PDU Length
100  /*
101  7-8 Protocol-version This two byte field shall use one bit to identify each version of the
102  DICOM UL protocol supported by the calling end-system. This is
103  Version 1 and shall be identified with bit 0 set. A receiver of this PDU
104  implementing only this version of the DICOM UL protocol shall only test
105  that bit 0 is set.
106  */
107  static const uint16_t ProtocolVersion;
108  /*
109  9-10 Reserved This reserved field shall be sent with a value 0000H but not tested to
110  this value when received.
111  */
112  static const uint16_t Reserved9_10;
113  /*
114  11-26 Called-AE-title Destination DICOM Application Name. It shall be encoded as 16
115  characters as defined by the ISO 646:1990-Basic G0 Set with leading
116  and trailing spaces (20H) being non-significant. The value made of 16
117  spaces (20H) meaning "no Application Name specified" shall not be
118  used. For a complete description of the use of this field, see Section
119  7.1.1.4.
120  */
121  char CalledAETitle[16];
122  /*
123  27-42 Calling-AE-title Source DICOM Application Name. It shall be encoded as 16
124  characters as defined by the ISO 646:1990-Basic G0 Set with leading
125  and trailing spaces (20H) being non-significant. The value made of 16
126  spaces (20H) meaning "no Application Name specified" shall not be
127  used. For a complete description of the use of this field, see Section
128  7.1.1.3.
129  */
130  char CallingAETitle[16];
131  /*
132  43-74 Reserved This reserved field shall be sent with a value 00H for all bytes but not
133  tested to this value when received
134  */
135  char Reserved43_74[32]; // { 0 }
136  /*
137  75-xxx Variable items This variable field shall contain the following items: one Application
138  Context Item, one or more Presentation Context Items and one User
139  Information Item. For a complete description of the use of these items
140  see Sections 7.1.1.2, 7.1.1.13, and 7.1.1.6.
141  */
142  ApplicationContext AppContext;
143  std::vector<PresentationContextRQ> PresContext;
144  UserInformation UserInfo;
145 };
146 
147 } // end namespace network
148 } // end namespace gdcm
149 
150 #endif //GDCMAASSOCIATERQPDU_H

Generated on Tue Jul 30 2013 22:32:00 for GDCM by doxygen 1.8.4
SourceForge.net Logo