FunctorExtendedInstructionDef< T > Class Template Reference

Definition of an extended instruction based upon a functor. More...

#include <ExtendedInstruction.h>

Inheritance diagram for FunctorExtendedInstructionDef< T >:

ExtendedInstructionDef List of all members.

Public Member Functions

ExtendedInstructioncreateInstruction (vector< RegisterReference * > const &regs)
 Creates an instruction of this type which references a particular set of registers.
string getName ()
 Returns the name of this instruction.
const vector< StandardTypeDescriptorOrdinal > & getParameterTypes ()
 Returns the parameter types of this instruction.
string getSignature () const
 Returns the signature of this instruction.

Public Attributes

T::Functor _functor

Protected Member Functions

 FunctorExtendedInstructionDef (string const &name, vector< StandardTypeDescriptorOrdinal > const &parameterTypes, typename T::Functor functor)
 Creates a FunctorExtendedInstructionDef.

Protected Attributes

string _name
vector< StandardTypeDescriptorOrdinal_parameterTypes
string _signature

Friends

class ExtendedInstructionTable

Detailed Description

template<typename T>
class FunctorExtendedInstructionDef< T >

Definition of an extended instruction based upon a functor.

Template parameter 'T' must be a type such as ExtendedInstruction2<int,double>. It must have a type T:Functor.

Definition at line 115 of file ExtendedInstruction.h.


Constructor & Destructor Documentation

template<typename T>
FunctorExtendedInstructionDef< T >::FunctorExtendedInstructionDef ( string const &  name,
vector< StandardTypeDescriptorOrdinal > const &  parameterTypes,
typename T::Functor  functor 
) [inline, explicit, protected]

Creates a FunctorExtendedInstructionDef.

Only ExtendedInstructionTable calls this.

Definition at line 125 of file ExtendedInstruction.h.

00129         : ExtendedInstructionDef(name, parameterTypes),
00130           _functor(functor)
00131     {
00132         assert(functor != NULL);
00133     }


Member Function Documentation

template<typename T>
ExtendedInstruction* FunctorExtendedInstructionDef< T >::createInstruction ( vector< RegisterReference * > const &  regs  )  [inline, virtual]

Creates an instruction of this type which references a particular set of registers.

The registers supplied must be the same number and type as the registers supported by the function.

Implements ExtendedInstructionDef.

Definition at line 138 of file ExtendedInstruction.h.

00140     {
00141         return T::create(*this,regs);
00142     }

string ExtendedInstructionDef::getName (  )  [inline, inherited]

Returns the name of this instruction.

Definition at line 72 of file ExtendedInstruction.h.

Referenced by CalcExtContextTest::setupExtendedTestInstructions(), testConvertDecimal(), testConvertDoubleToFloat(), testConvertExactNumberToString(), testConvertFloatToDouble(), testConvertFloatToIntTypes(), testConvertIntTypesToFloat(), and testConvertStringToExactNumber().

00073     {
00074         return _name;
00075     }

const vector<StandardTypeDescriptorOrdinal>& ExtendedInstructionDef::getParameterTypes (  )  [inline, inherited]

Returns the parameter types of this instruction.

Definition at line 80 of file ExtendedInstruction.h.

Referenced by TestCalculator::setUp(), CalcExtContextTest::setupExtendedTestInstructions(), testConvertDecimal(), testConvertDoubleToFloat(), testConvertExactNumberToString(), testConvertFloatToDouble(), testConvertFloatToIntTypes(), testConvertIntTypesToFloat(), and testConvertStringToExactNumber().

00081     {
00082         return _parameterTypes;
00083     }

string ExtendedInstructionDef::getSignature (  )  const [inline, inherited]

Returns the signature of this instruction.

The signature is always of the form "<name>(<type0>,<type1>,...)", for example "substr(ptr,ptr,int,intr)". The signature is used to identify instructions in an ExtendedInstructionTable, and in assembly language instructions such as "CALL 'substr(ptr,ptr,int,ptr) &0, &1, &2, &3".

Definition at line 91 of file ExtendedInstruction.h.

Referenced by ExtendedInstructionTable::add(), ExtendedInstruction5Context< T0, T1, T2, T3, T4 >::describe(), ExtendedInstruction5< T0, T1, T2, T3, T4 >::describe(), ExtendedInstruction4Context< T0, T1, T2, T3 >::describe(), ExtendedInstruction4< T0, T1, T2, T3 >::describe(), ExtendedInstruction3Context< T0, T1, T2 >::describe(), ExtendedInstruction3< T0, T1, T2 >::describe(), ExtendedInstruction2Context< T0, T1 >::describe(), ExtendedInstruction2< T0, T1 >::describe(), ExtendedInstruction1Context< T0 >::describe(), and ExtendedInstruction1< T0 >::describe().

00092     {
00093         return _signature;
00094     }


Friends And Related Function Documentation

template<typename T>
friend class ExtendedInstructionTable [friend]

Reimplemented from ExtendedInstructionDef.

Definition at line 117 of file ExtendedInstruction.h.


Member Data Documentation

template<typename T>
T::Functor FunctorExtendedInstructionDef< T >::_functor

Definition at line 135 of file ExtendedInstruction.h.

Referenced by ExtendedInstruction5Context< T0, T1, T2, T3, T4 >::exec(), ExtendedInstruction5< T0, T1, T2, T3, T4 >::exec(), ExtendedInstruction4Context< T0, T1, T2, T3 >::exec(), ExtendedInstruction4< T0, T1, T2, T3 >::exec(), ExtendedInstruction3Context< T0, T1, T2 >::exec(), ExtendedInstruction3< T0, T1, T2 >::exec(), ExtendedInstruction2Context< T0, T1 >::exec(), ExtendedInstruction2< T0, T1 >::exec(), ExtendedInstruction1Context< T0 >::exec(), and ExtendedInstruction1< T0 >::exec().

string ExtendedInstructionDef::_name [protected, inherited]

Definition at line 47 of file ExtendedInstruction.h.

Referenced by ExtendedInstructionDef::computeSignature().

vector<StandardTypeDescriptorOrdinal> ExtendedInstructionDef::_parameterTypes [protected, inherited]

Definition at line 48 of file ExtendedInstruction.h.

Referenced by ExtendedInstructionDef::computeSignature().

string ExtendedInstructionDef::_signature [protected, inherited]

Definition at line 49 of file ExtendedInstruction.h.


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