gdcmDataEvent.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMDATAEVENT_H
#define GDCMDATAEVENT_H
#include "gdcmEvent.h"
namespace gdcm
{
class DataEvent : public AnyEvent
{
public:
typedef DataEvent Self;
typedef AnyEvent Superclass;
DataEvent(const char *bytes = nullptr, size_t len = 0):Bytes(bytes),Length(len) {}
~DataEvent() override = default;
DataEvent(const Self&s) : AnyEvent(s){};
void operator=(const Self&) = delete;
const char * GetEventName() const override { return "DataEvent"; }
bool CheckEvent(const ::gdcm::Event* e) const override
{ return (dynamic_cast<const Self*>(e) == nullptr ? false : true) ; }
::gdcm::Event* MakeObject() const override
{ return new Self; }
void SetData(const char *bytes, size_t len) {
Bytes = bytes;
Length = len;
}
size_t GetDataLength() const { return Length; }
const char *GetData() const { return Bytes; }
//std::string GetValueAsString() const { return; }
private:
const char *Bytes;
size_t Length;
};
} // end namespace gdcm
#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