GDCM 3.2.1

gdcmPresentationContextRQ.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 GDCMPRESENTATIONCONTEXTRQ_H
15#define GDCMPRESENTATIONCONTEXTRQ_H
16
17#include "gdcmTypes.h"
18#include "gdcmAbstractSyntax.h"
19#include "gdcmTransferSyntaxSub.h"
20#include "gdcmDataSet.h"
21
22 namespace gdcm
23{
24 class PresentationContext;
25 namespace network
26{
27
34 class GDCM_EXPORT PresentationContextRQ
35{
36 public:
37 PresentationContextRQ();
38
42 PresentationContextRQ( UIDs::TSName asname, UIDs::TSName tsname =
43 UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM );
44
45 std::istream &Read(std::istream &is);
46 const std::ostream &Write(std::ostream &os) const;
47 size_t Size() const;
48
49 void SetAbstractSyntax( AbstractSyntax const & absyn );
50 AbstractSyntax const &GetAbstractSyntax() const { return SubItems; }
51 AbstractSyntax &GetAbstractSyntax() { return SubItems; }
52
53 void AddTransferSyntax( TransferSyntaxSub const &ts );
54 typedef std::vector<TransferSyntaxSub>::size_type SizeType;
55 TransferSyntaxSub const & GetTransferSyntax(SizeType i) const { return TransferSyntaxes[i]; }
56 TransferSyntaxSub & GetTransferSyntax(SizeType i) { return TransferSyntaxes[i]; }
57 std::vector<TransferSyntaxSub> const & GetTransferSyntaxes() const {return TransferSyntaxes; }
58 SizeType GetNumberOfTransferSyntaxes() const { return TransferSyntaxes.size(); }
59
60 void SetPresentationContextID( uint8_t id );
61 uint8_t GetPresentationContextID() const;
62
63 void Print(std::ostream &os) const;
64
65 bool operator==(const PresentationContextRQ & pc) const
66 {
67 gdcm_assert( TransferSyntaxes.size() == 1 ); // TODO
68 gdcm_assert( pc.TransferSyntaxes.size() == 1 );
69 return SubItems == pc.SubItems && TransferSyntaxes == pc.TransferSyntaxes;
70 }
71
72 PresentationContextRQ(const PresentationContext & pc);
73
74 private:
75 static const uint8_t ItemType;
76 static const uint8_t Reserved2;
77 uint16_t ItemLength; // len of last transfer syntax
78 uint8_t /*PresentationContext*/ID;
79 static const uint8_t Reserved6;
80 static const uint8_t Reserved7;
81 static const uint8_t Reserved8;
82 /*
83 This variable field shall contain the following sub-items: one Abstract
84 Syntax and one or more Transfer Syntax(es). For a complete
85 description of the use and encoding of these sub-items see Sections
86 9.3.2.2.1 and 9.3.2.2.2.
87 */
88 AbstractSyntax SubItems;
89 std::vector<TransferSyntaxSub> TransferSyntaxes;
90};
91
92} // end namespace network
93
94} // end namespace gdcm
95
96#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
gdcm_assert
#define gdcm_assert(cond)
Definition gdcmException.h:104
gdcmTransferSyntaxSub.h
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm
Definition gdcmASN1.h:21