SH::ShEval Class Reference

Collaboration diagram for SH::ShEval:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void addOp (ShOperation op, const ShEvalOp *evalOp, ShValueType dest, ShValueType src0, ShValueType src1=SH_VALUETYPE_END, ShValueType src2=SH_VALUETYPE_END)
 Registers a evalOp for a certain operation/source type index combination.
std::string availableOps () const
 debugging function
void operator() (ShOperation op, ShVariant *dest, const ShVariant *a, const ShVariant *b, const ShVariant *c) const
 Decides which evaluation evalOp to use and calls it up.
void operator() (ShOperation op, const ShVariantPtr &dest, const ShVariantCPtr &a, const ShVariantCPtr &b, const ShVariantCPtr &c) const
const ShEvalOpInfogetEvalOpInfo (ShOperation op, ShValueType dest, ShValueType src0, ShValueType src1=SH_VALUETYPE_END, ShValueType src2=SH_VALUETYPE_END) const
 Returns a new op info representing the types that arguments should be cast into for an operation.
const ShEvalOpInfogetEvalOpInfo (const ShStatement &stmt) const

Static Public Member Functions

static ShEvalinstance ()

Detailed Description

Definition at line 85 of file ShEval.hpp.


Member Function Documentation

const ShEvalOpInfo * SH::ShEval::getEvalOpInfo ShOperation  op,
ShValueType  dest,
ShValueType  src0,
ShValueType  src1 = SH_VALUETYPE_END,
ShValueType  src2 = SH_VALUETYPE_END
const
 

Returns a new op info representing the types that arguments should be cast into for an operation.

Caches the result.

Definition at line 113 of file ShEval.cpp.

References SH::ShOperationInfo::arity, SH::ShCastManager::castDist(), SH::ShEvalOpInfo::encode(), SH::ShCastManager::instance(), SH::opInfo, and SH::shValueTypeName().

Referenced by getEvalOpInfo(), and operator()().

void SH::ShEval::operator() ShOperation  op,
ShVariant dest,
const ShVariant a,
const ShVariant b,
const ShVariant c
const
 

Decides which evaluation evalOp to use and calls it up.

If an op is unary, leave b, c = 0. If an op is binary leave c = 0. If an op has no dest, leave dest = 0.

TODO (should really break this out into separate functions. EvalOps can have a single function in th einterface)

Definition at line 32 of file ShEval.cpp.

References SH::ShVariant::encodeArray(), getEvalOpInfo(), SH::ShCastManager::instance(), SH::ShEvalOpInfo::m_dest, SH::ShEvalOpInfo::m_evalOp, SH::opInfo, SH::shValueTypeName(), SH::ShVariant::typeMatches(), and SH::ShVariant::valueType().

Referenced by operator()().


The documentation for this class was generated from the following files:
Generated on Thu Feb 16 14:55:36 2006 for Sh by  doxygen 1.4.6