devicesrv_plat/accessory_policy_utility_api/inc/accpolobjectcon.h
changeset 0 4e1aa6a622a0
child 21 ccb4f6b3db21
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 /*
       
     2  * Copyright (c) 2009 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:  Container for accessory policy name/value pair objects
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef ACCPOLOBJECTCON_H
       
    19 #define ACCPOLOBJECTCON_H
       
    20 
       
    21 #include <accpolobjectbase.h>
       
    22 
       
    23 /**
       
    24  *  Base class for container objects. Objects which are added to container 
       
    25  *  must be inherited from "CAccPolObjectBase" class.
       
    26  *
       
    27  *  @AccPolicy.lib  
       
    28  */
       
    29 class CAccPolObjectCon : public CAccPolObjectBase
       
    30     {
       
    31     
       
    32 public:
       
    33 
       
    34     /**
       
    35      * Destructor.
       
    36      */
       
    37     virtual ~CAccPolObjectCon();                              
       
    38     
       
    39     /**
       
    40      * Resets the object container.
       
    41      * It frees all memory allocated to the array and resets the internal 
       
    42      * state so that it is ready to be reused.
       
    43      *     
       
    44      * @return void.     
       
    45      */     
       
    46     IMPORT_C void Reset();
       
    47     
       
    48     /**
       
    49      * Duplicates the object and adds that to the object container.     
       
    50      *          
       
    51      * @param aObject, Object to be added to container.                
       
    52      * @leave, Leaves with one of the system wide error codes, 
       
    53      *         if the operation fails.
       
    54      * @return void.     
       
    55      */          
       
    56     IMPORT_C void AddL( const CAccPolObjectBase& aObject ); 
       
    57     
       
    58     /**
       
    59      * Gets a reference to the object pointer located at 
       
    60      * the specified position within the array.
       
    61      *          
       
    62      * @param aIndex, Position of object in object container.      
       
    63      * @leave, Leaves with one of the system wide error codes, 
       
    64      *         if the operation fails.
       
    65      * @return CAccPolObjectBase, A const reference to 
       
    66      *         the object pointer at position anIndex within the array.     
       
    67      */
       
    68     IMPORT_C CAccPolObjectBase *const &AtL( TInt aIndex ) const;  
       
    69     
       
    70     /**
       
    71      * Returns the object count.
       
    72      *     
       
    73      * @return TInt, Count of objects in the object container.
       
    74      */
       
    75     IMPORT_C TInt Count() const;
       
    76             
       
    77 protected:    
       
    78                   
       
    79     /**
       
    80      * C++ default constructor.
       
    81      */
       
    82     IMPORT_C CAccPolObjectCon();        
       
    83     
       
    84     /**
       
    85      * C++ default constructor.
       
    86      *
       
    87      * @param aObjectType, Object type.      
       
    88      * @param aObject, Pointer to object container where the object is stored.
       
    89      */
       
    90     IMPORT_C CAccPolObjectCon( TUint8 aObjectType, CAccPolObjectCon* aObject = NULL );
       
    91                           
       
    92 private:  
       
    93      
       
    94     /**
       
    95      * Array for objects which are inherited from CAccObjectBase.
       
    96      */
       
    97     RPointerArray<CAccPolObjectBase> iObjects;
       
    98         
       
    99   };
       
   100 
       
   101 #endif // ACCPOLOBJECTCONBASE_H