Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
T
 TagType, SerializationTag
 Test
 TEST
 Text, SerializationTag
 Text()const, SerializationTag
 The Two Faces of Reflection
 TheClass
 ThrowError, JavaScriptContext
 ToNameMap, EnumType
 ToString, Variant
 ToValueMap, EnumType
 translucent_cast
 TranslucentCast
 Tutorial
 Type
~Type, Type
 Type()const, SerializationTag
 Type::DescriptionHelper
 TypeOf
 TypeOf(by array value)
 TypeOf(by value)
 Types
U
 Unit Testing
 UnloadTypes, Type
 UpdateAliases, Variant
 Using Reflection
V
 ValidForFunction, Parameters
 ValueMap, EnumType
 Values, EnumType::DescriptionHelper
 ValueType, MapProperty
 Variant
 Variant()(constructor), Variant
 Variant()(copy constructor), Variant
 VariantAliasRef
 VariantProperty
 Variants
 vformat, MutableString
 Void, Variant
W
 Whining-No
 Write, OutputStream
 Write(Reflector&)const, PropertyPath
 WriteData
 WriteEnum, EnumType
 Writef, PropertyPath
 WriteProperty, PersistentClass
 WriteRefProperty, PersistentClass
 WriteStringProperty, PersistentClass
class ReflectExport(reflect) Test : public Dynamic
Each subclass of Test implements a unit test.
Defines a new TEST,
string::MutableString Text()
a mutable version of the text
string::ConstString Text() const
a const version of the text
Reflect, mirroring C++, has two faces: static information known at compiletime, and dynamic information, known at runtime.
static ClassType *TheClass()
This function is always hidden by subclasses and used during static construction to construct the class hierarchy.
Returns the Class of the type represented by this signature.
void ThrowError(const char *format,
 ...) const
Throws an error from a function to the JavaScript runtime.
typedef std::map<int, string::SharedString> ToNameMap
string::String ToString() const
Serializes with the StandardSerializer.
typedef std::map<string::SharedString, int> ToValueMap
template<typename Type> inline Type translucent_cast(void *value)
Turns an opaque pointer (of type void *) into a typed pointer of the specified type.
template<typename T> static T *TranslucentCast(void *ptr)
Casts a void * from OpaqueCast (template/static) back to a T *.
template<typename T> static T *TranslucentCast(void *ptr)
Casts a void * from OpaqueCast back to a Type.
Or: Let’s see some examples already.
class ReflectExport(reflect) Type : public Dynamic
TagType &Type()
a reference to the Type
Type(void (*init_cb)() =  0)
Constructs a class.
~Type()
Destructs this class and unlinks it from the class hierarchy.
TagType Type() const
the type
template<typename T> class Type::DescriptionHelper
Template base class for description helpers, used in reflection definitions.
template<typename T> inline typename Signature<T>::ClassType *TypeOf()
Templated function, returns the Class of a reflected type.
template<typename T, unsigned size> inline typename Signature<T>::ClassType *TypeOf(
   const (&)[size]
)
Returns a pointer type for an array.
template<typename T> inline typename Signature<T>::ClassType *TypeOf(const &)
Returns the Class type of an expression with a reflected type.
Reflect includes its own Unit-Test framework.
static void UnloadTypes(Type *)
Reverses the effect of Type::LoadTypes.
void UpdateAliases() const
Updates aliased variants with this one’s value.
Some uses of the reflected Circle class
bool ValidForFunction(const Function *function) const
Checks if this parameter list is valid to call a particular function.
const ToValueMap &ValueMap() const
ValueHelper Values
This member of EnumType::DescriptionHelper is used to help register enums in a reflection definition.
virtual const Type *ValueType() const = 0
Retrieves the type of values represented by this map property.
class ReflectExport(reflect) Variant
Variants represent objects of any reflected type.
Variant()
constructs a blank variant.
clones another variant.
template<typename T> class VariantAliasRef
The VariantAliasRef automates flushing modified by-reference parameters back into their source values.
template<typename ObjectType> class VariantProperty : public Property
An implemetation of Property using a callback and a Reflector to access the data.
VariantProperty(void (ObjectType::*serializer)(Reflector &) const,
void (ObjectType::*deserializer)(Reflector &))
Variant provides a nice way of wrapping up a static type with some extra data so it can be passed through runtime without losing information.
size_type vformat(const char *format,
 std::va_list)
prints into the string, like vprintf.
static Variant &Void()
Returns the variant representing a void “value.”
DECLARE_REFLECTION and DEFINE_REFLECTION are rather large macros.
virtual size_type Write(const void *buffer,
size_type bufmax) = 0
Writes binary data out.
void Write(Reflector &reflector) const
virtual bool WriteData(void *object,
unsigned item_index,
const Variant &value) const = 0
Writes the Variant value to the array.
virtual bool WriteData(void *object,
const Variant &value) const = 0
Writes this property with the Variant value.
virtual bool WriteData(void *in,
const Variant &key,
const Variant &value) const = 0
Writes a (possibly new) map entry.
Easy way to write data templated on data type.
void WriteEnum(void *,
 int)
bool Writef(const char *format,
 ...) const
bool WriteProperty(Persistent *,
string::Fragment path,
string::Fragment value) const
Writes a property using a StandardDeserializer to parse the data.
bool WriteRefProperty(Persistent *,
string::Fragment path,
Dynamic *value) const
Writes a reference property (a property representing a Dynamic *).
bool WriteStringProperty(Persistent *,
string::Fragment path,
string::Fragment value) const
Close