SiGraph: sulcal graphs


mReader.h
Go to the documentation of this file.
1
2#ifndef SI_MODEL_MREADER_H
3#define SI_MODEL_MREADER_H
4
5
6#include <cartobase/object/pythonreader.h>
7#include <si/model/adaptive.h>
10#include <si/graph/treeParser.h>
11
12
13namespace sigraph
14{
15
17 {
18 public:
19 MReader( const std::string & filename,
21 const carto::SyntaxSet & synt = syntax(),
22 const carto::AttributedReader::HelperSet& helpers_ = helpers());
24 const carto::SyntaxSet & synt = syntax(),
25 const carto::AttributedReader::HelperSet& helpers_ = helpers());
26 virtual ~MReader();
27
28 virtual Model* readModel();
29 void addFactory( const std::string & synt, TreePostParser::Factory fact );
34 void aliasFactory( const std::string & dest, const std::string & source );
36
37 static carto::AttributedReader::HelperSet *initHelpers();
38 static carto::PythonReader::HelperSet *initPythonHelpers();
39
40 static carto::PythonReader::HelperSet & python_helpers();
42 static carto::AttributedReader::HelperSet & helpers();
43 static void delete_helpers();
44
45 protected:
46 virtual void parse( Tree* ao );
47 static void buildTop( carto::AttributedObject* parent, Tree* ao,
48 const std::string & filename );
49 static void buildTree( carto::AttributedObject* parent, Tree* ao,
50 const std::string & filename );
51 static void buildLeaf( carto::AttributedObject* parent, Tree* ao,
52 const std::string & filename );
53 static void buildNull( carto::AttributedObject* parent, Tree* ao,
54 const std::string & filename );
55 static void buildConst( carto::AttributedObject* parent, Tree* ao,
56 const std::string & filename );
57 static void parseModel( Model* mod, carto::AttributedObject* parent,
58 Tree* ao );
59 static carto::PythonReader::HelperSet *& python_helpers_p();
60 static carto::AttributedReader::HelperSet *& helpers_p();
62
64 bool _isOpen;
65
66 private:
67 };
68
69}
70
71#endif
72
73
ExoticTreeReader(const std::string &filename, const carto::SyntaxSet &attr, const carto::AttributedReader::HelperSet &helpers=carto::AttributedReader::HelperSet())
void setFactories(const TreePostParser::FactorySet &fs)
static void buildTree(carto::AttributedObject *parent, Tree *ao, const std::string &filename)
virtual ~MReader()
static TreePostParser::FactorySet baseFactorySet()
virtual void parse(Tree *ao)
void addFactories(const TreePostParser::FactorySet &fs)
static void parseModel(Model *mod, carto::AttributedObject *parent, Tree *ao)
static carto::PythonReader::HelperSet & python_helpers()
void aliasFactory(const std::string &dest, const std::string &source)
replace factory dest by source (like dest=source)
TreePostParser::FactorySet _knownElems
Definition mReader.h:63
static carto::AttributedReader::HelperSet *& helpers_p()
const TreePostParser::FactorySet & factories()
static void buildConst(carto::AttributedObject *parent, Tree *ao, const std::string &filename)
static carto::PythonReader::HelperSet *& python_helpers_p()
static carto::SyntaxSet & syntax()
static void buildNull(carto::AttributedObject *parent, Tree *ao, const std::string &filename)
static carto::AttributedReader::HelperSet & helpers()
static carto::AttributedReader::HelperSet * initHelpers()
virtual Model * readModel()
static void buildTop(carto::AttributedObject *parent, Tree *ao, const std::string &filename)
static void buildLeaf(carto::AttributedObject *parent, Tree *ao, const std::string &filename)
MReader(const TreePostParser::FactorySet &fs=baseFactorySet(), const carto::SyntaxSet &synt=syntax(), const carto::AttributedReader::HelperSet &helpers_=helpers())
static void delete_helpers()
MReader(const std::string &filename, const TreePostParser::FactorySet &fs=baseFactorySet(), const carto::SyntaxSet &synt=syntax(), const carto::AttributedReader::HelperSet &helpers_=helpers())
static carto::PythonReader::HelperSet * initPythonHelpers()
static carto::SyntaxSet *& syntax_p()
void addFactory(const std::string &synt, TreePostParser::Factory fact)
Modèle pour l'évaluation de cliques de graphes (classe abstraite).
Definition model.h:26
std::map< std::string, Factory > FactorySet
syntax -> reader
Definition treeParser.h:32
void(* Factory)(carto::AttributedObject *parent, Tree *t, const std::string &filename)
Elements readers (depending on syntax)
Definition treeParser.h:29
SyntaxedObject< PropertySet > AttributedObject
std::map< std::string, Syntax > SyntaxSet