Warning, /include/Geant4/tools/wroot/bufobj is written in an unsupported language. File is not indexed.
0001 // Copyright (C) 2010, Guy Barrand. All rights reserved.
0002 // See the file tools.license for terms.
0003
0004 #ifndef tools_wroot_bufobj
0005 #define tools_wroot_bufobj
0006
0007 #include "iobject"
0008 #include "buffer"
0009
0010 namespace tools {
0011 namespace wroot {
0012
0013 class bufobj : public virtual iobject,public buffer {
0014 public:
0015 static const std::string& s_class() {
0016 static const std::string s_v("tools::wroot::bufobj");
0017 return s_v;
0018 }
0019 public:
0020 virtual const std::string& name() const {return m_name;}
0021 virtual const std::string& title() const {return m_title;}
0022 virtual const std::string& store_class_name() const {return m_store_cls;}
0023 virtual bool stream(buffer& a_buffer) const {return a_buffer.write_fast_array(m_buffer,length());}
0024 public:
0025 bufobj(std::ostream& a_out,bool a_byte_swap,uint32 a_size,
0026 const std::string& a_name,
0027 const std::string& a_title,
0028 const std::string& a_store_cls)
0029 :buffer(a_out,a_byte_swap,a_size)
0030 ,m_name(a_name)
0031 ,m_title(a_title)
0032 ,m_store_cls(a_store_cls)
0033 {
0034 #ifdef TOOLS_MEM
0035 mem::increment(s_class().c_str());
0036 #endif
0037 }
0038 virtual ~bufobj(){
0039 #ifdef TOOLS_MEM
0040 mem::decrement(s_class().c_str());
0041 #endif
0042 }
0043 protected:
0044 bufobj(const bufobj& a_from): iobject(a_from),buffer(a_from){
0045 #ifdef TOOLS_MEM
0046 mem::increment(s_class().c_str());
0047 #endif
0048 }
0049 bufobj& operator=(const bufobj &){return *this;}
0050 protected:
0051 std::string m_name;
0052 std::string m_title;
0053 std::string m_store_cls;
0054 };
0055
0056 }}
0057
0058 #endif