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

SPARK::Problem::StaticBuild Namespace Reference

Definition of the functions used to load a statically-built SPARK problem. More...


Functions

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

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

bool Load (const char *pbName)
 Loads the statically-built problem named "pbName".


Detailed Description

Definition of the functions used to load a statically-built SPARK problem.

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
throw (SPARK::XInitialization)
 

Parses up to argc command-line arguments in argv[] to produce the names of the files with extensions "*.run" and "*.prf" as needed to run a statically-built problem.

This function is used to extract the names of the *.run and *.prf files at the command line as required by a statically-built simulator, i.e. a simulator that does not need the *.xml file to load the problem description as it is compiled and linked along the driver function.

Note:
No memory is allocated for the 2 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"
Exceptions:
SPARK::XInitialization Thrown if more than one *.run or *.prf 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 statically-built problem to output stream os.

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

bool Load const char *  pbName  ) 
 

Loads the statically-built problem named "pbName".

By statically-built problem, we refer to a problem whose definition is compiled from the corresponding "problem.cpp" file and linked along with the solver library and driver function.

Returns:
True if operation was successful, false otherwise.
Parameters:
pbName the unique name for this instance of the problem
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().
Examples:
sparksolver.cpp.


Generated on 5 Nov 2003 for VisualSPARK 2.01