IMPSengine/enginc/ImpsIpCirWatcherAPI.inl
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Inline function assemble for IMPS Cir watcher
       
    15 *    
       
    16 */
       
    17 
       
    18 
       
    19 #include <ecom/ecom.h>
       
    20 
       
    21 // ----------------------------------------------------
       
    22 // CImpsTcpCirWatcher::CImpsTcpCirWatcher
       
    23 // 
       
    24 // ----------------------------------------------------
       
    25 //
       
    26 inline CImpsTcpCirWatcher::CImpsTcpCirWatcher() : CActive( EPriorityStandard )
       
    27 	{
       
    28 	}
       
    29 
       
    30 // ----------------------------------------------------
       
    31 // CImpsTcpCirWatcher::~CImpsTcpCirWatcher
       
    32 // 
       
    33 // ----------------------------------------------------
       
    34 //
       
    35 inline CImpsTcpCirWatcher::~CImpsTcpCirWatcher()
       
    36 	{
       
    37 	REComSession::DestroyedImplementation( iDestructorKey );
       
    38     }
       
    39 
       
    40 // ----------------------------------------------------
       
    41 // CImpsTcpCirWatcher::NewL
       
    42 // Create a new TCP/IP CIR Watcher
       
    43 // ----------------------------------------------------
       
    44 //
       
    45 inline CImpsTcpCirWatcher* CImpsTcpCirWatcher::NewL( const TInt aPingInterval,
       
    46     MImpsCirReceiver& aCirReceiver, MMsgConnManager& aConnManager )
       
    47     {
       
    48     TUid KDefaultImplemantationUid = { 0x101FB0EB };
       
    49     TTcpWatcherParameters params( aPingInterval, aCirReceiver, aConnManager );
       
    50     TAny* ptr = REComSession::CreateImplementationL( KDefaultImplemantationUid,
       
    51                                                      _FOFF( CImpsTcpCirWatcher,
       
    52                                                      iDestructorKey ),
       
    53                                                      ( TAny* )&params );
       
    54     return reinterpret_cast<CImpsTcpCirWatcher*>( ptr );
       
    55     }
       
    56 
       
    57 //************** UDP Watcher **************
       
    58 
       
    59 // ----------------------------------------------------
       
    60 // CImpsUdpCirWatcher::CImpsUdpCirWatcher
       
    61 // 
       
    62 // ----------------------------------------------------
       
    63 //
       
    64 inline CImpsUdpCirWatcher::CImpsUdpCirWatcher()
       
    65 	{
       
    66 	}
       
    67 
       
    68 // ----------------------------------------------------
       
    69 // CImpsUdpCirWatcher::~CImpsUdpCirWatcher
       
    70 // 
       
    71 // ----------------------------------------------------
       
    72 //
       
    73 inline CImpsUdpCirWatcher::~CImpsUdpCirWatcher()
       
    74 	{	    
       
    75     }
       
    76     
       
    77 // ----------------------------------------------------
       
    78 // CImpsUdpCirWatcher* CImpsUdpCirWatcher::NewL
       
    79 // Create a new UDP/IP CIR Watcher
       
    80 // ----------------------------------------------------
       
    81 //
       
    82 inline CImpsUdpCirWatcher* CImpsUdpCirWatcher::NewL()
       
    83     {
       
    84     TUid destructorKey;
       
    85     TUid KDefaultImplemantationUid = { 0x101FB0EC };
       
    86     TAny* ptr = REComSession::CreateImplementationL( KDefaultImplemantationUid, destructorKey );
       
    87     CImpsUdpCirWatcher* self = reinterpret_cast<CImpsUdpCirWatcher*>( ptr );
       
    88     self->StoreDestructorKeyL( destructorKey );
       
    89     return self;
       
    90     }
       
    91     
       
    92 // ----------------------------------------------------
       
    93 // CUdpCirWatcher::Destroy
       
    94 // 
       
    95 // ----------------------------------------------------
       
    96 //
       
    97 inline void CImpsUdpCirWatcher::Destroy()
       
    98 	{
       
    99 	if( iDestructorKeyArray.Count() > 0 )
       
   100 	    {
       
   101 	    REComSession::DestroyedImplementation( iDestructorKeyArray[0] );
       
   102 	    iDestructorKeyArray.Remove( 0 );
       
   103 	    if( iDestructorKeyArray.Count() <= 0 )
       
   104 	        iDestructorKeyArray.Close();
       
   105 	    }
       
   106     }
       
   107 
       
   108 // ----------------------------------------------------
       
   109 // CUdpCirWatcher::DeleteSingleton
       
   110 // 
       
   111 // ----------------------------------------------------
       
   112 //
       
   113 inline void CImpsUdpCirWatcher::DeleteSingleton()
       
   114 	{
       
   115     while( iDestructorKeyArray.Count() > 0 )
       
   116         {
       
   117         REComSession::DestroyedImplementation( iDestructorKeyArray[0] );
       
   118         iDestructorKeyArray.Remove( 0 );
       
   119         }
       
   120     iDestructorKeyArray.Close(); 
       
   121     }
       
   122 	
       
   123