diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-EB6A14CF-05DA-5EAD-AB68-F6511907DF05.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-EB6A14CF-05DA-5EAD-AB68-F6511907DF05.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,21 @@ + + + + + +Use of the Externalize class

The implementation of the family of operators operator<<() calls the internal Symbian OS function DoExternalizeL(). There are two variants of this function distinguished by the value of the third parameter as either Externalize::Member or Externalize::Function.

The family of operators operator<<() are implemented as follows:

template <class T> +inline RWriteStream& operator<<(RWriteStream& aStream,const T& anObject) + { + DoExternalizeL(anObject,aStream,Externalization(&anObject)); + return aStream; + }

The two variants of DoExternalizeL() are defined and implemented as:

template <class T> +inline void DoExternalizeL(const T& anObject,RWriteStream& aStream,Externalize::Member) + {anObject.ExternalizeL(aStream);} template <class T> +inline void DoExternalizeL(const T& anObject,RWriteStream& aStream,Externalize::Function) + {ExternalizeL(anObject,aStream);}

The variant called depends on the value returned from a call to the internal selector function, Externalization(). This selector function returns either Externalize::Function or Externalize::Member, depending on the type of anObject.

The internal selector function Externalization() is a convenience mechanism that allows the operator<<() to call either the ExternalizeL() member function of a templated class or an ExternalizeL() templated global function.

The store framework defines and implements a default selector function, prototyped as:

Externalize::Member Externalization(const TAny*)

By default, a call to Externalization() passing a parameter of general class type, is resolved at compile time into a call to this variant, and the return type is Externalize::Member. The store framework also defines and implements a number of other variants that take more specific argument types; for example, as part of its implementation of operator<<() for descriptors, the framework defines and implements:

Externalize::Function Externalization(const TDesC8*)
\ No newline at end of file