Version: 8.3.0
YACS::ENGINE::stateParser Class Reference

specialized parser to load SALOME execution saved states. More...

#include <LoadState.hxx>

Inheritance diagram for YACS::ENGINE::stateParser:
Collaboration diagram for YACS::ENGINE::stateParser:

Public Member Functions

virtual void init (const xmlChar **p, xmlParserBase *father=0)
 
- Public Member Functions inherited from xmlParserBase
void setAttribute (std::string key, std::string value)
 
std::string getAttribute (std::string key)
 
virtual void addData (std::string value)
 

Static Public Member Functions

static void setProc (Proc *p)
 
static void setRuntime (Runtime *runtime)
 
- Static Public Member Functions inherited from xmlParserBase
static void XMLCALL start_document (void *userData)
 
static void XMLCALL end_document (void *userData)
 
static void XMLCALL start_element (void *userData, const xmlChar *name, const xmlChar **p)
 
static void XMLCALL end_element (void *userData, const xmlChar *name)
 
static void XMLCALL characters (void *userData, const xmlChar *ch, int len)
 
static void XMLCALL comment (void *userData, const xmlChar *value)
 
static void XMLCALL warning (void *userData, const char *fmt,...)
 
static void XMLCALL error (void *userData, const char *fmt,...)
 
static void XMLCALL fatal_error (void *userData, const char *fmt,...)
 
static void XMLCALL cdata_block (void *userData, const xmlChar *value, int len)
 
static void cleanGarbage ()
 
static int getGarbageSize ()
 
static void XML_SetUserData (_xmlParserCtxt *ctxt, xmlParserBase *parser)
 

Static Public Attributes

static XMLReadState _state
 
static std::string _what
 
- Static Public Attributes inherited from xmlParserBase
static _xmlParserCtxt * _xmlParser
 
static std::stack
< xmlParserBase * > 
_stackParser
 

Protected Member Functions

virtual void onStart (const XML_Char *elem, const xmlChar **p)
 
virtual void onEnd (const XML_Char *name)
 
virtual void charData (std::string data)
 
- Protected Member Functions inherited from xmlParserBase
void getAttributes (const xmlChar **p)
 
virtual void onStart (const XML_Char *elem, const xmlChar **p)
 
virtual void onEnd (const XML_Char *name)
 
virtual void incrCount (const XML_Char *elem)
 
virtual void end ()
 
virtual void stopParse (std::string what)
 

Static Protected Attributes

static std::stack< XMLReadState_stackState
 
static Proc_p
 
static Runtime_runtime
 
static std::map< std::string,
YACS::StatesForNode
_nodeStateValue
 
static std::map< std::string,
YACS::StatesForNode
_nodeStates
 
- Static Protected Attributes inherited from xmlParserBase
static std::list< xmlParserBase * > _garbage
 

Additional Inherited Members

- Public Attributes inherited from xmlParserBase
std::map< std::string, int > counts
 
- Protected Attributes inherited from xmlParserBase
std::map< std::string,
std::string > 
_mapAttrib
 
std::string _data
 
xmlParserBase_father
 

Detailed Description

specialized parser to load SALOME execution saved states.

this base class must be derived to build specific parsers for each tag defined in the xml file

Definition at line 80 of file LoadState.hxx.

Member Function Documentation

void stateParser::charData ( std::string  data)
protectedvirtual

to be specialized following the kind of xml tag

Reimplemented from xmlParserBase.

Reimplemented in YACS::ENGINE::sampleParser, YACS::ENGINE::loopPortParser, YACS::ENGINE::simpleTypeParser, and YACS::ENGINE::attrParser.

Definition at line 119 of file LoadState.cxx.

120 {
121  //cerr << "data " << data << endl;
122 }
void stateParser::init ( const xmlChar **  p,
xmlParserBase father = 0 
)
virtual

all parsers must know their father parser (father tag), in order to set values or attributes in father.

Reimplemented from xmlParserBase.

Reimplemented in YACS::ENGINE::sampleParser, outputParser, YACS::ENGINE::loopPortParser, YACS::ENGINE::simpleTypeParser, YACS::ENGINE::dataParser, YACS::ENGINE::arrayParser, YACS::ENGINE::valueParser, YACS::ENGINE::portParser, YACS::ENGINE::attrParser, YACS::ENGINE::nodeParser, and YACS::ENGINE::graphParser.

Definition at line 65 of file LoadState.cxx.

