gpucalc::debugger::CommandParser Class Reference

#include <command_parser.h>

Inheritance diagram for gpucalc::debugger::CommandParser:

Inheritance graph

List of all members.

Public Member Functions

 CommandParser ()
const std::string & getClassName () const
 Returns name of class of our object.
const std::string & getObjectName () const
 Returns name of our object.
void getSpecificParameter (const std::string &ParameterName, void *ParameterValue)
 Method for obtaining some specific parameters, such as texture specific params, and so on.
bool isLocked () const
 returns state of object.
template<>
TimermSingleton
template<>
TimermSingleton
template<>
ProfilermSingleton
template<>
LogManagermSingleton
template<>
debugger::DebuggermSingleton
template<>
debugger::CommandParsermSingleton
template<>
ApplicationmSingleton
void process (const std::string &expression)
void registerCommand (const SharedPtr< Command > &cmd)
 register commands
 ~CommandParser ()

Static Public Member Functions

static CommandParsergetSingleton ()
static CommandParsergetSingletonPtr ()

Protected Member Functions

void addSpecificParameter (const std::string &ParameterName, void *ParameterValue, size_t Size)
void lock ()
void unlock ()

Static Protected Attributes

static T * mSingleton

Private Types

typedef std::map< std::string,
SharedPtr< Command > > 
CommandPtrMap

Private Attributes

CommandPtrMap mCommandPtrMap


Detailed Description

Definition at line 192 of file command_parser.h.


Member Typedef Documentation

typedef std::map<std::string, SharedPtr<Command> > gpucalc::debugger::CommandParser::CommandPtrMap [private]

Definition at line 228 of file command_parser.h.


Constructor & Destructor Documentation

gpucalc::debugger::CommandParser::CommandParser (  ) 

Definition at line 59 of file command_parser.cpp.

00059                               : Singleton<CommandParser>(_CommandParserName), mCommandPtrMap()
00060   {
00061   }

gpucalc::debugger::CommandParser::~CommandParser (  ) 

Definition at line 64 of file command_parser.cpp.

00065   {
00066    mCommandPtrMap.clear();
00067   }


Member Function Documentation

void gpucalc::Object::addSpecificParameter ( const std::string &  ParameterName,
void *  ParameterValue,
size_t  Size 
) [inline, protected, inherited]

Definition at line 254 of file object.h.

00255    {
00256     SpecificParametersMap::iterator i = mSpecificParameters.find(ParameterName);
00257     if (i != mSpecificParameters.end())
00258     {
00259      mSpecificParameters.erase(i);
00260     }
00261     mSpecificParameters[ParameterName] = Any(ParameterValue, Size);
00262    }

const std::string& gpucalc::Object::getClassName (  )  const [inline, inherited]

Returns name of class of our object.

Definition at line 92 of file object.h.

00093    {
00094     return mClassName;
00095    }

const std::string& gpucalc::Object::getObjectName (  )  const [inline, inherited]

Returns name of our object.

Definition at line 101 of file object.h.

00102    {
00103     return mObjectName;
00104    }

debugger::CommandParser & gpucalc::debugger::CommandParser::getSingleton (  )  [static]

Override standard Singleton retrieval.

Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

Reimplemented from gpucalc::Singleton< T >.

Definition at line 50 of file command_parser.cpp.

00051  {
00052   assert(mSingleton);
00053   return(* mSingleton);
00054  }

debugger::CommandParser * gpucalc::debugger::CommandParser::getSingletonPtr (  )  [static]

Override standard Singleton retrieval.

Why do we do this? Well, it's because the Singleton implementation is in a .h file, which means it gets compiled into anybody who includes it. This is needed for the Singleton template to work, but we actually only want it compiled into the implementation of the class based on the Singleton, not all of them. If we don't change this, we get link errors when trying to use the Singleton-based class from an outside dll.

This method just delegates to the template version anyway, but the implementation stays in this single compilation unit, preventing link errors.

Reimplemented from gpucalc::Singleton< T >.

Definition at line 44 of file command_parser.cpp.

00045  {
00046   return mSingleton;
00047  }

void gpucalc::Object::getSpecificParameter ( const std::string &  ParameterName,
void *  ParameterValue 
) [inline, inherited]

Method for obtaining some specific parameters, such as texture specific params, and so on.

Parameters:
ParameterName - name of parameter, usually it similar to specific method of some object (for example, GLTextureID)
ParameterValue - contain value of named parameter, it must be allocated and have sufficient size.
Todo:
Think for better realization.

Definition at line 128 of file object.h.

00129    {
00130     SpecificParametersMap::iterator i = mSpecificParameters.find(ParameterName);
00131     if (i != mSpecificParameters.end())
00132     {
00133      i->second.copyValue(ParameterValue);
00134     }
00135     else
00136     {
00137      Except<ERR_ITEM_NOT_FOUND>(this, "Parameter \"" + ParameterName + "\" does not exists.", "Object::getSpecificParameter()", __FILE__, __LINE__);
00138     }
00139    }

bool gpucalc::Object::isLocked (  )  const [inline, inherited]

returns state of object.

If object is locked then we cannot change some state of it, because object is used in computation. If object is unlocked then we can change some state of it, object is not in computation.

Definition at line 113 of file object.h.

00114    {
00115     return mIsLocked;
00116    }

void gpucalc::Object::lock (  )  [inline, protected, inherited]

Definition at line 265 of file object.h.

00266    {
00267     mIsLocked = true;
00268    }

template<>
Timer * gpucalc::Singleton< Timer >::mSingleton (  )  [inline, inherited]

Definition at line 42 of file win32_timer_impl.cpp.

template<>
Timer * gpucalc::Singleton< Timer >::mSingleton (  )  [inline, inherited]

Definition at line 45 of file unix_timer_impl.cpp.

template<>
Profiler * gpucalc::Singleton< Profiler >::mSingleton (  )  [inline, inherited]

Definition at line 39 of file profiler.cpp.

template<>
LogManager * gpucalc::Singleton< LogManager >::mSingleton (  )  [inline, inherited]

Definition at line 38 of file log_manager.cpp.

template<>
debugger::Debugger * gpucalc::Singleton< debugger::Debugger >::mSingleton (  )  [inline, inherited]

Definition at line 42 of file debugger.cpp.

template<>
debugger::CommandParser * gpucalc::Singleton< debugger::CommandParser >::mSingleton (  )  [inline, inherited]

Definition at line 41 of file command_parser.cpp.

template<>
Application * gpucalc::Singleton< Application >::mSingleton (  )  [inline, inherited]

Definition at line 44 of file application.cpp.

void gpucalc::debugger::CommandParser::process ( const std::string &  expression  ) 

Definition at line 76 of file command_parser.cpp.

00077   {
00078    StringList sList = auxillary::StringUtil::split(expression);
00079    CommandPtrMap::iterator i = mCommandPtrMap.find(sList[0]);
00080    if (i != mCommandPtrMap.end())
00081    {
00082     SharedPtr<Command> cmd = i->second;
00083     cmd->process(sList);
00084    }
00085   }

void gpucalc::debugger::CommandParser::registerCommand ( const SharedPtr< Command > &  cmd  ) 

register commands

Definition at line 70 of file command_parser.cpp.

00071   {
00072    addToContainer(cmd, cmd->getObjectName(), mCommandPtrMap);
00073   }

void gpucalc::Object::unlock (  )  [inline, protected, inherited]

Definition at line 271 of file object.h.

00272    {
00273     mIsLocked = false;
00274    }


Member Data Documentation

Definition at line 229 of file command_parser.h.

template<typename T>
T* gpucalc::Singleton< T >::mSingleton [static, protected, inherited]

Definition at line 108 of file singleton.h.


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

Generated on Thu Mar 5 22:36:47 2009 for gpucalc by  doxygen 1.5.6