GDCM
2.2.3
|
00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 00005 Copyright (c) 2006-2011 Mathieu Malaterre 00006 All rights reserved. 00007 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 #ifndef GDCMPDATATFPDU_H 00015 #define GDCMPDATATFPDU_H 00016 00017 #include "gdcmTypes.h" 00018 #include "gdcmPresentationDataValue.h" 00019 #include "gdcmBasePDU.h" 00020 #include <limits> 00021 00022 namespace gdcm 00023 { 00024 00025 namespace network 00026 { 00027 00033 class GDCM_EXPORT PDataTFPDU : public BasePDU 00034 { 00035 public: 00036 PDataTFPDU(); 00037 std::istream &Read(std::istream &is); 00038 const std::ostream &Write(std::ostream &os) const; 00039 00041 size_t Size() const; 00042 00043 void AddPresentationDataValue( PresentationDataValue const &pdv ) { 00044 V.push_back( pdv ); 00045 assert(Size() < std::numeric_limits<uint32_t>::max()); 00046 ItemLength = (uint32_t)Size() - 6; 00047 } 00048 00049 typedef std::vector<PresentationDataValue>::size_type SizeType; 00050 PresentationDataValue const &GetPresentationDataValue(SizeType i) const { 00051 assert( !V.empty() && i < V.size() ); 00052 return V[i]; 00053 } 00054 SizeType GetNumberOfPresentationDataValues() const { 00055 return V.size(); 00056 } 00057 00058 void Print(std::ostream &os) const; 00059 bool IsLastFragment() const; 00060 00061 protected: 00062 std::istream &ReadInto(std::istream &is, std::ostream &os); 00063 private: 00064 static const uint8_t ItemType; // PDUType ? 00065 static const uint8_t Reserved2; 00066 uint32_t ItemLength; // PDU Length ? 00067 std::vector<PresentationDataValue> V; 00068 }; 00069 00070 } // end namespace network 00071 00072 } // end namespace gdcm 00073 00074 #endif //GDCMPDATATFPDU_H