GDCM  2.2.6
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  const UserInformation & GetUserInformation() const { return UserInfo; }
87  void SetUserInformation( UserInformation const & ui );
88 
89 protected:
90  friend class AAssociateACPDU;
91  std::string GetReserved43_74() const;
92 
93 private:
94  // 1 PDU-type 01H
95  static const uint8_t ItemType; // PDUType ?
96  // 2 Reserved This reserved field shall be sent with a value 00H but not tested to this value when received.
97  static const uint8_t Reserved2;
98  /* 3-6 PDU-length This PDU-length shall be the number of bytes from the first byte of the
99  following field to the last byte of the variable field. It shall be encoded as
100  an unsigned binary number
101  */
102  uint32_t ItemLength; // PDU Length
103  /*
104  7-8 Protocol-version This two byte field shall use one bit to identify each version of the
105  DICOM UL protocol supported by the calling end-system. This is
106  Version 1 and shall be identified with bit 0 set. A receiver of this PDU
107  implementing only this version of the DICOM UL protocol shall only test
108  that bit 0 is set.
109  */
110  static const uint16_t ProtocolVersion;
111  /*
112  9-10 Reserved This reserved field shall be sent with a value 0000H but not tested to
113  this value when received.
114  */
115  static const uint16_t Reserved9_10;
116  /*
117  11-26 Called-AE-title Destination DICOM Application Name. It shall be encoded as 16
118  characters as defined by the ISO 646:1990-Basic G0 Set with leading
119  and trailing spaces (20H) being non-significant. The value made of 16
120  spaces (20H) meaning "no Application Name specified" shall not be
121  used. For a complete description of the use of this field, see Section
122  7.1.1.4.
123  */
124  char CalledAETitle[16];
125  /*
126  27-42 Calling-AE-title Source DICOM Application Name. It shall be encoded as 16
127  characters as defined by the ISO 646:1990-Basic G0 Set with leading
128  and trailing spaces (20H) being non-significant. The value made of 16
129  spaces (20H) meaning "no Application Name specified" shall not be
130  used. For a complete description of the use of this field, see Section
131  7.1.1.3.
132  */
133  char CallingAETitle[16];
134  /*
135  43-74 Reserved This reserved field shall be sent with a value 00H for all bytes but not
136  tested to this value when received
137  */
138  char Reserved43_74[32]; // { 0 }
139  /*
140  75-xxx Variable items This variable field shall contain the following items: one Application
141  Context Item, one or more Presentation Context Items and one User
142  Information Item. For a complete description of the use of these items
143  see Sections 7.1.1.2, 7.1.1.13, and 7.1.1.6.
144  */
145  ApplicationContext AppContext;
146  std::vector<PresentationContextRQ> PresContext;
147  UserInformation UserInfo;
148 };
149 
150 } // end namespace network
151 } // end namespace gdcm
152 
153 #endif //GDCMAASSOCIATERQPDU_H
std::string GetReserved43_74() const
const PresentationContextRQ * GetPresentationContextByAbstractSyntax(AbstractSyntax const &as) const
PresentationContextArrayType const & GetPresentationContexts()
Definition: gdcmAAssociateRQPDU.h:80
ApplicationContext Table 9-12 APPLICATION CONTEXT ITEM FIELDS Looks like Application Context can onl...
Definition: gdcmApplicationContext.h:32
UserInformation Table 9-16 USER INFORMATION ITEM FIELDS.
Definition: gdcmUserInformation.h:43
std::string GetCalledAETitle() const
Definition: gdcmAAssociateRQPDU.h:46
const UserInformation & GetUserInformation() const
Definition: gdcmAAssociateRQPDU.h:86
void AddPresentationContext(PresentationContextRQ const &pc)
void SetCalledAETitle(const char calledaetitle[16])
Set the Called AE Title.
std::string GetCallingAETitle() const
Definition: gdcmAAssociateRQPDU.h:50
SizeType GetNumberOfPresentationContext() const
Definition: gdcmAAssociateRQPDU.h:72
BasePDU base class for PDUs.
Definition: gdcmBasePDU.h:50
AAssociateACPDU Table 9-17 ASSOCIATE-AC PDU fields.
Definition: gdcmAAssociateACPDU.h:37
AAssociateRQPDU Table 9-11 ASSOCIATE-RQ PDU fields.
Definition: gdcmAAssociateRQPDU.h:35
AAssociateRQPDU(const AAssociateRQPDU &pdu)
Definition: gdcmAAssociateRQPDU.h:61
std::vector< PresentationContextRQ > PresentationContextArrayType
Definition: gdcmAAssociateRQPDU.h:79
PresentationContextRQ const & GetPresentationContext(SizeType i) const
Definition: gdcmAAssociateRQPDU.h:75
bool IsLastFragment() const
Definition: gdcmAAssociateRQPDU.h:84
void SetCallingAETitle(const char callingaetitle[16])
Set the Calling AE Title.
const std::ostream & Write(std::ostream &os) const
AbstractSyntax Table 9-14 ABSTRACT SYNTAX SUB-ITEM FIELDS.
Definition: gdcmAbstractSyntax.h:32
std::vector< PresentationContextRQ >::size_type SizeType
Definition: gdcmAAssociateRQPDU.h:71
static bool IsAETitleValid(const char title[16])
Check whether or not the title is a valid AE title.
void SetUserInformation(UserInformation const &ui)
const PresentationContextRQ * GetPresentationContextByID(uint8_t i) const
std::istream & Read(std::istream &is)
void Print(std::ostream &os) const
PresentationContextRQ Table 9-13 PRESENTATION CONTEXT ITEM FIELDS.
Definition: gdcmPresentationContextRQ.h:34

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