Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

IDEA::AgentCommandLineParser Class Reference
[Agent handle classes]

Defines the (optional) command line options of an IDEA agent. More...

#include <AgentCommandLineParser.hh>

Inheritance diagram for IDEA::AgentCommandLineParser:

IDEA::CommandLineParser List of all members.

Public Methods

 AgentCommandLineParser ()
 Constructor.

virtual ~AgentCommandLineParser ()
 Destructor.

bool getModulesFiles (StringList &name) const
 Returns true if it can retrieve a list of module files we want to load before we create and initialize an agent.

bool getModulesFilesPostInit (StringList &names) const
 Returns true if it can retrieve a list of module files we want to load after we create and initialize an agent. These modules are modules which require for example the ReactivePlanner to be initialized (accessable via TheAgentRelay::instance()->getReactivePlanner() ).

bool getInitialStateFileName (std::string &name) const
 Returns true if it can retrieve an initial state file name from the command line options otherwise returns false. The actual retrieved value will be stored in the argument.

bool getOutputLevel (Trace::OutputLevel &level) const
 Returns true if it can retrieve an output level from the command line options otherwise returns false. The actual retrieved value will be stored in the argument.

bool getPoolName (std::string &name) const
 Returns true if it can retrieve a pool name from the command line options otherwise returns false. The actual retrieved value will be stored in the argument.

bool getXIDDLFileName (std::string &name) const
 Returns true if it can retrieve an XIDDL file name from the command line options otherwise returns false. The actual retrieved value will be stored in the argument.

bool getOutputFilterFileName (std::string &name) const
void usage (std::ostream &os) const
 Streams the usage of each option registered to the invoking class to os.

bool verify ()
 Returns true if all mandatory options are in the argv char array passed in the constructor (does not do type checking of the arguments). Otherwise returns false.


Protected Methods

bool getOption (int shortOptionChar, std::string &value) const
 Returns true if a commandline option shortOptionChar is present in argv char array and will populate value with the value if the commandline option has an argument. Otherwise will return false.

bool getOptions (int shortOptionChar, StringList &value) const
 Returns true if at least one commandline option shortOptionChar is present in argv char array and will populate value with all the values if the commandline option has an argument. Otherwise will return false.

bool registerOption (int shortOptionChar, bool hasArgument, bool mandatory, const std::string &usage, const StringList &possibleArguments=StringList())
 Registers the command-line option shortOptionChar have an argument if hasArgument is true, must be passed as an argumen if mandatory is true (see verify() ), with usage string usage (see usage() ) and if provided limited to the possible arguments possibleArguments.


Detailed Description

Defines the (optional) command line options of an IDEA agent.

Author:
David Rijsman rijsman@email.arc.nasa.gov


Constructor & Destructor Documentation

IDEA::AgentCommandLineParser::AgentCommandLineParser  
 

Constructor.

IDEA::AgentCommandLineParser::~AgentCommandLineParser   [virtual]
 

Destructor.


Member Function Documentation

bool IDEA::AgentCommandLineParser::getInitialStateFileName std::string &    name const
 

Returns true if it can retrieve an initial state file name from the command line options otherwise returns false. The actual retrieved value will be stored in the argument.

bool IDEA::AgentCommandLineParser::getModulesFiles StringList   name const
 

Returns true if it can retrieve a list of module files we want to load before we create and initialize an agent.

bool IDEA::AgentCommandLineParser::getModulesFilesPostInit StringList   names const
 

Returns true if it can retrieve a list of module files we want to load after we create and initialize an agent. These modules are modules which require for example the ReactivePlanner to be initialized (accessable via TheAgentRelay::instance()->getReactivePlanner() ).

bool IDEA::CommandLineParser::getOption int    shortOptionChar,
std::string &    value
const [protected, inherited]
 

Returns true if a commandline option shortOptionChar is present in argv char array and will populate value with the value if the commandline option has an argument. Otherwise will return false.

bool IDEA::CommandLineParser::getOptions int    shortOptionChar,
StringList   value
const [protected, inherited]
 

Returns true if at least one commandline option shortOptionChar is present in argv char array and will populate value with all the values if the commandline option has an argument. Otherwise will return false.

bool IDEA::AgentCommandLineParser::getOutputFilterFileName std::string &    name const
 

Returns true if it can retrieve an output filter file name from the command line options otherwise returns false. The actual retrieved value will be stored in the argument.

bool IDEA::AgentCommandLineParser::getOutputLevel Trace::OutputLevel   level const
 

Returns true if it can retrieve an output level from the command line options otherwise returns false. The actual retrieved value will be stored in the argument.

bool IDEA::AgentCommandLineParser::getPoolName std::string &    name const
 

Returns true if it can retrieve a pool name from the command line options otherwise returns false. The actual retrieved value will be stored in the argument.

bool IDEA::AgentCommandLineParser::getXIDDLFileName std::string &    name const
 

Returns true if it can retrieve an XIDDL file name from the command line options otherwise returns false. The actual retrieved value will be stored in the argument.

bool IDEA::CommandLineParser::registerOption int    shortOptionChar,
bool    hasArgument,
bool    mandatory,
const std::string &    usage,
const StringList   possibleArguments = StringList()
[protected, inherited]
 

Registers the command-line option shortOptionChar have an argument if hasArgument is true, must be passed as an argumen if mandatory is true (see verify() ), with usage string usage (see usage() ) and if provided limited to the possible arguments possibleArguments.

Will return true if arguments passed to this method can be accepted otherwise false. Command-line options can not be accepted if:

  • A command-line option with shortOptionChar already exists
  • hasArgument is true and possibleArguments is not empty

void IDEA::CommandLineParser::usage std::ostream &    os const [inherited]
 

Streams the usage of each option registered to the invoking class to os.

bool IDEA::CommandLineParser::verify   [inherited]
 

Returns true if all mandatory options are in the argv char array passed in the constructor (does not do type checking of the arguments). Otherwise returns false.


Contact information
© IDEA
Generated on Fri Feb 3 17:09:44 2006 for IDEA.