GDCM  2.2.0
gdcmDataEvent.h
Go to the documentation of this file.
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 GDCMDATAEVENT_H
00015 #define GDCMDATAEVENT_H
00016 
00017 #include "gdcmEvent.h"
00018 
00019 namespace gdcm
00020 {
00021 
00025 class DataEvent : public AnyEvent
00026 {
00027 public:
00028   typedef DataEvent Self;
00029   typedef AnyEvent Superclass;
00030   DataEvent(const char *bytes = 0, size_t len = 0):Bytes(bytes),Length(len) {}
00031   virtual ~DataEvent() {}
00032   virtual const char * GetEventName() const { return "DataEvent"; }
00033   virtual bool CheckEvent(const ::gdcm::Event* e) const
00034   { return (dynamic_cast<const Self*>(e) == NULL ? false : true) ; }
00035   virtual ::gdcm::Event* MakeObject() const
00036     { return new Self; }
00037   DataEvent(const Self&s) : AnyEvent(s){};
00038 
00039   void SetData(const char *bytes, size_t len) {
00040     Bytes = bytes;
00041     Length = len;
00042   }
00043   size_t GetDataLength() const { return Length; }
00044   const char *GetData() const { return Bytes; }
00045 
00046   //std::string GetValueAsString() const { return; }
00047 
00048 private:
00049   void operator=(const Self&);
00050   const char *Bytes;
00051   size_t Length;
00052 };
00053 
00054 
00055 } // end namespace gdcm
00056 
00057 #endif //GDCMDATAEVENT_H

Generated on Fri Mar 30 2012 12:44:01 for GDCM by doxygen 1.8.0
SourceForge.net Logo