accessoryservices/accessoryserver/src/Policy/AccConGenericID.cpp
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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:  Public, heap-allocated Generic ID
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include <AccConGenericID.h>
       
    21 #include "acc_debug.h"
       
    22 
       
    23 // EXTERNAL DATA STRUCTURES
       
    24 
       
    25 // EXTERNAL FUNCTION PROTOTYPES  
       
    26 
       
    27 // CONSTANTS
       
    28 const TInt KAccSrvCapabilityBufInitialSize = 50;
       
    29 
       
    30 // MACROS
       
    31 
       
    32 // LOCAL CONSTANTS AND MACROS
       
    33 
       
    34 // MODULE DATA STRUCTURES
       
    35 
       
    36 // LOCAL FUNCTION PROTOTYPES
       
    37 
       
    38 // FORWARD DECLARATIONS
       
    39 
       
    40 // ============================= LOCAL FUNCTIONS ===============================
       
    41 
       
    42 // ============================ MEMBER FUNCTIONS ===============================
       
    43 
       
    44 // -----------------------------------------------------------------------------
       
    45 // CAccConGenericID::CAccConGenericID
       
    46 // C++ default constructor can NOT contain any code, that
       
    47 // might leave.
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 CAccConGenericID::CAccConGenericID()
       
    51     {
       
    52     API_TRACE_( "[AccFW:ACCPOLICY] CAccConGenericID::CAccConGenericID()" );
       
    53     }
       
    54 
       
    55 // -----------------------------------------------------------------------------
       
    56 // CAccConGenericID::ConstructL
       
    57 // Symbian 2nd phase constructor can leave.
       
    58 // -----------------------------------------------------------------------------
       
    59 //
       
    60 void CAccConGenericID::ConstructL()
       
    61     {
       
    62     API_TRACE_( "[AccFW:ACCPOLICY] CAccConGenericID::ConstructL()" );
       
    63     
       
    64     iNameValueBuf = CBufFlat::NewL( KAccSrvCapabilityBufInitialSize );
       
    65     
       
    66     API_TRACE_( "[AccFW:ACCPOLICY] CAccConGenericID::ConstructL - return void" );
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CAccConGenericID::NewL
       
    71 // Two-phased constructor.
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 EXPORT_C CAccConGenericID* CAccConGenericID::NewL()
       
    75     {
       
    76     API_TRACE_( "[AccFW:ACCPOLICY] CAccConGenericID::NewL()" );
       
    77     
       
    78     CAccConGenericID* self = new( ELeave ) CAccConGenericID();
       
    79     
       
    80     CleanupStack::PushL( self );
       
    81     self->ConstructL();
       
    82     CleanupStack::Pop( self );
       
    83 
       
    84     API_TRACE_( "[AccFW:ACCPOLICY] CAccConGenericID::NewL - return self" );
       
    85 
       
    86     return self;
       
    87     }
       
    88 
       
    89     
       
    90 // Destructor
       
    91 EXPORT_C CAccConGenericID::~CAccConGenericID()
       
    92     {
       
    93     API_TRACE_( "[AccFW:ACCPOLICY] CAccConGenericID::~CAccConGenericID()" );
       
    94     
       
    95     if( iNameValueBuf )
       
    96         {
       
    97         delete iNameValueBuf;
       
    98         }
       
    99         
       
   100     API_TRACE_( "[AccFW:ACCPOLICY] CAccConGenericID::~CAccConGenericID - return" );
       
   101     }
       
   102 
       
   103 // -----------------------------------------------------------------------------
       
   104 // CAccConGenericID::GenericID()
       
   105 // -----------------------------------------------------------------------------
       
   106 //
       
   107 EXPORT_C TAccPolGenericID CAccConGenericID::GenericID() const
       
   108     {    
       
   109     API_TRACE_( "[AccFW:ACCPOLICY] CAccConGenericID::GenericID()" );
       
   110     return iGenericID;    
       
   111     }
       
   112 
       
   113 // ========================== OTHER EXPORTED FUNCTIONS =========================
       
   114 
       
   115 //  End of File