References YACS::ACTIVATED, DEBTRACE, YACS::DESACTIVATED, YACS::DISABLED, YACS::DONE, YACS::ERROR, YACS::EXECFAILED, YACS::FAILED, YACS::INTERNALERR, YACS::LOADED, YACS::LOADFAILED, YACS::PAUSE, YACS::READY, YACS::SUSPENDED, YACS::TOACTIVATE, YACS::TOLOAD, and YACS::ENGINE::XMLNOCONTEXT.

Referenced by onStart(), YACS::ENGINE::graphParser::onStart(), YACS::ENGINE::nodeParser::onStart(), YACS::ENGINE::portParser::onStart(), YACS::ENGINE::valueParser::onStart(), YACS::ENGINE::arrayParser::onStart(), YACS::ENGINE::dataParser::onStart(), YACS::ENGINE::loopPortParser::onStart(), outputParser::onStart(), and YACS::ENGINE::sampleParser::onStart().

66 {
67  DEBTRACE("stateParser::init()");
69  _father = father;
70  _stackState.push(_state);
71  _nodeStateValue["READY"] =YACS::READY;
72  _nodeStateValue["TOLOAD"] =YACS::TOLOAD;
73  _nodeStateValue["LOADED"] =YACS::LOADED;
74  _nodeStateValue["TOACTIVATE"] =YACS::TOACTIVATE;
75  _nodeStateValue["ACTIVATED"] =YACS::ACTIVATED;
76  _nodeStateValue["DESACTIVATED"] =YACS::DESACTIVATED;
77  _nodeStateValue["DONE"] =YACS::DONE;
78  _nodeStateValue["SUSPENDED"] =YACS::SUSPENDED;
79  _nodeStateValue["LOADFAILED"] =YACS::LOADFAILED;
80  _nodeStateValue["EXECFAILED"] =YACS::EXECFAILED;
81  _nodeStateValue["PAUSE"] =YACS::PAUSE;
82  _nodeStateValue["INTERNALERR"] =YACS::INTERNALERR;
83  _nodeStateValue["DISABLED"] =YACS::DISABLED;
84  _nodeStateValue["FAILED"] =YACS::FAILED;
85  _nodeStateValue["ERROR"] =YACS::ERROR;
86  _nodeStates.clear();
87 }
void stateParser::onStart ( const XML_Char elem,
const xmlChar **  p 
)
protectedvirtual

Reimplemented in YACS::ENGINE::sampleParser, YACS::ENGINE::loopPortParser, YACS::ENGINE::simpleTypeParser, YACS::ENGINE::dataParser, YACS::ENGINE::arrayParser, YACS::ENGINE::valueParser, YACS::ENGINE::portParser, YACS::ENGINE::attrParser, YACS::ENGINE::nodeParser, and YACS::ENGINE::graphParser.

Definition at line 90 of file LoadState.cxx.

References DEBTRACE, init(), and YACS::ENGINE::XMLFATALERROR.

91 {
92  DEBTRACE("stateParser::onStart");
93  string element(elem);
94  stateParser *parser = 0;
95  if (element == "graphState") parser = new graphParser();
96  else
97  {
98  _what = "expected <graphState>, got <" + element + ">";
100  stopParse(_what);
101  }
102  if (parser)
103  {
104  _stackParser.push(parser);
105  XML_SetUserData(_xmlParser, parser);
106  parser->init(p);
107  }
108 }
void stateParser::setProc ( Proc p)
static

Definition at line 55 of file LoadState.cxx.

References p.

Referenced by YACS::ENGINE::stateLoader::parse().

56 {
57  _p= p;
58 }
void stateParser::setRuntime ( Runtime runtime)
static

Definition at line 60 of file LoadState.cxx.

Referenced by YACS::ENGINE::stateLoader::parse().

61 {
62  _runtime = runtime;
63 }

Member Data Documentation

std::map< std::string, YACS::StatesForNode > stateParser::_nodeStates
staticprotected

Definition at line 102 of file LoadState.hxx.

std::map< std::string, YACS::StatesForNode > stateParser::_nodeStateValue
staticprotected

Definition at line 101 of file LoadState.hxx.

Proc * stateParser::_p
staticprotected

Definition at line 99 of file LoadState.hxx.

Runtime * stateParser::_runtime
staticprotected

Definition at line 100 of file LoadState.hxx.

std::stack< XMLReadState > stateParser::_stackState
staticprotected

Definition at line 98 of file LoadState.hxx.

Referenced by YACS::ENGINE::sampleParser::init().

std::string stateParser::_what
static

The documentation for this class was generated from the following files: