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