gdcmPresentationContextRQ.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 GDCMPRESENTATIONCONTEXTRQ_H
#define GDCMPRESENTATIONCONTEXTRQ_H
#include "gdcmTypes.h"
#include "gdcmAbstractSyntax.h"
#include "gdcmTransferSyntaxSub.h"
#include "gdcmDataSet.h"
namespace gdcm
{
class PresentationContext;
namespace network
{
class GDCM_EXPORT PresentationContextRQ
{
public:
PresentationContextRQ();
PresentationContextRQ( UIDs::TSName asname, UIDs::TSName tsname =
UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM );
std::istream &Read(std::istream &is);
const std::ostream &Write(std::ostream &os) const;
size_t Size() const;
void SetAbstractSyntax( AbstractSyntax const & absyn );
AbstractSyntax const &GetAbstractSyntax() const { return SubItems; }
AbstractSyntax &GetAbstractSyntax() { return SubItems; }
void AddTransferSyntax( TransferSyntaxSub const &ts );
typedef std::vector<TransferSyntaxSub>::size_type SizeType;
TransferSyntaxSub const & GetTransferSyntax(SizeType i) const { return TransferSyntaxes[i]; }
TransferSyntaxSub & GetTransferSyntax(SizeType i) { return TransferSyntaxes[i]; }
std::vector<TransferSyntaxSub> const & GetTransferSyntaxes() const {return TransferSyntaxes; }
SizeType GetNumberOfTransferSyntaxes() const { return TransferSyntaxes.size(); }
void SetPresentationContextID( uint8_t id );
uint8_t GetPresentationContextID() const;
void Print(std::ostream &os) const;
bool operator==(const PresentationContextRQ & pc) const
{
assert( TransferSyntaxes.size() == 1 ); // TODO
assert( pc.TransferSyntaxes.size() == 1 );
return SubItems == pc.SubItems && TransferSyntaxes == pc.TransferSyntaxes;
}
PresentationContextRQ(const PresentationContext & pc);
private:
static const uint8_t ItemType;
static const uint8_t Reserved2;
uint16_t ItemLength; // len of last transfer syntax
uint8_t /*PresentationContext*/ID;
static const uint8_t Reserved6;
static const uint8_t Reserved7;
static const uint8_t Reserved8;
/*
This variable field shall contain the following sub-items: one Abstract
Syntax and one or more Transfer Syntax(es). For a complete
description of the use and encoding of these sub-items see Sections
9.3.2.2.1 and 9.3.2.2.2.
*/
AbstractSyntax SubItems;
std::vector<TransferSyntaxSub> TransferSyntaxes;
};
} // end namespace network
} // end namespace gdcm
#endif //GDCMPRESENTATIONCONTEXTRQ_H
gdcm::PresentationContext
PresentationContext.
Definition gdcmPresentationContext.h:30
gdcm::UIDs::TSName
TSName
Definition gdcmUIDs.h:501
gdcm::UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM
@ ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM
Definition gdcmUIDs.h:503
gdcm::network::AbstractSyntax
AbstractSyntax.
Definition gdcmAbstractSyntax.h:33
gdcm::network::PresentationContextRQ::Size
size_t Size() const
gdcm::network::PresentationContextRQ::GetAbstractSyntax
AbstractSyntax const & GetAbstractSyntax() const
Definition gdcmPresentationContextRQ.h:50
gdcm::network::PresentationContextRQ::GetTransferSyntax
TransferSyntaxSub const & GetTransferSyntax(SizeType i) const
Definition gdcmPresentationContextRQ.h:55
gdcm::network::PresentationContextRQ::GetPresentationContextID
uint8_t GetPresentationContextID() const
gdcm::network::PresentationContextRQ::PresentationContextRQ
PresentationContextRQ(UIDs::TSName asname, UIDs::TSName tsname=UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM)
gdcm::network::PresentationContextRQ::SetAbstractSyntax
void SetAbstractSyntax(AbstractSyntax const &absyn)
gdcm::network::PresentationContextRQ::Read
std::istream & Read(std::istream &is)
gdcm::network::PresentationContextRQ::GetAbstractSyntax
AbstractSyntax & GetAbstractSyntax()
Definition gdcmPresentationContextRQ.h:51
gdcm::network::PresentationContextRQ::PresentationContextRQ
PresentationContextRQ(const PresentationContext &pc)
gdcm::network::PresentationContextRQ::PresentationContextRQ
PresentationContextRQ()
gdcm::network::PresentationContextRQ::GetTransferSyntaxes
std::vector< TransferSyntaxSub > const & GetTransferSyntaxes() const
Definition gdcmPresentationContextRQ.h:57
gdcm::network::PresentationContextRQ::GetTransferSyntax
TransferSyntaxSub & GetTransferSyntax(SizeType i)
Definition gdcmPresentationContextRQ.h:56
gdcm::network::PresentationContextRQ::AddTransferSyntax
void AddTransferSyntax(TransferSyntaxSub const &ts)
gdcm::network::PresentationContextRQ::SizeType
std::vector< TransferSyntaxSub >::size_type SizeType
Definition gdcmPresentationContextRQ.h:54
gdcm::network::PresentationContextRQ::Print
void Print(std::ostream &os) const
gdcm::network::PresentationContextRQ::GetNumberOfTransferSyntaxes
SizeType GetNumberOfTransferSyntaxes() const
Definition gdcmPresentationContextRQ.h:58
gdcm::network::PresentationContextRQ::Write
const std::ostream & Write(std::ostream &os) const
gdcm::network::PresentationContextRQ::operator==
bool operator==(const PresentationContextRQ &pc) const
Definition gdcmPresentationContextRQ.h:65
gdcm::network::PresentationContextRQ::SetPresentationContextID
void SetPresentationContextID(uint8_t id)
gdcm::network::TransferSyntaxSub
TransferSyntaxSub.
Definition gdcmTransferSyntaxSub.h:38
gdcmAbstractSyntax.h
gdcmDataSet.h
gdcmTransferSyntaxSub.h
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm
Definition gdcmASN1.h:21