#include <s32std.h>
class TSwizzle : public TSwizzleBase |
Public Member Functions | |
---|---|
TSwizzle() | |
TSwizzle(T *) | |
TSwizzle(TStreamId) | |
T * | AsPtr() |
void | ExternalizeL(RWriteStream &) |
operator T *() | |
T & | operator*() |
T * | operator->() |
TSwizzle< T > & | operator=(T *) |
Maintains a dual representation for an object. The representation is:
by stream id, if the object is not in memory (the stream contains the external representation of that object).
by pointer, if the object is in memory.
The template class defines the type of object for which the swizzle is a representation. Full access to the represented object is available through the swizzle.
Maintaining a dual representation for an object allows the loading of objects into memory from a store to be deferred; this is particularly important in complex applications.
TSwizzle | ( | ) | [inline] |
Constructs an uninitialised swizzle. It is necessary because there are also non-default constructors in this class.
TSwizzle | ( | T * | aPtr | ) | [inline] |
Constructs a swizzle for a class T type object, represented by a pointer.
Parameters | |
---|---|
aPtr | A pointer to a class T type object. |
TSwizzle | ( | TStreamId | anId | ) | [inline] |
Constructs a swizzle for a class T type object, represented as a stream id.
Parameters | |
---|---|
anId | The id of a stream containing the external representation of a class T type object. |
T * | AsPtr | ( | ) | const [inline] |
Returns a pointer to the object which this swizzle represents.
Note that the indirect component selector operator->() can be used to access members of the represented object.
void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [inline] |
Externalises the stream id of the stream associated with this swizzle.
This function presupposes that:
a store map, i.e. an object of type CStoreMap, has been constructed
the id of the stream containing the external representation of the represented type T object has been bound to this swizzle and added to the store map.
the concrete stream referenced by aStream has been constructed, specifying the store map as an externaliser.
The presence of this function means that the standard templated operator<<() can be used.
See also: CStoreMap
Parameters | |
---|---|
aStream | Stream to which the stream id should be externalised. |
operator T * | ( | ) | const [inline] |
T & | operator* | ( | ) | const [inline] |
Returns a reference to the type T object which this swizzle represents.
T * | operator-> | ( | ) | const [inline] |
Gives access to members of the type T object which this swizzle represents.
Note, use the AsPtr() member function to return a pointer to the object itself.
TSwizzle< T > & | operator= | ( | T * | aPtr | ) | [inline] |
Sets this swizzle to represent the in-memory type T object, pointed to by the specified T* pointer.
Parameters | |
---|---|
aPtr | A pointer to an object of type T which the swizzle is to represent. |