homescreensrv_plat/ai_content_model_api/inc/aicontentobserver.inl
branchRCL_3
changeset 8 d0529222e3f0
parent 0 79c6a41cd166
equal deleted inserted replaced
4:1a2a00e78665 8:d0529222e3f0
    13 *
    13 *
    14 * Description:  Inline function implementations for aicontentobserver.h
    14 * Description:  Inline function implementations for aicontentobserver.h
    15 *
    15 *
    16 */
    16 */
    17 
    17 
       
    18 #ifndef _AICONTENTOBSERVER_INL
       
    19 #define _AICONTENTOBSERVER_INL
    18 
    20 
    19 inline TInt MAiContentObserver::PublishPtr
    21 // ---------------------------------------------------------------------------
    20         (MAiPropertyExtension& aPlugin, TInt aContent, TAny* aPtr, TInt aIndex)
    22 // MAiContentObserver::PublishPtr
       
    23 //
       
    24 // ---------------------------------------------------------------------------
       
    25 //
       
    26 inline TInt MAiContentObserver::PublishPtr( CHsContentPublisher& aPlugin, 
       
    27     TInt aContent, TAny* aPtr, TInt aIndex )        
    21     {
    28     {
    22     // Package the pointer to a buffer and delegate to buffer publish method
    29     // Package the pointer to a buffer and delegate to buffer publish method
    23     return this->Publish(aPlugin, aContent, TPckgC<TAny*>(aPtr), aIndex);
    30     return this->Publish( aPlugin, aContent, TPckgC<TAny*>( aPtr ), aIndex );
    24     }
    31     }
    25 
    32 
    26 template<class PtrT> inline 
    33 // ---------------------------------------------------------------------------
    27 PtrT* MAiContentObserver::UnpackPtr(const TDesC8& aBuf)
    34 // MAiContentObserver::UnpackPtr
       
    35 //
       
    36 // ---------------------------------------------------------------------------
       
    37 //
       
    38 template< class PtrT > inline PtrT* MAiContentObserver::UnpackPtr( 
       
    39     const TDesC8& aBuf )
    28     {
    40     {
    29     TAny* result = NULL;
    41     TAny* result( NULL );
       
    42     
    30     if ( aBuf.Size() == sizeof( TAny* ) )
    43     if ( aBuf.Size() == sizeof( TAny* ) )
    31         {
    44         {
    32         TPckg<TAny*>(result).Copy(aBuf); // Effectively writes aBuf contents to result
    45         // Effectively writes aBuf contents to result
       
    46         TPckg< TAny* >( result ).Copy( aBuf ); 
    33         }
    47         }
    34     return static_cast<PtrT*>(result);
    48         
       
    49     return static_cast< PtrT* >( result );
    35     }
    50     }
    36 
    51 
       
    52 #endif // _AICONTENTOBSERVER_INL
       
    53 
    37 // End of file    
    54 // End of file