gdcmAAssociateRQPDU.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMAASSOCIATERQPDU_H
#define GDCMAASSOCIATERQPDU_H
#include "gdcmTypes.h"
#include "gdcmVR.h" // AEComp
#include "gdcmApplicationContext.h"
#include "gdcmPresentationContextRQ.h"
#include "gdcmUserInformation.h"
#include "gdcmBasePDU.h"
namespace gdcm
{
namespace network
{
class AAssociateACPDU;
class AAssociateRQPDU : public BasePDU
{
public:
AAssociateRQPDU();
std::istream &Read(std::istream &is) override;
const std::ostream &Write(std::ostream &os) const override;
size_t Size() const override;
void AddPresentationContext( PresentationContextRQ const &pc );
void SetCalledAETitle(const char calledaetitle[16]);
std::string GetCalledAETitle() const { return std::string(CalledAETitle,16); }
void SetCallingAETitle(const char callingaetitle[16]);
std::string GetCallingAETitle() const { return std::string(CallingAETitle,16); }
static bool IsAETitleValid(const char title[16]);
//void InitFromRQ( AAssociateACPDU & acpdu );
void Print(std::ostream &os) const override;
AAssociateRQPDU(const AAssociateRQPDU &pdu):BasePDU(pdu)
{
assert( 0 );
}
//this function fails to compile on windows.
// AAssociateRQPDU &operator=(const AAssociateRQPDU &_val)
// {
// assert( 0 );
// }
typedef std::vector<PresentationContextRQ>::size_type SizeType;
SizeType GetNumberOfPresentationContext() const {
return PresContext.size();
}
PresentationContextRQ const &GetPresentationContext(SizeType i) const {
assert( !PresContext.empty() && i < PresContext.size() );
return PresContext[i];
}
typedef std::vector<PresentationContextRQ> PresentationContextArrayType;
PresentationContextArrayType const &GetPresentationContexts() { return PresContext; }
const PresentationContextRQ *GetPresentationContextByID(uint8_t i) const;
const PresentationContextRQ *GetPresentationContextByAbstractSyntax(AbstractSyntax const & absyn ) const;
bool IsLastFragment() const override { return true; }
const UserInformation & GetUserInformation() const { return UserInfo; }
void SetUserInformation( UserInformation const & ui );
protected:
friend class AAssociateACPDU;
std::string GetReserved43_74() const;
private:
// 1 PDU-type 01H
static const uint8_t ItemType; // PDUType ?
// 2 Reserved This reserved field shall be sent with a value 00H but not tested to this value when received.
static const uint8_t Reserved2;
/* 3-6 PDU-length This PDU-length shall be the number of bytes from the first byte of the
following field to the last byte of the variable field. It shall be encoded as
an unsigned binary number
*/
uint32_t ItemLength; // PDU Length
/*
7-8 Protocol-version This two byte field shall use one bit to identify each version of the
DICOM UL protocol supported by the calling end-system. This is
Version 1 and shall be identified with bit 0 set. A receiver of this PDU
implementing only this version of the DICOM UL protocol shall only test
that bit 0 is set.
*/
static const uint16_t ProtocolVersion;
/*
9-10 Reserved This reserved field shall be sent with a value 0000H but not tested to
this value when received.
*/
static const uint16_t Reserved9_10;
/*
11-26 Called-AE-title Destination DICOM Application Name. It shall be encoded as 16
characters as defined by the ISO 646:1990-Basic G0 Set with leading
and trailing spaces (20H) being non-significant. The value made of 16
spaces (20H) meaning "no Application Name specified" shall not be
used. For a complete description of the use of this field, see Section
7.1.1.4.
*/
char CalledAETitle[16];
/*
27-42 Calling-AE-title Source DICOM Application Name. It shall be encoded as 16
characters as defined by the ISO 646:1990-Basic G0 Set with leading
and trailing spaces (20H) being non-significant. The value made of 16
spaces (20H) meaning "no Application Name specified" shall not be
used. For a complete description of the use of this field, see Section
7.1.1.3.
*/
char CallingAETitle[16];
/*
43-74 Reserved This reserved field shall be sent with a value 00H for all bytes but not
tested to this value when received
*/
char Reserved43_74[32]; // { 0 }
/*
75-xxx Variable items This variable field shall contain the following items: one Application
Context Item, one or more Presentation Context Items and one User
Information Item. For a complete description of the use of these items
see Sections 7.1.1.2, 7.1.1.13, and 7.1.1.6.
*/
ApplicationContext AppContext;
std::vector<PresentationContextRQ> PresContext;
UserInformation UserInfo;
};
} // end namespace network
} // end namespace gdcm
#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
gdcmPresentationContextRQ.h
gdcmTypes.h
gdcmUserInformation.h
gdcmVR.h
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm
Definition gdcmASN1.h:21