Back to index

salome-kernel  6.5.0
Public Member Functions | Private Attributes
SALOME_Launcher_Handler Class Reference

#include <SALOME_Launcher_Handler.hxx>

Collaboration diagram for SALOME_Launcher_Handler:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SALOME_Launcher_Handler (ParserLauncherType &launch)
 Constructor.
virtual ~SALOME_Launcher_Handler ()
 Destructor.
const ParserLauncherTypeGetLauncherAfterParsing () const
 Retrieves DS after the file parse.
void ProcessXmlDocument (xmlDocPtr theDoc)
 Processes XML document and fills the list of resources.

Private Attributes

ParserLauncherType_launch
MachineParameters _machp
const char * test_machine_list
const char * test_main
const char * test_machine
const char * test_env_file
const char * test_work_directory
const char * test_ref_directory
const char * test_nb_processes
const char * test_input_file
const char * test_output_file
const char * test_command

Detailed Description

Definition at line 39 of file SALOME_Launcher_Handler.hxx.


Constructor & Destructor Documentation

Constructor.

Parameters:
listOfResources,:map of ParserResourcesType to fill when parsing

Definition at line 40 of file SALOME_Launcher_Handler.cxx.

                                                                          :
    _launch(launch)
{
  //XML tags initialisation
  test_machine_list = "machine-list";
  test_main = "main";

  test_machine = "machine";
  test_env_file = "env-file";
  test_work_directory = "work-directory";
  test_ref_directory = "ref-directory";
  test_nb_processes = "nb-processes";
  test_input_file = "input-file";
  test_output_file = "output-file";
  test_command = "command";

}

Destructor.

Definition at line 64 of file SALOME_Launcher_Handler.cxx.

{
  //  cout << "SALOME_Launcher_Handler destruction") << endl;
}

Member Function Documentation

Retrieves DS after the file parse.

Definition at line 76 of file SALOME_Launcher_Handler.cxx.

{
  return _launch;
}
void SALOME_Launcher_Handler::ProcessXmlDocument ( xmlDocPtr  theDoc)

Processes XML document and fills the list of resources.

Definition at line 87 of file SALOME_Launcher_Handler.cxx.

{
//   if (MYDEBUG) cout << "Begin parse document" << endl;

  // Empty private elements
  _launch.Clear();

  // Get the document root node
  xmlNodePtr aCurNode = xmlDocGetRootElement(theDoc);

  aCurNode = aCurNode->xmlChildrenNode;
  
  // Processing the document nodes
  while(aCurNode != NULL){
    if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_machine_list) ){
      xmlNodePtr aCurNode2 = aCurNode->xmlChildrenNode;
      while(aCurNode2 != NULL){
        if ( !xmlStrcmp(aCurNode2->name,(const xmlChar*)test_machine) ){
          _machp.Clear();
          xmlChar* name = xmlNodeGetContent(aCurNode2);
          std::string clusterName = (const char*)name;
          xmlFree(name);
        
          if (xmlHasProp(aCurNode2, (const xmlChar*)test_env_file)){
            xmlChar* envfile = xmlGetProp(aCurNode2, (const xmlChar*)test_env_file);
            _machp.EnvFile = (const char*)envfile;
            xmlFree(envfile);
          }

          if (xmlHasProp(aCurNode2, (const xmlChar*)test_work_directory)){
            xmlChar* workdirectory = xmlGetProp(aCurNode2, (const xmlChar*)test_work_directory);
            _machp.WorkDirectory = (const char*)workdirectory;
            xmlFree(workdirectory);
          }
          _launch.MachinesList[clusterName]=_machp ;
        }
        aCurNode2 = aCurNode2->next;
      }
    }

    if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_ref_directory) ){
      xmlChar* refdirectory = xmlNodeGetContent(aCurNode);
      _launch.RefDirectory = (const char*)refdirectory;
      xmlFree(refdirectory);
    }
          
    if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_nb_processes) ){
      xmlChar* nbofprocesses = xmlNodeGetContent(aCurNode);
      _launch.NbOfProcesses = atoi((const char*)nbofprocesses);
      xmlFree(nbofprocesses);
    }
          
    if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_input_file) ){
      xmlChar* inputfile = xmlNodeGetContent(aCurNode);
      _launch.InputFile.push_back((const char*)inputfile);
      xmlFree(inputfile);
    }
          
    if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_output_file) ){
      xmlChar* outputfile = xmlNodeGetContent(aCurNode);
      _launch.OutputFile.push_back((const char*)outputfile);
      xmlFree(outputfile);
    }
          
    if ( !xmlStrcmp(aCurNode->name,(const xmlChar*)test_command) ){
      xmlChar* command = xmlNodeGetContent(aCurNode);
      _launch.Command = (const char*)command;
      xmlFree(command);
    }
          
    aCurNode = aCurNode->next;
  }

}

Here is the call graph for this function:


Member Data Documentation

Definition at line 52 of file SALOME_Launcher_Handler.hxx.

Definition at line 53 of file SALOME_Launcher_Handler.hxx.

Definition at line 65 of file SALOME_Launcher_Handler.hxx.

Definition at line 59 of file SALOME_Launcher_Handler.hxx.

Definition at line 63 of file SALOME_Launcher_Handler.hxx.

Definition at line 58 of file SALOME_Launcher_Handler.hxx.

Definition at line 55 of file SALOME_Launcher_Handler.hxx.

const char* SALOME_Launcher_Handler::test_main [private]

Definition at line 56 of file SALOME_Launcher_Handler.hxx.

Definition at line 62 of file SALOME_Launcher_Handler.hxx.

Definition at line 64 of file SALOME_Launcher_Handler.hxx.

Definition at line 61 of file SALOME_Launcher_Handler.hxx.

Definition at line 60 of file SALOME_Launcher_Handler.hxx.


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