aGrUM  0.16.0
BIFXMLBNReader.h
Go to the documentation of this file.
1 
71 #ifndef GUM_BIF_XML_BN_READER_H
72 #define GUM_BIF_XML_BN_READER_H
73 
74 #define TIXML_USE_TICPP
75 
76 #include <list>
77 #include <sstream>
78 #include <string>
79 
80 #include <agrum/BN/io/BNReader.h>
81 #include <agrum/agrum.h>
86 
87 namespace gum {
88 
101  template < typename GUM_SCALAR >
102  class BIFXMLBNReader : BNReader< GUM_SCALAR > {
103  public:
109  BIFXMLBNReader(BayesNet< GUM_SCALAR >* bn, const std::string& filePath);
110 
114  ~BIFXMLBNReader() final;
115 
122  Size proceed() final;
123 
129  typename gum::Signaler2< int, std::string > onProceed;
130 
131  private:
135  void __parsingVariables(ticpp::Element* parentNetwork);
136 
140  void __fillingBN(ticpp::Element* parentNetwork);
141 
147 
151  std::string __filePath;
152  };
153 
154 
155 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
156  extern template class BIFXMLBNReader< double >;
157 #endif
158 
159 } /* namespace gum */
160 
162 
163 #endif // GUM_BIF_XML_BN_READER_H
Class representing a Bayesian Network.
Definition: BayesNet.h:78
void __parsingVariables(ticpp::Element *parentNetwork)
Parsing xml element containing data on variables.
Wrapper around TiXmlElement.
Definition: ticpp.h:1493
BayesNet< GUM_SCALAR > * __bn
An handle to the bayes net in which will be load the content of the xml filePath. ...
std::string __filePath
the path to the xml filePath
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
Pure virtual class for reading a BN from a file.
Definition: BNReader.h:55
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void __fillingBN(ticpp::Element *parentNetwork)
fill the diagram
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
<agrum/BN/io/BIFXML/BIFXMLBNReader.h>
gum::Signaler2< int, std::string > onProceed
Signaler used to indicates how many percent of the Xml files have been parsed yet.
Size proceed() final
Reads the bayes net from the file referenced by filePath given at the creation of class...
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition: types.h:48
BIFXMLBNReader(BayesNet< GUM_SCALAR > *bn, const std::string &filePath)
Constructor A reader is created to reading a defined file.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
~BIFXMLBNReader() final
Default destructor.