aGrUM  0.14.2
BIFXMLIDReader.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Pierre-Henri WUILLEMIN et Christophe GONZALES *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
70 #ifndef GUM_BIF_XML_ID_READER_H
71 #define GUM_BIF_XML_ID_READER_H
72 
73 #define TIXML_USE_TICPP
74 
75 #include <list>
76 #include <sstream>
77 #include <string>
78 
79 #include <agrum/ID/io/IDReader.h>
80 #include <agrum/agrum.h>
85 
86 namespace gum {
98  template < typename GUM_SCALAR >
99  class BIFXMLIDReader : IDReader< GUM_SCALAR > {
100  public:
107  const std::string& filePath);
108 
112  ~BIFXMLIDReader();
113 
120  virtual void proceed();
121 
127  typename gum::Signaler2< int, std::string > onProceed;
128 
129  private:
133  void __parsingVariables(ticpp::Element* parentNetwork);
134 
138  void __fillingDiagram(ticpp::Element* parentNetwork);
139 
146 
150  std::string __filePath;
151  };
152 
153 } /* namespace gum */
154 
156 
157 #endif // GUM_BIF_XML_ID_READER_H
Wrapper around TiXmlElement.
Definition: ticpp.h:1493
std::string __filePath
the path to the xml filePath
gum::Signaler2< int, std::string > onProceed
Signaler used to indicates how many percent of the Xml files have been parsed yet.
Definition of abstract classes for import of Influence Diagram from a file.
Read an influence diagram from an XML file with BIF format.
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
void __parsingVariables(ticpp::Element *parentNetwork)
Parsing xml element containing data on variables.
void __fillingDiagram(ticpp::Element *parentNetwork)
fill the diagram
BIFXMLIDReader(InfluenceDiagram< GUM_SCALAR > *infdiag, const std::string &filePath)
Constructor A reader is created to reading a defined file.
Classes of signaler.
Class of gum::Signaler2.
InfluenceDiagram< GUM_SCALAR > * __infdiag
An handle to the influence diagram in which will be load the content of the xml filePath.
~BIFXMLIDReader()
Default destructor.
Pure virtual class for importing an ID from a file.
Definition: IDReader.h:49
virtual void proceed()
Reads the influence diagram from the file referenced by filePath given at the creation of class...
Base class for labelized discrete random variables.
Class representing an Influence Diagram.