SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
Public Types | Public Member Functions | Private Attributes | List of all members
CommandQueue Class Reference

A queue of G4 commands to be executed in order. More...

#include <CommandQueue.hh>

Inheritance diagram for CommandQueue:
Module

Public Types

typedef std::string CommandType
 
typedef std::vector< std::string > CommandVectorType
 
typedef size_t SizeType
 
- Public Types inherited from Module
enum  ModuleStatus { eOkay = 0 , eNotInitialized = 1 , eBadState = 2 , eFatalError = 3 }
 

Public Member Functions

 CommandQueue ()
 
virtual ~CommandQueue ()
 
void add (const char *command)
 
void add (const CommandType &command)
 
void clear ()
 
CommandVectorType::iterator cmdsBegin ()
 
CommandVectorType::iterator cmdsEnd ()
 
void execute ()
 
CommandVectorType::iterator find (const std::string &command)
 
void printOut ()
 
- Public Member Functions inherited from Module
virtual ~Module ()
 
virtual void beginEvent (const G4Event *)
 
virtual void beginRun (const G4Run *)
 
virtual void cleanup ()
 
bool deleteOnExit ()
 
virtual void endEvent (const G4Event *)
 
virtual void endRun (const G4Run *)
 
const std::string & getName () const
 
ModuleStatus getStatus () const
 
virtual void initialize ()
 
LogStream & log ()
 
virtual void postTracking (const G4Track *)
 
virtual void preTracking (const G4Track *)
 
virtual void reset ()
 
virtual void stepping (const G4Step *)
 

Private Attributes

CommandVectorType m_commands
 

Additional Inherited Members

- Public Attributes inherited from Module
bool m_deleteOnExit
 
LogStream * m_log
 
std::string m_name
 
ModuleStatus m_status
 
- Protected Member Functions inherited from Module
 Module (const std::string &name, bool deleteOnExit=true, bool autoRegister=true)
 

Detailed Description

A queue of G4 commands to be executed in order.

Note
Created by CommandLineProcessor from the command line arguments.

Definition at line 18 of file CommandQueue.hh.

Member Typedef Documentation

◆ CommandType

typedef std::string CommandType

Definition at line 22 of file CommandQueue.hh.

◆ CommandVectorType

typedef std::vector<std::string> CommandVectorType

Definition at line 21 of file CommandQueue.hh.

◆ SizeType

typedef size_t SizeType

Definition at line 23 of file CommandQueue.hh.

Constructor & Destructor Documentation

◆ CommandQueue()

CommandQueue ( )
inline

Class constructor.

Definition at line 30 of file CommandQueue.hh.

◆ ~CommandQueue()

virtual ~CommandQueue ( )
inlinevirtual

Class destructor.

Definition at line 37 of file CommandQueue.hh.

Member Function Documentation

◆ add() [1/2]

void add ( const char *  command)
inline

Add a command to the queue.

Parameters
[in]commandThe Geant4 command to add to the queue.

Definition at line 52 of file CommandQueue.hh.

References CommandQueue::add().

◆ add() [2/2]

void add ( const CommandType &  command)
inline

Add a command to the queue.

Parameters
[in]commandThe Geant4 command to add to the queue.

Definition at line 44 of file CommandQueue.hh.

References CommandQueue::m_commands.

Referenced by CommandQueue::add(), CommandLineProcessor::process(), CommandLineProcessor::processOption(), and CommandLineProcessor::processOptions().

◆ clear()

void clear ( )
inline

Clear all the commands in the queue.

Definition at line 86 of file CommandQueue.hh.

References CommandQueue::m_commands.

Referenced by SlicApplication::run().

◆ cmdsBegin()

CommandVectorType::iterator cmdsBegin ( )
inline

Get the begin iterator of the queue.

Returns
An iterator pointing to the beginning of the command queue.

Definition at line 61 of file CommandQueue.hh.

References CommandQueue::m_commands.

Referenced by CommandQueue::execute(), and CommandQueue::printOut().

◆ cmdsEnd()

CommandVectorType::iterator cmdsEnd ( )
inline

Get the end iterator of the queue.

Returns
An iterator pointing to the end of the command queue.

Definition at line 69 of file CommandQueue.hh.

References CommandQueue::m_commands.

Referenced by CommandQueue::execute(), and CommandQueue::printOut().

◆ execute()

void execute ( )

Execute the commands in the queue sequentially.

Definition at line 17 of file CommandQueue.cc.

References CommandQueue::cmdsBegin(), and CommandQueue::cmdsEnd().

Referenced by SlicApplication::run().

◆ find()

CommandQueue::CommandVectorType::iterator find ( const std::string &  command)

Find the first command that matches a string.

Parameters
[in]commandThe macro command to find.
Returns
An iterator pointing to the command or end iterator if not found.

Definition at line 24 of file CommandQueue.cc.

References CommandQueue::m_commands.

◆ printOut()

void printOut ( )

Print the queue to the log.

Definition at line 7 of file CommandQueue.cc.

References LOG::always, CommandQueue::cmdsBegin(), CommandQueue::cmdsEnd(), LOG::done, and Module::log().

Referenced by SlicApplication::run().

Member Data Documentation

◆ m_commands

CommandVectorType m_commands
private

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