Version: 8.3.0
YACS::ENGINE::stateLoader Class Reference

class for parse an xml file, use a dedicated parser, to load a saved state of a SALOME execution. More...

#include <LoadState.hxx>

Inheritance diagram for YACS::ENGINE::stateLoader:
Collaboration diagram for YACS::ENGINE::stateLoader:

Public Member Functions

 stateLoader (xmlParserBase *parser, YACS::ENGINE::Proc *p)
 
virtual void parse (std::string xmlState)
 
- Public Member Functions inherited from xmlReader
 xmlReader (xmlParserBase *parser)
 

Protected Attributes

Proc_p
 
Runtime_runtime
 
- Protected Attributes inherited from xmlReader
xmlParserBase_rootParser
 

Detailed Description

class for parse an xml file, use a dedicated parser, to load a saved state of a SALOME execution.

Definition at line 53 of file LoadState.hxx.

Constructor & Destructor Documentation

stateLoader::stateLoader ( xmlParserBase parser,
YACS::ENGINE::Proc p 
)

Definition at line 910 of file LoadState.cxx.

References _p, _runtime, YACS::ENGINE::getRuntime(), and p.

911  : xmlReader(parser)
912 {
913  _runtime = getRuntime();
914  _p = p;
915 }

Member Function Documentation

void stateLoader::parse ( std::string  xmlFile)
virtual

libxml2 parse

Parameters
xmlFilefile to parse

Reimplemented from xmlReader.

Definition at line 917 of file LoadState.cxx.

References _p, xmlReader::_rootParser, _runtime, YACS::ENGINE::stateParser::_state, YACS::ENGINE::stateParser::_what, DEBTRACE, xmlReader::parse(), YACS::ENGINE::stateParser::setProc(), YACS::ENGINE::stateParser::setRuntime(), YACS::ENGINE::XMLDONE, YACS::ENGINE::XMLFATALERROR, and YACS::ENGINE::XMLNOCONTEXT.

Referenced by YACS::ENGINE::loadState(), and main().

918 {
919  DEBTRACE("stateLoader::parse");
920  stateParser *parser = dynamic_cast<stateParser*> (_rootParser);
921  parser->setProc(_p);
922  parser->setRuntime(_runtime);
923 
924  xmlReader::parse(xmlState);
925 
926  DEBTRACE(parser->_state);
927  switch (parser->_state)
928  {
929  case XMLNOCONTEXT:
930  case XMLDONE:
931  {
932  DEBTRACE("parse OK");
933  break;
934  }
935  case XMLFATALERROR:
936  {
937  string what = "Abort Parse: " + parser->_what;
938  throw Exception(what);
939  break;
940  }
941  default:
942  {
943  string what = "Abort Parse: unknown execution problem";
944  throw Exception(what);
945  break;
946  }
947  }
948 }

Member Data Documentation

Proc* YACS::ENGINE::stateLoader::_p
protected

Definition at line 60 of file LoadState.hxx.

Referenced by parse(), and stateLoader().

Runtime* YACS::ENGINE::stateLoader::_runtime
protected

Definition at line 61 of file LoadState.hxx.

Referenced by parse(), and stateLoader().


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