Geant4 Cross Reference |
1 // Copyright (C) 2010, Guy Barrand. All rights 2 // See the file tools.license for terms. 3 4 #ifndef tools_wroot_bufobj 5 #define tools_wroot_bufobj 6 7 #include "iobject" 8 #include "buffer" 9 10 namespace tools { 11 namespace wroot { 12 13 class bufobj : public virtual iobject,public b 14 public: 15 static const std::string& s_class() { 16 static const std::string s_v("tools::wroot 17 return s_v; 18 } 19 public: 20 virtual const std::string& name() const {ret 21 virtual const std::string& title() const {re 22 virtual const std::string& store_class_name( 23 virtual bool stream(buffer& a_buffer) const 24 public: 25 bufobj(std::ostream& a_out,bool a_byte_swap, 26 const std::string& a_name, 27 const std::string& a_title, 28 const std::string& a_store_cls) 29 :buffer(a_out,a_byte_swap,a_size) 30 ,m_name(a_name) 31 ,m_title(a_title) 32 ,m_store_cls(a_store_cls) 33 { 34 #ifdef TOOLS_MEM 35 mem::increment(s_class().c_str()); 36 #endif 37 } 38 virtual ~bufobj(){ 39 #ifdef TOOLS_MEM 40 mem::decrement(s_class().c_str()); 41 #endif 42 } 43 protected: 44 bufobj(const bufobj& a_from): iobject(a_from 45 #ifdef TOOLS_MEM 46 mem::increment(s_class().c_str()); 47 #endif 48 } 49 bufobj& operator=(const bufobj &){return *th 50 protected: 51 std::string m_name; 52 std::string m_title; 53 std::string m_store_cls; 54 }; 55 56 }} 57 58 #endif