ExtendedInstructionTable Class Reference

A singleton mapping of ExtendedInstruction signatures to ExtendedInstruction functors. More...

#include <ExtendedInstructionTable.h>

List of all members.

Public Member Functions

template<typename T>
void add (const string &name, const vector< StandardTypeDescriptorOrdinal > &parameterTypes, T *dummy, typename T::Functor functor)
 Registers an extended instruction and the functor which implements it.
ExtendedInstructionDefoperator[] (string const &signature)
 Looks up an extended instruction by signature (name + argument types).
string signatures ()

Private Attributes

map< string, ExtendedInstructionDef * > _defsByName


Detailed Description

A singleton mapping of ExtendedInstruction signatures to ExtendedInstruction functors.

Definition at line 35 of file ExtendedInstructionTable.h.


Member Function Documentation

template<typename T>
void ExtendedInstructionTable::add ( const string &  name,
const vector< StandardTypeDescriptorOrdinal > &  parameterTypes,
T *  dummy,
typename T::Functor  functor 
) [inline]

Registers an extended instruction and the functor which implements it.

Definition at line 40 of file ExtendedInstructionTable.h.

References ExtendedInstructionDef::getSignature().

Referenced by ExtCastRegister(), ExtDateTimeRegister(), ExtDynamicVariableRegister(), ExtMathRegister(), ExtRegExpRegister(), ExtStringRegister(), ExtWinAggFuncRegister(), CalcExtContextTest::setupExtendedTestInstructions(), testConvertDecimal(), testConvertDoubleToFloat(), testConvertExactNumberToString(), testConvertFloatToDouble(), testConvertFloatToIntTypes(), testConvertIntTypesToFloat(), testConvertStringToExactNumber(), and CalcAssemblerTest::testExtended().

00045     {
00046         FunctorExtendedInstructionDef<T> *pDef =
00047             new FunctorExtendedInstructionDef<T>(
00048                 name,
00049                 parameterTypes,
00050                 functor);
00051         _defsByName[pDef->getSignature()] = pDef;
00052     }

ExtendedInstructionDef* ExtendedInstructionTable::operator[] ( string const &  signature  )  [inline]

Looks up an extended instruction by signature (name + argument types).

Returns null if instruction not found.

Definition at line 57 of file ExtendedInstructionTable.h.

00057                                                                  {
00058         return _defsByName[signature];
00059     }

FENNEL_BEGIN_NAMESPACE string ExtendedInstructionTable::signatures (  ) 

Definition at line 29 of file ExtendedInstructionTable.cpp.

References _defsByName.

Referenced by InstructionFactory::extendedSignatures().

00030 {
00031     ostringstream s("");
00032 
00033     map<string, ExtendedInstructionDef *>::iterator i = _defsByName.begin();
00034     map<string, ExtendedInstructionDef *>::iterator end = _defsByName.end();
00035 
00036     while (i != end) {
00037         s << (*i).first << endl;
00038         i++;
00039     }
00040     return s.str();
00041 }


Member Data Documentation

map<string, ExtendedInstructionDef *> ExtendedInstructionTable::_defsByName [private]

Definition at line 64 of file ExtendedInstructionTable.h.

Referenced by signatures().


The documentation for this class was generated from the following files:
Generated on Mon Jun 22 04:00:31 2009 for Fennel by  doxygen 1.5.1