GDCM 3.0.24
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
21#include "gdcmUserInformation.h"
22#include "gdcmBasePDU.h"
23
24namespace gdcm
25{
26
27namespace network
28{
29
30class AAssociateACPDU;
36{
37public:
39 std::istream &Read(std::istream &is) override;
40 const std::ostream &Write(std::ostream &os) const override;
41 size_t Size() const override;
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 override;
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;
81
84 bool IsLastFragment() const override { return true; }
85
86 const UserInformation & GetUserInformation() const { return UserInfo; }
88
89protected:
90 friend class AAssociateACPDU;
91 std::string GetReserved43_74() const;
92
93private:
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
AAssociateACPDU.
Definition gdcmAAssociateACPDU.h:38
AAssociateRQPDU.
Definition gdcmAAssociateRQPDU.h:36
std::vector< PresentationContextRQ > PresentationContextArrayType
Definition gdcmAAssociateRQPDU.h:79
std::string GetCallingAETitle() const
Definition gdcmAAssociateRQPDU.h:50
SizeType GetNumberOfPresentationContext() const
Definition gdcmAAssociateRQPDU.h:72
bool IsLastFragment() const override
Definition gdcmAAssociateRQPDU.h:84
std::string GetCalledAETitle() const
Definition gdcmAAssociateRQPDU.h:46
PresentationContextRQ const & GetPresentationContext(SizeType i) const
Definition gdcmAAssociateRQPDU.h:75
static bool IsAETitleValid(const char title[16])
Check whether or not the.
AAssociateRQPDU(const AAssociateRQPDU &pdu)
Definition gdcmAAssociateRQPDU.h:61
std::istream & Read(std::istream &is) override
std::vector< PresentationContextRQ >::size_type SizeType
Definition gdcmAAssociateRQPDU.h:71
PresentationContextArrayType const & GetPresentationContexts()
Definition gdcmAAssociateRQPDU.h:80
std::string GetReserved43_74() const
void SetCalledAETitle(const char calledaetitle[16])
Set the Called AE Title.
const PresentationContextRQ * GetPresentationContextByID(uint8_t i) const
const UserInformation & GetUserInformation() const
Definition gdcmAAssociateRQPDU.h:86
void SetCallingAETitle(const char callingaetitle[16])
Set the Calling AE Title.
void SetUserInformation(UserInformation const &ui)
size_t Size() const override
void Print(std::ostream &os) const override
const PresentationContextRQ * GetPresentationContextByAbstractSyntax(AbstractSyntax const &absyn) const
const std::ostream & Write(std::ostream &os) const override
void AddPresentationContext(PresentationContextRQ const &pc)
AbstractSyntax.
Definition gdcmAbstractSyntax.h:33
ApplicationContext.
Definition gdcmApplicationContext.h:33
BasePDU.
Definition gdcmBasePDU.h:51
PresentationContextRQ.
Definition gdcmPresentationContextRQ.h:35
UserInformation.
Definition gdcmUserInformation.h:44
Definition gdcmASN1.h:21