GDCM: gdcmAAssociateRQPDU.h Source File

GDCM 3.2.8

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"
20#include "gdcmPresentationContextRQ.h"
21#include "gdcmUserInformation.h"
22#include "gdcmBasePDU.h"
23
24namespace gdcm
25{
26
27namespace network
28{
29
30class AAssociateACPDU;
35 class AAssociateRQPDU : public BasePDU
36{
37public:
38 AAssociateRQPDU();
39 std::istream &Read(std::istream &is) override;
40 const std::ostream &Write(std::ostream &os) const override;
41 size_t Size() const override;
42 void AddPresentationContext( PresentationContextRQ const &pc );
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
61 AAssociateRQPDU(const AAssociateRQPDU &pdu):BasePDU(pdu)
62 {
63 gdcm_assert( 0 );
64 }
65 //this function fails to compile on windows.
66// AAssociateRQPDU &operator=(const AAssociateRQPDU &_val)
67// {
68// gdcm_assert( 0 );
69// }
70
71 typedef std::vector<PresentationContextRQ>::size_type SizeType;
72 SizeType GetNumberOfPresentationContext() const {
73 return PresContext.size();
74 }
75 PresentationContextRQ const &GetPresentationContext(SizeType i) const {
76 gdcm_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;
83 const PresentationContextRQ *GetPresentationContextByAbstractSyntax(AbstractSyntax const & absyn ) const;
84 bool IsLastFragment() const override { return true; }
85
86 const UserInformation & GetUserInformation() const { return UserInfo; }
87 void SetUserInformation( UserInformation const & ui );
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
gdcm::network::AAssociateACPDU
AAssociateACPDU.
Definition gdcmAAssociateACPDU.h:38
gdcm::network::AAssociateRQPDU::PresentationContextArrayType
std::vector< PresentationContextRQ > PresentationContextArrayType
Definition gdcmAAssociateRQPDU.h:79
gdcm::network::AAssociateRQPDU::GetCallingAETitle
std::string GetCallingAETitle() const
Definition gdcmAAssociateRQPDU.h:50
gdcm::network::AAssociateRQPDU::GetNumberOfPresentationContext
SizeType GetNumberOfPresentationContext() const
Definition gdcmAAssociateRQPDU.h:72
gdcm::network::AAssociateRQPDU::IsLastFragment
bool IsLastFragment() const override
Definition gdcmAAssociateRQPDU.h:84
gdcm::network::AAssociateRQPDU::GetCalledAETitle
std::string GetCalledAETitle() const
Definition gdcmAAssociateRQPDU.h:46
gdcm::network::AAssociateRQPDU::GetPresentationContext
PresentationContextRQ const & GetPresentationContext(SizeType i) const
Definition gdcmAAssociateRQPDU.h:75
gdcm::network::AAssociateRQPDU::IsAETitleValid
static bool IsAETitleValid(const char title[16])
Check whether or not the.
gdcm::network::AAssociateRQPDU::AAssociateRQPDU
AAssociateRQPDU(const AAssociateRQPDU &pdu)
Definition gdcmAAssociateRQPDU.h:61
gdcm::network::AAssociateRQPDU::Read
std::istream & Read(std::istream &is) override
gdcm::network::AAssociateRQPDU::SizeType
std::vector< PresentationContextRQ >::size_type SizeType
Definition gdcmAAssociateRQPDU.h:71
gdcm::network::AAssociateRQPDU::GetPresentationContexts
PresentationContextArrayType const & GetPresentationContexts()
Definition gdcmAAssociateRQPDU.h:80
gdcm::network::AAssociateRQPDU::GetReserved43_74
std::string GetReserved43_74() const
gdcm::network::AAssociateRQPDU::AAssociateRQPDU
AAssociateRQPDU()
gdcm::network::AAssociateRQPDU::SetCalledAETitle
void SetCalledAETitle(const char calledaetitle[16])
Set the Called AE Title.
gdcm::network::AAssociateRQPDU::GetPresentationContextByID
const PresentationContextRQ * GetPresentationContextByID(uint8_t i) const
gdcm::network::AAssociateRQPDU::AAssociateACPDU
friend class AAssociateACPDU
Definition gdcmAAssociateRQPDU.h:90
gdcm::network::AAssociateRQPDU::GetUserInformation
const UserInformation & GetUserInformation() const
Definition gdcmAAssociateRQPDU.h:86
gdcm::network::AAssociateRQPDU::SetCallingAETitle
void SetCallingAETitle(const char callingaetitle[16])
Set the Calling AE Title.
gdcm::network::AAssociateRQPDU::SetUserInformation
void SetUserInformation(UserInformation const &ui)
gdcm::network::AAssociateRQPDU::Size
size_t Size() const override
gdcm::network::AAssociateRQPDU::Print
void Print(std::ostream &os) const override
gdcm::network::AAssociateRQPDU::GetPresentationContextByAbstractSyntax
const PresentationContextRQ * GetPresentationContextByAbstractSyntax(AbstractSyntax const &absyn) const
gdcm::network::AAssociateRQPDU::Write
const std::ostream & Write(std::ostream &os) const override
gdcm::network::AAssociateRQPDU::AddPresentationContext
void AddPresentationContext(PresentationContextRQ const &pc)
gdcm::network::AbstractSyntax
AbstractSyntax.
Definition gdcmAbstractSyntax.h:33
gdcm::network::ApplicationContext
ApplicationContext.
Definition gdcmApplicationContext.h:33
gdcm::network::BasePDU
BasePDU.
Definition gdcmBasePDU.h:51
gdcm::network::PresentationContextRQ
PresentationContextRQ.
Definition gdcmPresentationContextRQ.h:35
gdcm::network::UserInformation
UserInformation.
Definition gdcmUserInformation.h:44
gdcmApplicationContext.h
gdcmBasePDU.h
gdcm_assert
#define gdcm_assert(cond)
Definition gdcmException.h:104
gdcmPresentationContextRQ.h
gdcmTypes.h
gdcmUserInformation.h
gdcmVR.h
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm
Definition gdcmASN1.h:21