inlib
1.2.0
|
00001 // Copyright (C) 2010, Guy Barrand. All rights reserved. 00002 // See the file inlib.license for terms. 00003 00004 #ifndef inlib_rroot_graph 00005 #define inlib_rroot_graph 00006 00007 #include "../scast" 00008 #include "buffer" 00009 00010 namespace inlib { 00011 namespace rroot { 00012 00013 class graph : public virtual iro { 00014 public: 00015 static const std::string& s_class() { 00016 static const std::string s_v("inlib::rroot::graph"); 00017 return s_v; 00018 } 00019 public: //iro 00020 virtual void* cast(const std::string& a_class) const { 00021 if(void* p = inlib::cmp_cast<graph>(this,a_class)) {return p;} 00022 else return 0; 00023 } 00024 virtual bool stream(buffer& a_buffer) { 00025 uint32 startpos = a_buffer.length(); 00026 short v; 00027 unsigned int s,c; 00028 if(!a_buffer.read_version(v,s,c)) return false; 00029 a_buffer.set_offset(startpos+c+sizeof(unsigned int)); 00030 if(!a_buffer.check_byte_count(s,c,"TGraph")) return false; 00031 return true; 00032 } 00033 public: 00034 graph(){ 00035 #ifdef INLIB_MEM 00036 mem::increment(s_class().c_str()); 00037 #endif 00038 } 00039 virtual ~graph(){ 00040 #ifdef INLIB_MEM 00041 mem::decrement(s_class().c_str()); 00042 #endif 00043 } 00044 protected: 00045 graph(const graph& a_from): iro(a_from){} 00046 graph& operator=(const graph&){return *this;} 00047 }; 00048 00049 }} 00050 00051 #endif