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
S
 Save/Load Functions
 SaveFile
 SaveLoad.h
 Serialization
 Serialization and the Stack
mSerializationClass, Class
 SerializationTag
 Serialize
 Serialize(bool)
 Serialize(const Dynamic*), Serializer
 Serialize(const Dynamic*obj), StandardSerializer
 Serialize(double)
 Serialize(long)
 Serialize(unsigned long)
 SerializeData, StandardSerializer
 SerializeEnum
 SerializeItem, ArrayProperty
 SerializePointer, Class
 SerializeProperties, PersistentClass
 SerializeProperty
 Serializer
~Serializer, Serializer
mSerializer
 SerializeText
 Serializing, Reflector
 Set, Variant
 SetAccessors, EnumType
 SetBasicOperations, Type
 SetExecutionFunction, ApplicationClass
 SetName, Type
 SetParent, Type
mSetter
 SetValue, Variant
 ShallowDeserializer
 ShallowSerializer
 SharedRuntime, JavaScriptRuntime
 SharedString
 SharedString(const char*string,const StringPool*owner), SharedString
 Sibling, Type
 Signature
 Signature and Dynamic
 size
 Size
mSize, DirectArrayProperty
 size(of the entire block), StringBlock
 size_type
 StandardDeserializer
 StandardSerializer
 StringBlock
 StringPool
 StringPoolContext
 StructType
 StructType::DescriptionHelper
 substr, Fragment
 Supports Change
 SURPRISES
template<typename Type> bool SaveFile(const Type &data,
string::ConstString filename)
Saves “data” into a file using a StandardSerializer.
How to use reflection to save and load things.
Serialization makes heavy use of the function call stack, recursing on first use of any Persistent pointer (on a big graph, this can be very deep).
const Class *mSerializationClass
The Class that pointers use when serializing.
class ReflectExport(reflect) SerializationTag
This class represents the begin/end tags in a Serializer/Deserializer stream.
SerializationTag(const char *text,
TagType type)
Constructs a serialization tag with the given text and TagType.
void Serialize(const void *in,
void *out,
Reflector &reflector) const
Serializes the entire array/vector.
void Serialize(const void *in,
void *out,
Reflector &reflector) const
virtual void Serialize(const void *in,
void *out,
Reflector &reflector) const = 0
Reads or writes the represented data using a Reflector.
virtual void Serialize(const void *in,
void *out,
Reflector &reflector) const
Serialize defines how objects represented by this type are serialized.
void Serialize(Reflector &reflector) const
reads or writes this variant with a reflector.
virtual bool Serialize(bool) = 0
Emits a bool.
bool Serialize(bool)
Writes “true”/”false”.
virtual bool Serialize(const Dynamic *object) = 0
The object is serialized using its Category (see <Category.SerializeDynamic>), or, if the object has been <Reference>d, then the serializer should emit a backreference instead.
bool Serialize(const Dynamic *object)
Writes “#<<obj->GetClass()->GetCategory()->Name()>>” and then defers to obj->GetClass()->GetCategory()->SerializeDynamic(obj, Reflector(*this)).
virtual bool Serialize(double) = 0
Emits a float/double.
bool Serialize(double)
Writes “%#g”.
virtual bool Serialize(long) = 0
Emits an integer.
bool Serialize(long)
Writes “%ld”, e.g., 3 -> “3”
virtual bool Serialize(unsigned long) = 0
Emits an integer, maybe in hex.
bool Serialize(unsigned long)
Writes “0x%lX”, e.g., 32u -> “0x20”
bool SerializeData(const void *data,
unsigned nbytes)
Serializes nbytes of data as hex pairs A3 45 23 8F ...
virtual bool SerializeEnum(int value,
const EnumType *type) = 0
Emits an enum value or string.
bool SerializeEnum(int value,
const EnumType *clazz)
Writes the enum value as a bare string (no quotes).
virtual void SerializeItem(const void *in,
void *out,
unsigned index,
Reflector &reflector) const = 0
Reads/writes a single item to the reflector.
virtual void SerializePointer(const Dynamic *in,
Reflector &reflector) const
void SerializeProperties(const Persistent *,
Reflector &) const
virtual bool SerializeProperty(const void *object,
const Property *prop) = 0
bool SerializeProperty(const void *object,
const Property *prop)
Writes the property by deferring to its Property::Serialize method.
class ReflectExport(reflect) Serializer
Defines the interface for serialization.
virtual ~Serializer()
Serializer *mSerializer
The serializer this Reflector is managing, or NULL if it is Deserializing.
void (ObjectType::*mSerializer)(Reflector &) const
virtual bool SerializeText(const char *text,
unsigned nbytes) = 0
Emits a string.
bool SerializeText(const char *text,
unsigned nbytes)
Writes nbytes of text as a string with quotes around it and some standard escapes.
bool Serializing() const
true when this reflector represents a Serializer
bool Set(const Variant &value)
Assigns a value to the variant.
void SetAccessors(int (*)(const void *),
void (*)(void *, int))
void SetBasicOperations(unsigned size,
unsigned alignment,
void *(*construct)(void *),
void *(*destruct)(void *))
Sets the factory function for this class.
void SetExecutionFunction(int (*)(int, char *[]))
void SetName(const char *name)
Sets the name of the type and calls RegisterName to it in a global map.
void SetParent(Type *parent)
Sets the parent (base class) of this Type.
void (ObjectType::*mSetter)(const MemberType &)
void (ObjectType::*mSetter)(const MemberType &)
void (ObjectType::*mSetter)(MemberType)
template<typename T> bool SetValue(const &value)
Template version of Set.
class ReflectExport(reflect) ShallowDeserializer : public CompositeDeserializer
A composite serializer that deserializes pointers as raw data rather than traversing them.
class ReflectExport(reflect) ShallowSerializer : public CompositeSerializer
A composite serializer that serializes pointers as raw data rather than traversing them.
static JavaScriptRuntime SharedRuntime()
SharedStrings are like ConstStrings except their string pointers are guaranteed to be one-one with their data.
SharedString()
Constructs an empty shared string.
SharedString(const char *string,
const StringPool *owner)
Constructs a shared string from a character pointer, used by StringPools.
Type *Sibling() const
The next sibling of this class, or itself if there are no siblings.
template<typename T> struct Signature
Signatures provide a uniform means of accessing the Class object and the static type of that class of any reflected type, dynamic (Dynamic) or not.
At the center of all of reflect are Signature and Dynamic.
size_type size() const
same as length, for compatibility with std::string.
size_type size() const
the current length of the string.
virtual unsigned Size(const void *object) const = 0
Gets the current size of the array/vector in the object.
unsigned Size() const
The size of the object represented by this class.
unsigned mSize
size_type size()
typedef unsigned size_type
typedef unsigned size_type
class ReflectExport(reflect) StandardDeserializer : public Deserializer
A basic ascii text deserializer.
class ReflectExport(reflect) StandardSerializer : public Serializer
A basic ascii text serializer.
class StringBlock
Holds a concatenated block of strings.
class ReflectExport(reflect) StringPool
A string pool manages SharedStrings.
explicit StringPool(const StringPool *parent =  NULL)
class ReflectExport(
   reflect
) StringPoolContext : public StringPool , public utility::Context<StringPoolContext>
class ReflectExport(reflect) StructType : public ObjectType
Reflects a struct as a property-tuple.
template<typename T> class StructType::DescriptionHelper : public ObjectType::DescriptionHelper<T>
Fragment substr(size_type index,  
size_type amount =  npos) const
Makes a substr fragment from this one.
The serialization pattern reflect uses is capable of dealing with an evolving program.
Less please.
Close