Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/Geant4/tools/raxml_out 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_raxml_out
0005 #define tools_raxml_out
0006 
0007 #include "handle"
0008 
0009 namespace tools {
0010 
0011 class raxml_out {
0012 public:
0013   raxml_out():m_hdl(0){}
0014   raxml_out(base_handle* a_hdl,const std::string& a_class,const std::string& a_path,const std::string& a_name)
0015   :m_hdl(a_hdl) //take ownership of a_hdl
0016   ,m_class(a_class)
0017   ,m_path(a_path),m_name(a_name)
0018   {}
0019   virtual ~raxml_out(){delete m_hdl;}
0020 public:
0021   raxml_out(const raxml_out& a_from)
0022   :m_hdl(a_from.m_hdl?a_from.m_hdl->copy():0)
0023   ,m_class(a_from.m_class)
0024   ,m_path(a_from.m_path),m_name(a_from.m_name)
0025   {}
0026   raxml_out& operator=(const raxml_out& a_from){
0027     if(&a_from==this) return *this;
0028 
0029     delete m_hdl;
0030     m_hdl = a_from.m_hdl?a_from.m_hdl->copy():0;
0031 
0032     m_class = a_from.m_class;
0033     m_path = a_from.m_path;
0034     m_name = a_from.m_name;
0035 
0036     return *this;
0037   }
0038 public:
0039   void* object() const {
0040     if(!m_hdl) return 0;
0041     return m_hdl->object();
0042   }
0043   const std::string& cls() const {return m_class;}
0044   const std::string& path() const {return m_path;}
0045   const std::string& name() const {return m_name;}
0046   void disown() {if(m_hdl) m_hdl->disown();}
0047 protected:
0048   base_handle* m_hdl;
0049   std::string m_class;
0050   std::string m_path;
0051   std::string m_name;
0052 };
0053 
0054 }
0055 
0056 
0057 #endif