g4tools  5.4.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::raxml Class Reference
Inheritance diagram for tools::raxml:
Inheritance graph
[legend]
Collaboration diagram for tools::raxml:
Collaboration graph
[legend]

Public Member Functions

 raxml (tools::xml::factory &a_fac, std::ostream &a_out, bool a_verbose=false)
 
virtual ~raxml ()
 
void set_read_tag (void *a_tag)
 
bool load_file (const std::string &a_file, bool a_compressed)
 
- Public Member Functions inherited from tools::xml::aidas
 aidas ()
 
virtual ~aidas ()
 
std::vector< raxml_out > & objects ()
 
- Public Member Functions inherited from tools::xml::loader
 loader (tools::xml::factory &a_factory, std::ostream &a_out, bool a_verbose=false)
 
virtual ~loader ()
 
virtual bool visit_end_element (tools::xml::tree &, bool &a_keep)
 
void set_take_cntrl_chars (bool a_value)
 
std::ostream & out () const
 
void set_compressed_reader (tools::file::reader *aReader)
 
unsigned int errors () const
 
void set_tags (const std::vector< std::string > &a_tags)
 
void add_tag (const std::string &a_tag)
 
bool load_file (const std::string &a_file, bool a_compressed)
 
bool load_string (const std::string &a_string)
 
bool load_buffer (size_t aSize, const char *aBuffer)
 
const tools::xml::treetop_item () const
 
tools::xml::treetop_item ()
 
void empty ()
 
bool is_tag (const std::string &a_string) const
 

Protected Member Functions

 raxml (const raxml &a_from)
 
raxmloperator= (const raxml &a_from)
 
- Protected Member Functions inherited from tools::xml::aidas
 aidas (const aidas &)
 
aidasoperator= (const aidas &)
 
void clear_readers ()
 
void add_reader (const std::string &a_class, reader a_reader, bool a_check=false)
 
reader find_reader (const std::string &a_class) const
 
void set_default_tags (std::vector< std::string > &a_tags)
 
void add_default_readers ()
 
- Protected Member Functions inherited from tools::xml::loader
 loader (const loader &a_from)
 
loaderoperator= (const loader &a_from)
 
void clear ()
 
bool parse_buffer (size_t aSize, const char *aBuffer, XML_StartElementHandler a_start, XML_EndElementHandler a_end, void *a_tag)
 
bool parse_file (const std::string &a_file, XML_StartElementHandler a_start, XML_EndElementHandler a_end, void *a_tag, bool a_compressed)
 

Protected Attributes

void * m_read_tag
 
- Protected Attributes inherited from tools::xml::aidas
readers m_readers
 
std::vector< raxml_outm_objects
 
- Protected Attributes inherited from tools::xml::loader
tools::xml::factorym_factory
 
std::ostream & m_out
 
bool m_verbose
 
bool m_take_cntrl
 
unsigned int m_errors
 
std::vector< std::string > m_tags
 
tools::xml::treem_top
 
tools::xml::treem_current
 
std::vector< std::pair< std::string, std::string > > m_atbs
 
std::string m_value
 
tools::file::readerm_compressed_reader
 
unsigned int m_depth
 
bool m_abort
 

Additional Inherited Members

- Public Types inherited from tools::xml::aidas
typedef raxml_out(* reader) (tree &, std::ostream &, bool, void *)
 
typedef std::map< std::string, readerreaders
 
- Static Public Member Functions inherited from tools::xml::aidas
static raxml_out read_histo (tree &a_tree, std::ostream &a_out, bool a_verbose, unsigned int a_dim, bool a_is_prof)
 
static raxml_out read_cloud (tree &a_tree, std::ostream &a_out, bool a_verbose, int a_dim)
 
- Protected Types inherited from tools::xml::aidas
typedef histo::axis< double, unsigned int >::bn_t bn_t
 
typedef histo::profile_data< double, unsigned int, unsigned int, double, double > pd_data
 
- Static Protected Member Functions inherited from tools::xml::aidas
static raxml_out read_h1d (tree &a_tree, std::ostream &a_out, bool a_verbose, void *)
 
static raxml_out read_h2d (tree &a_tree, std::ostream &a_out, bool a_verbose, void *)
 
static raxml_out read_h3d (tree &a_tree, std::ostream &a_out, bool a_verbose, void *)
 
static raxml_out read_p1d (tree &a_tree, std::ostream &a_out, bool a_verbose, void *)
 
static raxml_out read_p2d (tree &a_tree, std::ostream &a_out, bool a_verbose, void *)
 
static raxml_out read_cloud1d (tree &a_tree, std::ostream &a_out, bool a_verbose, void *)
 
static raxml_out read_cloud2d (tree &a_tree, std::ostream &a_out, bool a_verbose, void *)
 
static raxml_out read_cloud3d (tree &a_tree, std::ostream &a_out, bool a_verbose, void *)
 
static raxml_out read_dps (tree &a_tree, std::ostream &a_out, bool a_verbose, void *)
 
static bool read_axis (tree &a_tree, unsigned int a_dim, int &aAxis, bn_t &aNumberOfBins, double &aMin, double &aMax, std::vector< double > &aEdges, bool &aVariableBins, std::ostream &)
 read histo //////////////////////////////////////////////// More...
 
static bool to_double (const std::string &a_s, double &a_v, std::ostream &a_out, const std::string &a_what)
 
