telephonyserverplugins/common_tsy/commontsy/src/mmpacket/cmmmbmscontextlist.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    14 //
    14 //
    15 
    15 
    16 
    16 
    17 
    17 
    18 // INCLUDE FILES
    18 // INCLUDE FILES
       
    19 
       
    20 #include "OstTraceDefinitions.h"
       
    21 #ifdef OST_TRACE_COMPILER_IN_USE
       
    22 #include "cmmmbmscontextlistTraces.h"
       
    23 #endif
       
    24 
    19 #include "cmmmbmscontextlist.h"
    25 #include "cmmmbmscontextlist.h"
    20 
    26 
    21 // ============================ MEMBER FUNCTIONS ===============================
    27 // ============================ MEMBER FUNCTIONS ===============================
    22 
    28 
    23 // ---------------------------------------------------------------------------
    29 // ---------------------------------------------------------------------------
    30     }
    36     }
    31 
    37 
    32 CMmMBMSContextList* CMmMBMSContextList::NewL()
    38 CMmMBMSContextList* CMmMBMSContextList::NewL()
    33     {
    39     {
    34 
    40 
    35 TFLOGSTRING("TSY: CMmMBMSContextList* CMmMBMSContextList::NewL." );
    41 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTLIST_NEWL_1, "TSY: CMmMBMSContextList* CMmMBMSContextList::NewL." );
    36 
    42 
    37     CMmMBMSContextList* const contextList =
    43     CMmMBMSContextList* const contextList =
    38         new ( ELeave ) CMmMBMSContextList();
    44         new ( ELeave ) CMmMBMSContextList();
    39 
    45 
    40     CleanupStack::PushL( contextList );
    46     CleanupStack::PushL( contextList );
    67 // (other items were commented in a header).
    73 // (other items were commented in a header).
    68 // ---------------------------------------------------------------------------
    74 // ---------------------------------------------------------------------------
    69 //
    75 //
    70 TInt CMmMBMSContextList::AddContext( CMmMBMSContextTsy* aContext )      
    76 TInt CMmMBMSContextList::AddContext( CMmMBMSContextTsy* aContext )      
    71     {
    77     {
    72 TFLOGSTRING("TSY: CMmMBMSContextList::AddContext.");
    78 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTLIST_ADDCONTEXT_1, "TSY: CMmMBMSContextList::AddContext.");
    73 
    79 
    74     TInt ret( KErrArgument );
    80     TInt ret( KErrArgument );
    75     
    81     
    76     ret = CMmTsyObjectList::AddObject( aContext );
    82     ret = CMmTsyObjectList::AddObject( aContext );
    77     
    83     
    86 // ---------------------------------------------------------------------------
    92 // ---------------------------------------------------------------------------
    87 //
    93 //
    88 TInt CMmMBMSContextList::RemoveContext( CMmMBMSContextTsy* aContext )
    94 TInt CMmMBMSContextList::RemoveContext( CMmMBMSContextTsy* aContext )
    89     {
    95     {
    90 
    96 
    91 TFLOGSTRING("TSY: CMmMBMSContextList::RemoveContext." );
    97 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTLIST_REMOVECONTEXT_1, "TSY: CMmMBMSContextList::RemoveContext." );
    92 
    98 
    93     TInt ret = RemoveObject(aContext);
    99     TInt ret = RemoveObject(aContext);
    94 
   100 
    95     return ret;
   101     return ret;
    96     }
   102     }
   102 // (other items were commented in a header).
   108 // (other items were commented in a header).
   103 // ---------------------------------------------------------------------------
   109 // ---------------------------------------------------------------------------
   104 //
   110 //
   105 CMmMBMSContextTsy* CMmMBMSContextList::ContextByIndex( TInt aIndex ) const
   111 CMmMBMSContextTsy* CMmMBMSContextList::ContextByIndex( TInt aIndex ) const
   106     {
   112     {
   107 TFLOGSTRING2("TSY: CMmMBMSContextList::ContextByIndex. aIndex: %d", aIndex );
   113 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTLIST_CONTEXTBYINDEX_1, "TSY: CMmMBMSContextList::ContextByIndex. aIndex: %d", aIndex );
   108 	return (CMmMBMSContextTsy*)GetObjectByIndex(aIndex);
   114 	return (CMmMBMSContextTsy*)GetObjectByIndex(aIndex);
   109     }
   115     }
   110 
   116 
   111 // ---------------------------------------------------------------------------
   117 // ---------------------------------------------------------------------------
   112 // CMmMBMSContextList::ContextByName
   118 // CMmMBMSContextList::ContextByName
   115 // ---------------------------------------------------------------------------
   121 // ---------------------------------------------------------------------------
   116 //
   122 //
   117 CMmMBMSContextTsy* CMmMBMSContextList::ContextByName(
   123 CMmMBMSContextTsy* CMmMBMSContextList::ContextByName(
   118         const TInfoName& aName ) //name of the context
   124         const TInfoName& aName ) //name of the context
   119     {
   125     {
   120 TFLOGSTRING2("TSY: CMmMBMSContextList::ContextByName. Context Name: %S ", &aName );
   126 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTLIST_CONTEXTBYNAME_1, "TSY: CMmMBMSContextList::ContextByName. Context Name: %S ", aName );
   121     // Find name from context info list
   127     // Find name from context info list
   122     TInt size = NumberOfContexts();    
   128     TInt size = NumberOfContexts();    
   123     for ( TInt i = 0; i < size; i++ )
   129     for ( TInt i = 0; i < size; i++ )
   124         {
   130         {
   125         CMmMBMSContextTsy* current = ContextByIndex(i);
   131         CMmMBMSContextTsy* current = ContextByIndex(i);
   156 TInt CMmMBMSContextList::GenerateNewContextName(
   162 TInt CMmMBMSContextList::GenerateNewContextName(
   157         TDes& aNewName,     //name of the context
   163         TDes& aNewName,     //name of the context
   158         TUint8& aProxyId,     //proxy id of the context
   164         TUint8& aProxyId,     //proxy id of the context
   159         TInt aMaxContexts )
   165         TInt aMaxContexts )
   160     {
   166     {
   161 TFLOGSTRING("TSY: CMmMBMSContextList::GenerateNewContextName." );    
   167 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTLIST_GENERATENEWCONTEXTNAME_1, "TSY: CMmMBMSContextList::GenerateNewContextName." );
   162     
   168     
   163 	if(aMaxContexts <= NumberOfContexts() )
   169 	if(aMaxContexts <= NumberOfContexts() )
   164 		{
   170 		{
   165 		return KErrOverflow;
   171 		return KErrOverflow;
   166 		}
   172 		}
   187 // (other items were commented in a header).
   193 // (other items were commented in a header).
   188 // ---------------------------------------------------------------------------
   194 // ---------------------------------------------------------------------------
   189 //
   195 //
   190 TBool CMmMBMSContextList::IsMbmsContextReceiving()
   196 TBool CMmMBMSContextList::IsMbmsContextReceiving()
   191 	{
   197 	{
   192 TFLOGSTRING("TSY: CMmMBMSContextList::IsMbmsContextReceiving." );  	
   198 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CMMMBMSCONTEXTLIST_ISMBMSCONTEXTRECEIVING_1, "TSY: CMmMBMSContextList::IsMbmsContextReceiving." );
   193 	TInt size = NumberOfContexts();
   199 	TInt size = NumberOfContexts();
   194 	for( TInt i = 0; i < size; i++ )
   200 	for( TInt i = 0; i < size; i++ )
   195         {
   201         {
   196        	
   202        	
   197        	if( RPacketContext::EStatusReceiving == ContextByIndex( i )->ContextStatus() )
   203        	if( RPacketContext::EStatusReceiving == ContextByIndex( i )->ContextStatus() )