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

# Xabsl2Option Class Reference

Represents a single option written in Xabsl2. More...

`#include <Xabsl2Option.h>`

Inheritance diagram for Xabsl2Option:

[legend]
Collaboration diagram for Xabsl2Option:

[legend]
List of all members.

## Public Member Functions
| Xabsl2Option (const char *name, Xabsl2InputSource &input, Xabsl2ErrorHandler &errorHandler, unsigned long(*pTimeFunction)())
| Constructor.
| ~Xabsl2Option ()
| Destructor.
void | create (Xabsl2InputSource &input, Xabsl2Array< Xabsl2Option * > &options, Xabsl2Array< Xabsl2BasicBehavior & > &basicBehaviors, Xabsl2Symbols &symbols)
| Creates the option and it's states from the intermediate code.
void | execute ()
| Executes the option.
bool | getOptionReachedATargetState () const
| Returns wheter the option reached a target state.
## Public Attributes
Xabsl2Array< double > | parameters
| The parameters of the option.
Xabsl2Array< Xabsl2State * > | states
| The states of the option.
Xabsl2State * | activeState
| A pointer to the active state.
bool | optionIsActive
| the option is activated in the current path through the option graph
bool | optionWasActive
| the option was activated in the last path trough the option graph
unsigned long | timeOfOptionExecution
| the time how long the option is already active
## Private Attributes
unsigned long | timeWhenOptionWasActivated
| The time, when the option was activated.
Xabsl2State * | initialState
| A pointer to the initial state.
Xabsl2ErrorHandler & | errorHandler
| Used for error handling.
unsigned long(* | pTimeFunction )()
| A pointer to a function that returns the system time in ms.

## Detailed Description

Represents a single option written in Xabsl2.

Author:
  Martin Lötzsch

Definition at line 250 of file Xabsl2Option.h.

## Constructor & Destructor Documentation

Xabsl2Option::Xabsl2Option | ( | const char * | name,
|  | Xabsl2InputSource & | input,
|  | Xabsl2ErrorHandler & | errorHandler,
|  | unsigned long(* | pTimeFunction)()
| ) |

  | Constructor. Does not create the option. Parameters:
  name | The name of the option. For debugging purposes.
  input | An input source for the intermediate code. It must be opened and read until A position where an option starts.
  errorHandler | A reference to a Xabsl2ErrorHandler instance
  pTimeFunction | a pointer to a function that returns the system time in ms.
Definition at line 325 of file Xabsl2Option.cpp. References Xabsl2Array< double >::append(), Xabsl2ErrorHandler::message(), Xabsl2InputSource::readString(), Xabsl2InputSource::readValue(), and XABSL2_DEBUG_INIT.

Here is the call graph for this function:

Xabsl2Option::~Xabsl2Option | ( |  | ) |

| Destructor. Deletes the states Definition at line 344 of file Xabsl2Option.cpp. References Xabsl2Array< Xabsl2State * >::getSize().

Here is the call graph for this function:

## Member Function Documentation

void Xabsl2Option::create | ( | Xabsl2InputSource & | input,
|  | Xabsl2Array< Xabsl2Option * > & | options,
|  | Xabsl2Array< Xabsl2BasicBehavior & > & | basicBehaviors,
|  | Xabsl2Symbols & | symbols
| ) |

  | Creates the option and it's states from the intermediate code. Parameters:
  input | An input source for the intermediate code. It must be opened and read until A position where an option starts.
  options | All other options
  basicBehaviors | All basic behaviors
  symbols | All available symbols
Definition at line 351 of file Xabsl2Option.cpp. References activeState, Xabsl2Array< Xabsl2State * >::append(), Xabsl2ErrorHandler::error(), Xabsl2ErrorHandler::errorsOccurred, Xabsl2Array< Xabsl2State * >::getElement(), initialState, Xabsl2ErrorHandler::message(), Xabsl2InputSource::readString(), Xabsl2InputSource::readValue(), timeOfOptionExecution, and XABSL2_DEBUG_INIT.

Here is the call graph for this function:

void Xabsl2Option::execute | ( |  | ) |

| Executes the option. The state machine is carried out to determine the subsequent option or the subsequent basic behavior. Output symbols are set. Definition at line 392 of file Xabsl2Option.cpp. References activeState, Xabsl2State::getNextState(), initialState, optionIsActive, optionWasActive, pTimeFunction, Xabsl2State::reset(), Xabsl2State::setOutputSymbols(), timeOfOptionExecution, and timeWhenOptionWasActivated. Referenced by Xabsl2Engine::execute().

Here is the call graph for this function:

bool Xabsl2Option::getOptionReachedATargetState | ( |  | ) | const

| Returns wheter the option reached a target state. Definition at line 413 of file Xabsl2Option.cpp. References activeState, Xabsl2State::isTargetState(), and optionWasActive. Referenced by Xabsl2subsequentOptionReachedTargetStateCondition::getValue().

Here is the call graph for this function:

## Member Data Documentation

Xabsl2Array<double> Xabsl2Option::parameters

| The parameters of the option. Definition at line 288 of file Xabsl2Option.h. Referenced by Xabsl2State::create(), GTXabsl2Profiler::recordLog(), GTXabsl2ProfilerNameTable::registerOption(), GTXabsl2EngineExecutor::sendDebugMessage(), Xabsl2Engine::setOptionParameter(), and Xabsl2State::setOutputSymbols().

Xabsl2Array<Xabsl2State*> Xabsl2Option::states

| The states of the option. Definition at line 291 of file Xabsl2Option.h. Referenced by Xabsl2Engine::checkForLoops(), GTXabsl2ProfilerNameTable::countDepth(), and GTXabsl2ProfilerNameTable::registerOption().

Xabsl2State* Xabsl2Option::activeState

| A pointer to the active state. If 0, then no state is active Definition at line 294 of file Xabsl2Option.h. Referenced by create(), GT2005BehaviorControl::drawOptions(), execute(), Xabsl2Engine::execute(), getOptionReachedATargetState(), GTXabsl2Profiler::recordLog(), and GTXabsl2EngineExecutor::sendDebugMessage().

bool Xabsl2Option::optionIsActive

| the option is activated in the current path through the option graph Definition at line 297 of file Xabsl2Option.h. Referenced by execute(), and Xabsl2Engine::execute().

bool Xabsl2Option::optionWasActive

| the option was activated in the last path trough the option graph Definition at line 300 of file Xabsl2Option.h. Referenced by execute(), Xabsl2Engine::execute(), and getOptionReachedATargetState().

unsigned long Xabsl2Option::timeOfOptionExecution

| the time how long the option is already active Definition at line 303 of file Xabsl2Option.h. Referenced by create(), execute(), and GTXabsl2EngineExecutor::sendDebugMessage().

unsigned long Xabsl2Option::timeWhenOptionWasActivated`[private]`

| The time, when the option was activated. Definition at line 310 of file Xabsl2Option.h. Referenced by execute().

Xabsl2State* Xabsl2Option::initialState`[private]`

| A pointer to the initial state. Definition at line 313 of file Xabsl2Option.h. Referenced by create(), and execute().

Xabsl2ErrorHandler& Xabsl2Option::errorHandler`[private]`

| Used for error handling. Definition at line 316 of file Xabsl2Option.h.

unsigned long(* Xabsl2Option::pTimeFunction)()`[private]`

| A pointer to a function that returns the system time in ms. Referenced by execute().

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

- Tools/Xabsl2/Xabsl2Engine/Xabsl2Option.h
- Tools/Xabsl2/Xabsl2Engine/Xabsl2Option.cpp