|
||
class TSwizzle : public TSwizzleBase;
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.
TSwizzleCBase
-
Base class for swizzles.
TSwizzleBase
-
Implementation class for swizzles.
TSwizzle
-
Maintains a dual representation for an object. The representation is:
Defined in TSwizzle
:
AsPtr()const
Returns a pointer to the object which this swizzle represents.ExternalizeL(RWriteStream &)const
Externalises the stream id of the stream associated with this swizzle.TSwizzle()
Constructs an uninitialised swizzle. It is necessary because there are also non-...TSwizzle(T *)
Constructs a swizzle for a class T type object, represented by a pointer.TSwizzle(TStreamId)
Constructs a swizzle for a class T type object, represented as a stream id.operator *()const
Returns a reference to the type T object which this swizzle represents.operator T *()const
operator->()const
Gives access to members of the type T object which this swizzle represents.operator=(T *)
Sets this swizzle to represent the in-memory type T object, pointed to by the sp...Inherited from TSwizzleBase
:
Inherited from TSwizzleCBase
:
AsId()const
Gets the streamid of the represented object.DoExternalizeL(RWriteStream &,TExternalizer< TAny >)const
InternalizeL(RReadStream &)
Internalises a stream id from the read stream, constructs a swizzle from this st...IsId()const
Tests whether this swizzle currently represents an object as a stream id.IsPtr()const
Tests whether this swizzle currently represents an object as a pointer.TSwizzleCBase(TStreamId)
TSwizzleCBase(TStreamRef)
TSwizzleCBase(const TAny *)
operator!=(const TAny *)const
Compares for inequality with an in-memory object.operator!=(const TSwizzleCBase &)const
Compares for inequality with another swizzle.operator==(const TAny *)const
Compares for equality with an in-memory object.operator==(const TSwizzleCBase &)const
Compares for equality with another swizzle.inline TSwizzle();
Constructs an uninitialised swizzle. It is necessary because there are also non-default constructors in this class.
inline TSwizzle(T *aPtr);
Constructs a swizzle for a class T type object, represented by a pointer.
|
inline TSwizzle(TStreamId anId);
Constructs a swizzle for a class T type object, represented as a stream id.
|
inline TSwizzle< T >& operator=(T *aPtr);
Sets this swizzle to represent the in-memory type T object, pointed to by the specified T* pointer.
|
|
inline T* AsPtr() const;
Returns a pointer to the object which this swizzle represents.
Note that the indirect component selector TSwizzle::operator->()const
can be used to access members of the represented object.
|
inline T& operator *() const;
Returns a reference to the type T object which this swizzle represents.
|
inline T* operator->() const;
Gives access to members of the type T object which this swizzle represents.
Note, use the TSwizzle::AsPtr()const
member function to return a pointer to the object itself.
|
inline void ExternalizeL(RWriteStream &aStream) const;
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<<(RWriteStream &,const T &)
can be used.
|