GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

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
22 namespace gdcm
23 {
24
29 class GDCM_EXPORT PresentationContext
30 {
31 public:
32 PresentationContext();
33
37 PresentationContext( UIDs::TSName asname,
38 UIDs::TSName tsname = UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM );
39
40 void SetAbstractSyntax( const char *as ) { AbstractSyntax = as; }
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 assert( TransferSyntaxes.size() == 1 ); // TODO
57 assert( pc.TransferSyntaxes.size() == 1 );
58 return AbstractSyntax == pc.AbstractSyntax && TransferSyntaxes == pc.TransferSyntaxes;
59 }
60
61 private:
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