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

SH::ShDataVariantCast< Dest, DestDT, Src, SrcDT > Struct Template Reference

Handles casting between S and D storage types. More...

#include <ShVariantCast.hpp>

Inheritance diagram for SH::ShDataVariantCast< Dest, DestDT, Src, SrcDT >:

Inheritance graph
[legend]
Collaboration diagram for SH::ShDataVariantCast< Dest, DestDT, Src, SrcDT >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ShDataTypeCppType<
Dest, DestDT >::type 
D
typedef ShDataTypeCppType<
Src, SrcDT >::type 
S
typedef ShDataVariant< Dest,
DestDT > 
DestVariant
typedef const ShDataVariant<
Src, SrcDT > 
SrcVariant

Public Member Functions

void doCast (ShVariant *dest, const ShVariant *src) const
 Casts data from src into dest.
void getCastTypes (ShValueType &dest, ShDataType &destDT, ShValueType &src, ShDataType &srcDT) const
void getDestTypes (ShValueType &valueType, ShDataType &dataType) const
 Returns whether the destination of this caster matches the given types.
void doCast (D &dest, const S &src) const

Static Public Member Functions

static const ShDataVariantCastinstance ()

Static Public Attributes

static const ShValueType DestValueType
static const ShValueType SrcValueType

Detailed Description

template<typename Dest, ShDataType DestDT, typename Src, ShDataType SrcDT>
struct SH::ShDataVariantCast< Dest, DestDT, Src, SrcDT >

Handles casting between S and D storage types.

The actual data cast will have type ShHostType<SRC> to ShHostType<DEST> and may have some extra conversion code (e.g. clamping) applied in addition to the default C cast for those types.

Definition at line 70 of file ShVariantCast.hpp.


Member Function Documentation

template<typename Dest, ShDataType DestDT, typename Src, ShDataType SrcDT>
void SH::ShDataVariantCast< Dest, DestDT, Src, SrcDT >::doCast ShVariant dest,
const ShVariant src
const [virtual]
 

Casts data from src into dest.

src must have Src value type and SrcDT data type. dest similarly must match Dest and DestDT. Also, must guarantee dest != src (it will work if they are the same but what a waste...)

Implements SH::ShVariantCast.

Definition at line 40 of file ShVariantCastImpl.hpp.

References SH::ShDataVariant< T, DT >::begin(), and SH::ShDataVariant< T, DT >::end().


The documentation for this struct was generated from the following files:
Generated on Wed Jun 15 18:16:47 2005 for Sh by  doxygen 1.4.3-20050530