static bool read_bins (tree &a_tree, pd_data &aData, std::ostream &a_out, bool a_is_prof)
 
static bool axis_index (unsigned int a_dim, const std::string &a_axis, int &a_index)
 
static bool read_ntu_columns (tree &a_tree, bool &a_found, std::vector< colbook > &a_booking, std::ostream &a_out)
 
static bool read_ntu_rows (tree &a_tree, aida::base_ntu &a_ntu, bool &a_found, std::ostream &a_out)
 
static raxml_out read_ntu (tree &a_tree, std::ostream &a_out, bool a_verbose, void *)
 
static bool read_cloud_data (tree &a_tree, histo::c1d &aCloud, bool a_verbose, std::ostream &a_out)
 read cloud //////////////////////////////////////////////// More...
 
static bool read_cloud_data (tree &a_tree, histo::c2d &aCloud, bool a_verbose, std::ostream &a_out)
 
static bool read_cloud_data (tree &a_tree, histo::c3d &aCloud, bool a_verbose, std::ostream &a_out)
 
static bool read_dps_data (tree &a_tree, histo::dps &a_dps)
 
- Static Protected Member Functions inherited from tools::xml::loader
static void character_data_handler (void *aUserData, const XML_Char *a_string, int aLength)
 
static void start_element (void *aUserData, const XML_Char *a_name, const XML_Char **a_atbs)
 
static void end_element (void *aUserData, const XML_Char *a_name)
 

Detailed Description

Definition at line 13 of file raxml.

Constructor & Destructor Documentation

◆ raxml() [1/2]

tools::raxml::raxml ( tools::xml::factory a_fac,
std::ostream &  a_out,
bool  a_verbose = false 
)
inline

Definition at line 17 of file raxml.

18  :parent_aidas()
19  ,parent(a_fac,a_out,a_verbose)
20  ,m_read_tag(0)
21  {
23  }

◆ ~raxml()

virtual tools::raxml::~raxml ( )
inlinevirtual

Definition at line 24 of file raxml.

24 {}

◆ raxml() [2/2]

tools::raxml::raxml ( const raxml a_from)
inlineprotected

Definition at line 28 of file raxml.

29  :parent_aidas(a_from)
30  ,parent(a_from)
31  {}

Member Function Documentation

◆ load_file()

bool tools::raxml::load_file ( const std::string &  a_file,
bool  a_compressed 
)
inline

Definition at line 38 of file raxml.

38  {
39  m_objects.clear();
40  if(!parent::load_file(a_file,a_compressed)) return false;
42  if(!top) return false;
43  const std::string& tag_name = top->tag_name();
44  if(tag_name!=s_aida()) return false;
45 
46  {tools::xml::looper _for(*top);
47  while(tools::xml::tree* _tree = _for.next_tree()) {
48 
49  const std::string& _tag_name = _tree->tag_name();
50  reader rder = find_reader(_tag_name);
51  if(!rder) {
52  m_out << "tools::raxml::load_file :"
53  << " reader not found for " << tools::sout(_tag_name)
54  << std::endl;
55  //m_objects.clear(); //keep already loaded objects.
56  return false;
57  } else {
58  tools::raxml_out ro = rder(*_tree,m_out,m_verbose,m_read_tag);
59  if(ro.object()) m_objects.push_back(ro);
60  }
61 
62  }}
63 
64  return true;
65  }

◆ operator=()

raxml& tools::raxml::operator= ( const raxml a_from)
inlineprotected

Definition at line 32 of file raxml.

32  {
34  parent::operator=(a_from);
35  return *this;
36  }

◆ set_read_tag()

void tools::raxml::set_read_tag ( void *  a_tag)
inline

Definition at line 26 of file raxml.

26 {m_read_tag = a_tag;}

Member Data Documentation

◆ m_read_tag

void* tools::raxml::m_read_tag
protected

Definition at line 67 of file raxml.


The documentation for this class was generated from the following file:
tools::xml::loader::operator=
loader & operator=(const loader &a_from)
Definition: loader:92
tools::xml::aidas::find_reader
reader find_reader(const std::string &a_class) const
Definition: aidas:58
tools::xml::loader::m_verbose
bool m_verbose
Definition: loader:566
tools::raxml_out
Definition: raxml_out:11
tools::xml::loader::m_out
std::ostream & m_out
Definition: loader:564
tools::raxml_out::object
void * object() const
Definition: raxml_out:39
tools::xml::loader::m_tags
std::vector< std::string > m_tags
Definition: loader:569
tools::sg::top
@ top
Definition: enums:82
tools::xml::looper
Definition: tree:956
tools::xml::aidas::reader
raxml_out(* reader)(tree &, std::ostream &, bool, void *)
Definition: aidas:34
tools::raxml::m_read_tag
void * m_read_tag
Definition: raxml:67
tools::sout
Definition: sout:17
tools::xml::loader::load_file
bool load_file(const std::string &a_file, bool a_compressed)
Definition: loader:128
tools::xml::tree
Definition: tree:47
tools::xml::aidas::operator=
aidas & operator=(const aidas &)
Definition: aidas:46
tools::xml::aidas::set_default_tags
void set_default_tags(std::vector< std::string > &a_tags)
Definition: aidas:137
tools::xml::aidas::m_objects
std::vector< raxml_out > m_objects
Definition: aidas:1506
tools::xml::loader::top_item
const tools::xml::tree * top_item() const
Definition: loader:165