ReferenceMan

The Referencable manager associates variables of a particular type to an unique identifier.

This manager is mostly used by iz.classes and iz.serializer. For example, in a setting file, it allows to store the unique identifier associated to a class instance, rather than storing all its properties, as the instance settings may be saved elsewhere. It also allow to serialize fat pointers, such as delegates.

Members

Static functions

clear
void clear()

Empties the storage.

getIDProposal
const(char)[] getIDProposal(RT* aReference)

Proposes an unique ID for a reference. This is a convenience function that will not return the same values for each software session.

isReferenced
bool isReferenced(RT* aReference)

Indicates if a variable is referenced.

isTypeStored
bool isTypeStored()

Indicates if a type is referenced.

opBinaryRight
bool opBinaryRight(RT* aReference)

Support for the in operator. Evaluates to true if the variable is referenced otherwise false.

reference
void* reference(const(char)[] type, const(char)[] anID)

Retrieves a reference without the static type

reference
RT* reference(const(char)[] anID)

Retrieves a reference.

referenceID
const(char)[] referenceID(RT* aReference)
const(char)[] referenceID(RT aReference)

Indicates the reference ID of a variable.

referenceID
const(char)[] referenceID(const(char)[] type, void* aReference)

Indicates the reference ID of a variable, without using its static type.

removeReference
auto removeReference(const(char)[] anID)

Tries to remove the reference matching to an ID.

removeReference
void removeReference(RT* aReference)
void removeReference(RT aReference)

Removes a reference.

removeReferences
void removeReferences()

Removes all the references for a type.

reset
void reset()

Empties the references and the types.

storeReference
bool storeReference(RT* aReference, const(char)[] anID)
bool storeReference(RT aReference, const(char)[] anID)

Tries to store a reference.

storeType
void storeType()

Stores a type. This is a convenience function since storeReference() automatically stores a type when needed.

Meta