GDCM: gdcmAAssociateACPDU.h Source File

GDCM 3.2.7

gdcmAAssociateACPDU.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 GDCMAASSOCIATEACPDU_H
15#define GDCMAASSOCIATEACPDU_H
16
17#include "gdcmTypes.h"
18#include "gdcmApplicationContext.h"
19#include "gdcmPresentationContextAC.h"
20#include "gdcmUserInformation.h"
21#include "gdcmBasePDU.h"
22
23#include <vector>
24
25namespace gdcm
26{
27
28namespace network
29{
30class AAssociateRQPDU;
31
37 class AAssociateACPDU : public BasePDU
38{
39public:
40 AAssociateACPDU();
41 std::istream &Read(std::istream &is) override;
42 const std::ostream &Write(std::ostream &os) const override;
43
44 void AddPresentationContextAC( PresentationContextAC const &pcac );
45
46 typedef std::vector<PresentationContextAC>::size_type SizeType;
47 const PresentationContextAC &GetPresentationContextAC( SizeType i ) {
48 gdcm_assert( !PresContextAC.empty() && i < PresContextAC.size() );
49 return PresContextAC[i];
50 }
51 SizeType GetNumberOfPresentationContextAC() const {
52 return PresContextAC.size();
53 }
54 const UserInformation &GetUserInformation() const { return UserInfo; }
55
56 SizeType Size() const override;
57
58 void Print(std::ostream &os) const override;
59 bool IsLastFragment() const override { return true; }
60
61 void InitFromRQ( AAssociateRQPDU const & rqpdu );
62protected:
63 friend class AAssociateRQPDU;
64 void SetCalledAETitle(const char calledaetitle[16]);
65 void SetCallingAETitle(const char callingaetitle[16]);
66
67private:
68 void InitSimple( AAssociateRQPDU const & rqpdu );
69
70private:
71 static const uint8_t ItemType; // PDUType ?
72 static const uint8_t Reserved2;
73 uint32_t PDULength; // len of
74 static const uint16_t ProtocolVersion;
75 static const uint16_t Reserved9_10;
76
77 // This reserved field shall be sent with a value identical to the value
78 // received in the same field of the A-ASSOCIATE-RQ PDU, but its value
79 // shall not be tested when received.
80 char Reserved11_26[16];
81 // This reserved field shall be sent with a value identical to the value
82 // received in the same field of the A-ASSOCIATE-RQ PDU, but its value
83 // shall not be tested when received.
84 char Reserved27_42[16];
85 // This reserved field shall be sent with a value identical to the value
86 // received in the same field of the A-ASSOCIATE-RQ PDU, but its value
87 // shall not be tested when received.
88 char Reserved43_74[32];
89 /*
90 75-xxx Variable items This variable field shall contain the following items: one Application
91 Context Item, one or more Presentation Context Item(s) and one User
92 Information Item. For a complete description of these items see Sections
93 7.1.1.2, 7.1.1.14, and 7.1.1.6.
94 */
95 ApplicationContext AppContext;
96 std::vector<PresentationContextAC> PresContextAC;
97 UserInformation UserInfo;
98};
99
100} // end namespace network
101
102} // end namespace gdcm
103
104#endif //GDCMAASSOCIATEACPDU_H
gdcm::network::AAssociateACPDU::GetUserInformation
const UserInformation & GetUserInformation() const
Definition gdcmAAssociateACPDU.h:54
gdcm::network::AAssociateACPDU::SizeType
std::vector< PresentationContextAC >::size_type SizeType
Definition gdcmAAssociateACPDU.h:46
gdcm::network::AAssociateACPDU::AAssociateACPDU
AAssociateACPDU()
gdcm::network::AAssociateACPDU::AAssociateRQPDU
friend class AAssociateRQPDU
Definition gdcmAAssociateACPDU.h:63
gdcm::network::AAssociateACPDU::AddPresentationContextAC
void AddPresentationContextAC(PresentationContextAC const &pcac)
gdcm::network::AAssociateACPDU::IsLastFragment
bool IsLastFragment() const override
Definition gdcmAAssociateACPDU.h:59
gdcm::network::AAssociateACPDU::InitFromRQ
void InitFromRQ(AAssociateRQPDU const &rqpdu)
gdcm::network::AAssociateACPDU::GetNumberOfPresentationContextAC
SizeType GetNumberOfPresentationContextAC() const
Definition gdcmAAssociateACPDU.h:51
gdcm::network::AAssociateACPDU::GetPresentationContextAC
const PresentationContextAC & GetPresentationContextAC(SizeType i)
Definition gdcmAAssociateACPDU.h:47
gdcm::network::AAssociateACPDU::SetCalledAETitle
void SetCalledAETitle(const char calledaetitle[16])
gdcm::network::AAssociateACPDU::Read
std::istream & Read(std::istream &is) override
gdcm::network::AAssociateACPDU::Print
void Print(std::ostream &os) const override
gdcm::network::AAssociateACPDU::Size
SizeType Size() const override
gdcm::network::AAssociateACPDU::SetCallingAETitle
void SetCallingAETitle(const char callingaetitle[16])
gdcm::network::AAssociateACPDU::Write
const std::ostream & Write(std::ostream &os) const override
gdcm::network::AAssociateRQPDU
AAssociateRQPDU.
Definition gdcmAAssociateRQPDU.h:36
gdcm::network::ApplicationContext
ApplicationContext.
Definition gdcmApplicationContext.h:33
gdcm::network::BasePDU
BasePDU.
Definition gdcmBasePDU.h:51
gdcm::network::PresentationContextAC
PresentationContextAC.
Definition gdcmPresentationContextAC.h:33
gdcm::network::UserInformation
UserInformation.
Definition gdcmUserInformation.h:44
gdcmApplicationContext.h
gdcmBasePDU.h
gdcm_assert
#define gdcm_assert(cond)
Definition gdcmException.h:104
gdcmPresentationContextAC.h
gdcmTypes.h
gdcmUserInformation.h
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm
Definition gdcmASN1.h:21