GDCM: gdcmDataEvent.h Source File

GDCM 3.2.10

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
25 class DataEvent : public AnyEvent
26{
27public:
28 typedef DataEvent Self;
29 typedef AnyEvent Superclass;
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), Bytes(nullptr), Length(0) {}
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
gdcm::AnyEvent
Definition gdcmEvent.h:83
gdcm::DataEvent::operator=
void operator=(const Self &)=delete
gdcm::DataEvent::GetData
const char * GetData() const
Definition gdcmDataEvent.h:46
gdcm::DataEvent::CheckEvent
bool CheckEvent(const ::gdcm::Event *e) const override
Definition gdcmDataEvent.h:36
gdcm::DataEvent::Self
DataEvent Self
Definition gdcmDataEvent.h:28
gdcm::DataEvent::GetEventName
const char * GetEventName() const override
Definition gdcmDataEvent.h:35
gdcm::DataEvent::GetDataLength
size_t GetDataLength() const
Definition gdcmDataEvent.h:45
gdcm::DataEvent::~DataEvent
~DataEvent() override=default
gdcm::DataEvent::Superclass
AnyEvent Superclass
Definition gdcmDataEvent.h:29
gdcm::DataEvent::DataEvent
DataEvent(const Self &s)
Definition gdcmDataEvent.h:32
gdcm::DataEvent::SetData
void SetData(const char *bytes, size_t len)
Definition gdcmDataEvent.h:41
gdcm::DataEvent::DataEvent
DataEvent(const char *bytes=nullptr, size_t len=0)
Definition gdcmDataEvent.h:30
gdcm::DataEvent::MakeObject
::gdcm::Event * MakeObject() const override
Definition gdcmDataEvent.h:38
gdcm::Event
superclass for callback/observer methods
Definition gdcmEvent.h:27
gdcmEvent.h
gdcm
Definition gdcmASN1.h:21