Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GridConversion::DriverProgram Namespace Reference

Encapsulate GridConversion-specific code constructs. More...

Classes

class  DriverProgramComLine
 The ComLineObject for the example programs. More...
 
class  SerialProgram
 Implementation of the basic parts of the serial program example. More...
 

Typedefs

typedef IRAD::Profiler::ProfilerObj ProfilerType
 Convenience type definition for Profiler object. More...
 
typedef std::string StackType
 Convenience type definition for program stack. More...
 
typedef
IRAD::Global::GlobalObj
< StackType, int, ProfilerType
GlobalType
 Convenience type definition for the serial global object. More...
 
typedef DriverProgramComLine ComLineType
 Convenience type definition for the Main comline object. More...
 
typedef IRAD::Global::Program
< GlobalType, ComLineType
SerialProgramType
 Convenience type definition for the serial program. More...
 
typedef
GridConversion::DriverProgram::SerialProgram 
SEProgramType
 Convenience definition for serial program type. More...
 

Functions

template<typename ProgramType >
int Driver (int argc, char *argv[])
 Unified driver for the example programs. More...
 

Detailed Description

Encapsulate GridConversion-specific code constructs.

Based off the example program from IRProject For Example Program: This namespace contains all of the base code constructs that are used in the example programs. These example programs have several features which make them very easy to integrate in composite software systems.

  • Program is entirely encapsulated in program object
  • All screen output is automatically tagged with the program name
  • Common look-and-feel interface
  • Interface functionality allows menu-driven integration

Other convenient features of this API are:

  • Built-in stack tracing for debugging
  • Built-in profiling utilities
  • Advanced command-line handling
  • Built-in parallelism

Typedef Documentation

Convenience type definition for the Main comline object.

Definition at line 134 of file DriverProgram.H.

typedef IRAD::Global::GlobalObj<StackType,int,ProfilerType> GlobalType

Convenience type definition for the serial global object.

The global object encapsulates all of the built-in functionalities for a program. Its interface and implementation are defined in IRAD/include/Global.H

Definition at line 56 of file DriverProgram.H.

typedef IRAD::Profiler::ProfilerObj ProfilerType

Convenience type definition for Profiler object.

Definition at line 44 of file DriverProgram.H.

Convenience definition for serial program type.

Definition at line 608 of file DriverProgram.H.

Convenience type definition for the serial program.

For a detailed description of the program type, see IRAD::Global::Program documentation.

Definition at line 141 of file DriverProgram.H.

typedef std::string StackType

Convenience type definition for program stack.

Definition at line 48 of file DriverProgram.H.

Function Documentation

int GridConversion::DriverProgram::Driver ( int  argc,
char *  argv[] 
)

Unified driver for the example programs.

This driver is exactly the same for both the serial and parallel example programs. It is a direct replacement for main and is responsible for creating the "Program object" and calling its Initialization, Run, and Finalize methods.

Definition at line 572 of file DriverProgram.H.

References SerialProgram::Initialize(), SerialProgram::Run(), and SerialProgram::VerbLevel().

573  {
574  ProgramType MyProgram(argc,argv);
575  int retval = MyProgram.Initialize();
576  if(retval){
577  if(retval > 0){ // then there was an error
578  MyProgram.ErrOut("Error in Program Initialization.\n");
579  return(1);
580  }
581  else return(0); // no error, but the program should not continue
582  }
583  if(MyProgram.VerbLevel() > 1)
584  MyProgram.StdOut("Calling RUN.\n");
585  if(MyProgram.Run()){
586  MyProgram.ErrOut("Error in Program RUN method.\n");
587  return(1);
588  }
589  if(MyProgram.VerbLevel() > 1){
590  std::ostringstream Ostr;
591  MyProgram.Report(Ostr);
592  MyProgram.StdOut(Ostr.str());
593  MyProgram.StdOut("Calling Finalize.\n");
594  }
595  if(MyProgram.Finalize()){
596  MyProgram.ErrOut("Error in Program Finalization.\n");
597  return(1);
598  }
599  if(MyProgram.VerbLevel() > 1)
600  MyProgram.StdOut("All done.\n");
601  return(0);
602  }
Implementation of the basic parts of the serial program example.

Here is the call graph for this function: