MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
MFM::VD Class Reference

#include <VD.h>

Public Types

enum  Type {
  INVALID =0, U32, S32, BOOL,
  UNARY, BITS, TYPE_COUNT
}
 

Public Member Functions

bool InRangeByLength (s32 val) const
 
void AssertInRangeByLength (s32 val) const
 
u32 GetType () const
 
s32 GetMin () const
 
s32 GetMax () const
 
s32 GetDefault () const
 
u64 GetLongDefault () const
 
bool InRange (s32 val) const
 
void AssertInRange (s32 val) const
 
 VD (u32 type, u32 len, u32 pos, s32 min, s32 vdef, s32 max)
 
 VD (u32 type, u32 len, u32 pos, u64 longdef)
 
void AssertIsType (u32 type) const
 
template<class CC >
s32 GetBitsAsS32 (const typename CC::ATOM_TYPE &a) const
 
template<class CC >
void SetBitsAsS32 (typename CC::ATOM_TYPE &a, s32 val) const
 
template<class CC >
u64 GetBitsAsU64 (const typename CC::ATOM_TYPE &a) const
 
template<class CC >
void SetBitsAsU64 (typename CC::ATOM_TYPE &a, u64 val) const
 
template<class CC >
u32 GetValueU32 (const typename CC::ATOM_TYPE &a) const
 
template<class CC >
void SetValueU32 (typename CC::ATOM_TYPE &a, const u32 val) const
 
template<class CC >
s32 GetValueS32 (const typename CC::ATOM_TYPE &a) const
 
template<class CC >
void SetValueS32 (typename CC::ATOM_TYPE &a, const s32 val) const
 
template<class CC >
bool GetValueBool (const typename CC::ATOM_TYPE &a) const
 
template<class CC >
void SetValueBool (typename CC::ATOM_TYPE &a, const bool val) const
 
template<class CC >
u32 GetValueUnary (const typename CC::ATOM_TYPE &a) const
 
template<class CC >
void SetValueUnary (typename CC::ATOM_TYPE &a, const u32 val) const
 

Static Public Member Functions

static bool ValidType (u32 type)
 
static void AssertValidType (u32 type)
 
static const char * GetTypeName (u32 t)
 
static s32 GetMin (u32 type, u32 bits)
 
static s32 GetMax (u32 type, u32 bits)
 
static u32 MakeMask (u32 length)
 
template<class CC >
static u32 GetFieldAsBits (const u32 length, const u32 start, const typename CC::ATOM_TYPE &a)
 Raw bits value. More...
 
template<class CC >
static void SetFieldAsBits (const u32 length, const u32 start, typename CC::ATOM_TYPE &a, const u32 val)
 
template<class CC >
static u64 GetLongFieldAsBits (const u32 length, const u32 start, const typename CC::ATOM_TYPE &a)
 
template<class CC >
static void SetLongFieldAsBits (const u32 length, const u32 start, typename CC::ATOM_TYPE &a, const u64 val)
 
template<class CC >
static u32 GetFieldAsU32 (const u32 length, const u32 start, const typename CC::ATOM_TYPE &a)
 u32 value
 
template<class CC >
static void SetFieldAsU32 (const u32 length, const u32 start, typename CC::ATOM_TYPE &a, const u32 val)
 
template<class CC >
static s32 GetFieldAsS32 (const u32 length, const u32 start, const typename CC::ATOM_TYPE &a)
 s32 value
 
template<class CC >
static void SetFieldAsS32 (const u32 length, const u32 start, typename CC::ATOM_TYPE &a, const s32 val)
 
template<class CC >
static bool GetFieldAsBool (const u32 length, const u32 start, const typename CC::ATOM_TYPE &a)
 bool value
 
template<class CC >
static void SetFieldAsBool (const u32 length, const u32 start, typename CC::ATOM_TYPE &a, const bool val)
 
template<class CC >
static u32 GetFieldAsUnary (const u32 length, const u32 start, const typename CC::ATOM_TYPE &a)
 unary value
 
template<class CC >
static void SetFieldAsUnary (const u32 length, const u32 start, typename CC::ATOM_TYPE &a, const u32 val)
 

Data Fields

const u32 m_type
 
const u32 m_length
 
const u32 m_start
 
const s32 m_min
 
const s32 m_vdef
 
const s32 m_max
 
const u64 m_longdef
 

Static Public Attributes

static const char * m_typeNames [TYPE_COUNT]
 

Detailed Description

A VD is a 'value description'.

Member Enumeration Documentation

VD::Type enumerates the possible value types that may be found in a value described by a VD (i.e., a field in an Atom).

Member Function Documentation

template<class CC >
s32 MFM::VD::GetBitsAsS32 ( const typename CC::ATOM_TYPE &  a) const

Get a raw bit field cast as an s32 – without checking whether this VD is an S32. For use by generic routines like Sliders that treat everything as an S32.

template<class CC >
u64 MFM::VD::GetBitsAsU64 ( const typename CC::ATOM_TYPE &  a) const

Get a raw bit field cast as a u64 – without checking whether this VD is a BITS.

template<class CC >
u32 MFM::VD::GetFieldAsBits ( const u32  length,
const u32  start,
const typename CC::ATOM_TYPE &  a 
)
static

Raw bits value.

The following are the slow-path, general-purpose, Atom field accessors, for use by the reflection system. In these methods, the field length and start position are passed as runtime function arguments rather than compile-time template arguments (which see BitField.h for those).

template<class CC >
void MFM::VD::SetBitsAsS32 ( typename CC::ATOM_TYPE &  a,
s32  val 
) const

Set a raw bit field from an s32 – without checking whether this VD is an S32. For use by generic routines like Sliders that treat everything as an S32.

template<class CC >
void MFM::VD::SetBitsAsU64 ( typename CC::ATOM_TYPE &  a,
u64  val 
) const

Set a raw bit field from an u64 – without checking whether this VD is a BITS.

Field Documentation

const char * MFM::VD::m_typeNames
static
Initial value:
=
{
"INVALID",
"U32",
"S32",
"BOOL",
"UNARY",
"BITS"
}

The documentation for this class was generated from the following files: