GDCM 2.2.1

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

- File List
- File Members

gdcmPDataTFPDU.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 GDCMPDATATFPDU_H
15 #define GDCMPDATATFPDU_H
16
17 #include "gdcmTypes.h"
18 #include "gdcmPresentationDataValue.h"
19 #include "gdcmBasePDU.h"
20 #include <limits>
21
22 namespace gdcm
23 {
24
25 namespace network
26 {
27
33 class GDCM_EXPORT PDataTFPDU : public BasePDU
34 {
35 public:
36 PDataTFPDU();
37 std::istream &Read(std::istream &is);
38 const std::ostream &Write(std::ostream &os) const;
39
41 size_t Size() const;
42
43 void AddPresentationDataValue( PresentationDataValue const &pdv ) {
44 V.push_back( pdv );
45 assert(Size() < std::numeric_limits<uint32_t>::max());
46 ItemLength = (uint32_t)Size() - 6;
47 }
48
49 typedef std::vector<PresentationDataValue>::size_type SizeType;
50 PresentationDataValue const &GetPresentationDataValue(SizeType i) const {
51 assert( !V.empty() && i < V.size() );
52 return V[i];
53 }
54 SizeType GetNumberOfPresentationDataValues() const {
55 return V.size();
56 }
57
58 void Print(std::ostream &os) const;
59 bool IsLastFragment() const;
60
61 protected:
62 std::istream &ReadInto(std::istream &is, std::ostream &os);
63 private:
64 static const uint8_t ItemType; // PDUType ?
65 static const uint8_t Reserved2;
66 uint32_t ItemLength; // PDU Length ?
67 std::vector<PresentationDataValue> V;
68 };
69
70 } // end namespace network
71
72 } // end namespace gdcm
73
74 #endif //GDCMPDATATFPDU_H