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 GDCMDATAEVENT_H 15 #define GDCMDATAEVENT_H 16 17 #include "gdcmEvent.h" 18 19 namespace gdcm 20 { 21 22 /** 23 * \brief DataEvent 24 */ 25 class DataEvent : public AnyEvent 26 { 27 public: 28 typedef DataEvent Self; 29 typedef AnyEvent Superclass; Bytes(bytes)30 DataEvent(const char *bytes = nullptr, size_t len = 0):Bytes(bytes),Length(len) {} 31 ~DataEvent() override = default; DataEvent(const Self & s)32 DataEvent(const Self&s) : AnyEvent(s){}; 33 void operator=(const Self&) = delete; 34 GetEventName()35 const char * GetEventName() const override { return "DataEvent"; } CheckEvent(const::gdcm::Event * e)36 bool CheckEvent(const ::gdcm::Event* e) const override 37 { return (dynamic_cast<const Self*>(e) == nullptr ? false : true) ; } MakeObject()38 ::gdcm::Event* MakeObject() const override 39 { return new Self; } 40 SetData(const char * bytes,size_t len)41 void SetData(const char *bytes, size_t len) { 42 Bytes = bytes; 43 Length = len; 44 } GetDataLength()45 size_t GetDataLength() const { return Length; } GetData()46 const char *GetData() const { return Bytes; } 47 48 //std::string GetValueAsString() const { return; } 49 50 private: 51 const char *Bytes; 52 size_t Length; 53 }; 54 55 56 } // end namespace gdcm 57 58 #endif //GDCMDATAEVENT_H 59