Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

SPARK::Problem::DynamicBuild Namespace Reference

Definition of the functions used to load a SPARK problem at runtime. More...


Functions

void ParseCommandLine (unsigned argc, char **argv, char *&runFileName, char *&prfFileName, char *&xmlFileName) throw (SPARK::XInitialization)
 Parses up to argc command-line arguments in argv[] to produce the name of the files with extensions "*.run", "*.prf" and "*.xml" as needed to run a problem loaded at runtime.

void ShowCommandLineUsage (std::ostream &os)
 Writes command-line usage of stand-alone SPARK engine for a problem loaded at runtime to output stream os.

bool Load (const char *pbName, const char *xmlFileName)
 Loads the problem named "pbName" at runtime and sets name of problem instance after unique identifier "pbName".


Detailed Description

Definition of the functions used to load a SPARK problem at runtime.

These API functions are used to implement the driver function of the stand-alone SPARK engine.


Function Documentation

void ParseCommandLine unsigned  argc,
char **  argv,
char *&  runFileName,
char *&  prfFileName,
char *&  xmlFileName
throw (SPARK::XInitialization)
 

Parses up to argc command-line arguments in argv[] to produce the name of the files with extensions "*.run", "*.prf" and "*.xml" as needed to run a problem loaded at runtime.

Note:
No memory is allocated for the 3 strings passed in the argument list. Upon returning from this function, the char*& are pointing to the entries in argv[] that contain the corresponding file names with the correct extensions.
Parameters:
argc first argument of the main() function declared in the "main.cpp" file
argv second argument of the main() function declared in the "main.cpp" file
runFileName points to argv[] with name of the file with extension "*.run"
prfFileName points to argv[] with name of the file with extension "*.prf"
xmlFileName points to argv[] with name of the file with extension "*.xml"
Exceptions:
SPARK::XInitialization Thrown if more than one *.run or *.prf or *.xml file is detected at the command-line.
Examples:
sparksolver.cpp.

void ShowCommandLineUsage std::ostream &  os  ) 
 

Writes command-line usage of stand-alone SPARK engine for a problem loaded at runtime to output stream os.

Parameters:
os output stream where to write the command-line usage

bool Load const char *  pbName,
const char *  xmlFileName
 

Loads the problem named "pbName" at runtime and sets name of problem instance after unique identifier "pbName".

Returns:
True if operation was successful, false otherwise.
Parameters:
pbName the unique name for this instance of the problem
xmlFileName name of the xml file with the problem description
Postcondition:
If the problem was loaded successfully, then the SPARK::TProblem instance is stored in the global problem repository with its name for later retrieval through a call to SPARK::Problem::Get().

Furthermore, if the problem was loaded successfully using the runtime loading mechanism, then the problem factory used to construct the problem is stored in the factory repository to support garbage collection upon the call to the function SPARK::End().

Examples:
multiproblem_example1.cpp, and sparksolver.cpp.


Generated on 5 Nov 2003 for VisualSPARK 2.01