GDCM: gdcmPresentationContext.h Source File

GDCM 3.2.11

gdcmPresentationContext.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 GDCMPRESENTATIONCONTEXT_H
15#define GDCMPRESENTATIONCONTEXT_H
16
17#include "gdcmTypes.h"
18#include "gdcmUIDs.h"
19
20#include <vector>
21
22namespace gdcm
23{
24
29 class GDCM_EXPORT PresentationContext
30{
31public:
32 PresentationContext();
33
37 PresentationContext( UIDs::TSName asname,
38 UIDs::TSName tsname = UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM );
39
40 void SetAbstractSyntax( const char *absyn ) { AbstractSyntax = absyn; }
41 const char *GetAbstractSyntax() const { return AbstractSyntax.c_str(); }
42
43 void AddTransferSyntax( const char *tsstr );
44 typedef std::vector<std::string> TransferSyntaxArrayType;
45 typedef TransferSyntaxArrayType::size_type SizeType;
46 const char *GetTransferSyntax(SizeType i) const { return TransferSyntaxes[i].c_str(); }
47 SizeType GetNumberOfTransferSyntaxes() const { return TransferSyntaxes.size(); }
48
49 void SetPresentationContextID( uint8_t id );
50 uint8_t GetPresentationContextID() const;
51
52 void Print(std::ostream &os) const;
53
54 bool operator==(const PresentationContext & pc) const
55 {
56 gdcm_assert( TransferSyntaxes.size() == 1 ); // TODO
57 gdcm_assert( pc.TransferSyntaxes.size() == 1 );
58 return AbstractSyntax == pc.AbstractSyntax && TransferSyntaxes == pc.TransferSyntaxes;
59 }
60
61protected :
62 std::string AbstractSyntax;
63 std::vector<std::string> TransferSyntaxes;
64 uint8_t /*PresentationContext*/ID;
65};
66
67} // end namespace gdcm
68
69#endif //GDCMPRESENTATIONCONTEXT_H
gdcm::PresentationContext::PresentationContext
PresentationContext(UIDs::TSName asname, UIDs::TSName tsname=UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM)
gdcm::PresentationContext::operator==
bool operator==(const PresentationContext &pc) const
Definition gdcmPresentationContext.h:54
gdcm::PresentationContext::SizeType
TransferSyntaxArrayType::size_type SizeType
Definition gdcmPresentationContext.h:45
gdcm::PresentationContext::PresentationContext
PresentationContext()
gdcm::PresentationContext::ID
uint8_t ID
Definition gdcmPresentationContext.h:64
gdcm::PresentationContext::TransferSyntaxArrayType
std::vector< std::string > TransferSyntaxArrayType
Definition gdcmPresentationContext.h:44
gdcm::PresentationContext::SetAbstractSyntax
void SetAbstractSyntax(const char *absyn)
Definition gdcmPresentationContext.h:40
gdcm::PresentationContext::SetPresentationContextID
void SetPresentationContextID(uint8_t id)
gdcm::PresentationContext::TransferSyntaxes
std::vector< std::string > TransferSyntaxes
Definition gdcmPresentationContext.h:63
gdcm::PresentationContext::AddTransferSyntax
void AddTransferSyntax(const char *tsstr)
gdcm::PresentationContext::Print
void Print(std::ostream &os) const
gdcm::PresentationContext::AbstractSyntax
std::string AbstractSyntax
Definition gdcmPresentationContext.h:62
gdcm::PresentationContext::GetAbstractSyntax
const char * GetAbstractSyntax() const
Definition gdcmPresentationContext.h:41
gdcm::PresentationContext::GetTransferSyntax
const char * GetTransferSyntax(SizeType i) const
Definition gdcmPresentationContext.h:46
gdcm::PresentationContext::GetNumberOfTransferSyntaxes
SizeType GetNumberOfTransferSyntaxes() const
Definition gdcmPresentationContext.h:47
gdcm::PresentationContext::GetPresentationContextID
uint8_t GetPresentationContextID() const
gdcm::UIDs::TSName
TSName
Definition gdcmUIDs.h:501
gdcm::UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM
@ ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM
Definition gdcmUIDs.h:503
gdcm_assert
#define gdcm_assert(cond)
Definition gdcmException.h:104
gdcmTypes.h
gdcmUIDs.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21