Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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, ShVariantPtr dest, ShVariantCPtr a, ShVariantCPtr b, 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 SH::FloatConverter::fixStatement(), 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::ShCastManager::doAllocCast(), SH::ShCastManager::doCast(), SH::ShVariant::encodeArray(), SH::ShVariantFactory::generate(), getEvalOpInfo(), SH::ShCastManager::instance(), SH::ShEvalOpInfo::m_dest, SH::ShEvalOpInfo::m_evalOp, SH::ShEvalOpInfo::m_src, SH::opInfo, SH::shValueTypeName(), SH::shVariantFactory(), SH::ShVariant::size(), SH::ShVariant::typeMatches(), and SH::ShVariant::valueType().

Referenced by operator()().


The documentation for this class was generated from the following files:
Generated on Thu Jul 28 17:35:32 2005 for Sh by  doxygen 1.4.3-20050530