GDCM 3.2.1

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) override;
38 const std::ostream &Write(std::ostream &os) const override;
39
41 size_t Size() const override;
42
43 void AddPresentationDataValue( PresentationDataValue const &pdv ) {
44 V.push_back( pdv );
45 gdcm_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 gdcm_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 override;
59 bool IsLastFragment() const override;
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
gdcm::network::BasePDU
BasePDU.
Definition gdcmBasePDU.h:51
gdcm::network::PDataTFPDU::Print
void Print(std::ostream &os) const override
gdcm::network::PDataTFPDU::GetNumberOfPresentationDataValues
SizeType GetNumberOfPresentationDataValues() const
Definition gdcmPDataTFPDU.h:54
gdcm::network::PDataTFPDU::SizeType
std::vector< PresentationDataValue >::size_type SizeType
Definition gdcmPDataTFPDU.h:49
gdcm::network::PDataTFPDU::PDataTFPDU
PDataTFPDU()
gdcm::network::PDataTFPDU::Size
size_t Size() const override
gdcm::network::PDataTFPDU::IsLastFragment
bool IsLastFragment() const override
gdcm::network::PDataTFPDU::ReadInto
std::istream & ReadInto(std::istream &is, std::ostream &os)
gdcm::network::PDataTFPDU::AddPresentationDataValue
void AddPresentationDataValue(PresentationDataValue const &pdv)
Definition gdcmPDataTFPDU.h:43
gdcm::network::PDataTFPDU::Read
std::istream & Read(std::istream &is) override
gdcm::network::PDataTFPDU::GetPresentationDataValue
PresentationDataValue const & GetPresentationDataValue(SizeType i) const
Definition gdcmPDataTFPDU.h:50
gdcm::network::PDataTFPDU::Write
const std::ostream & Write(std::ostream &os) const override
gdcm::network::PresentationDataValue
PresentationDataValue.
Definition gdcmPresentationDataValue.h:33
gdcmBasePDU.h
gdcm_assert
#define gdcm_assert(cond)
Definition gdcmException.h:104
gdcmPresentationDataValue.h
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm::network
Definition gdcmAAbortPDU.h:24
gdcm
Definition gdcmASN1.h:21