commsfwsupport/commselements/NetMeta/inc/MetaContainer.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file 
       
    18  @internalTechnology
       
    19 */
       
    20 
       
    21 #if (!defined METACONTAINER_H)
       
    22 #define METACONTAINER_H
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32std.h>
       
    26 #include <elements/metadata.h>
       
    27 
       
    28 
       
    29 namespace Meta
       
    30 {
       
    31 
       
    32 class RMetaDataContainerBase : public RPointerArray<SMetaData>
       
    33 /**
       
    34 
       
    35 Container of meta objects.
       
    36 Base class.
       
    37 Derived containers need to implement static LoadL.
       
    38 
       
    39 @internalComponent
       
    40 @released since v9.0 */
       
    41     {
       
    42 public:
       
    43 	IMPORT_C explicit RMetaDataContainerBase();
       
    44 
       
    45     IMPORT_C void Copy(const RMetaDataContainerBase& aMetaContainer);
       
    46     IMPORT_C TInt Store(TDes8& aDes) const;
       
    47 
       
    48     IMPORT_C TInt Load(TPtrC8& aDes);
       
    49 	IMPORT_C TInt Length() const;
       
    50 
       
    51 	IMPORT_C STypeId GetTypeId() const;
       
    52 
       
    53 protected:
       
    54 	virtual SMetaData* LoadElementL(TPtrC8& aDes) = 0;
       
    55     };
       
    56 
       
    57 template<class ELEMENT>
       
    58 class RMetaDataContainer : public RMetaDataContainerBase
       
    59 /**
       
    60 
       
    61 Templated container of meta objects that implements static LoadL.
       
    62 Meta object type (template parameter) needs to implement its own static LoadL.
       
    63 
       
    64 @internalComponent
       
    65 @released since v9.0 */
       
    66 	{
       
    67 public:
       
    68 	static RMetaDataContainer<ELEMENT>* LoadL(TPtrC8& aDes);
       
    69 
       
    70 	explicit inline RMetaDataContainer();
       
    71 
       
    72 protected:
       
    73 	virtual SMetaData* LoadElementL(TPtrC8& aDes);
       
    74 	};
       
    75 
       
    76 typedef RMetaDataContainer<SMetaDataECom> RMetaDataEComContainer;
       
    77 
       
    78 } //namespace Meta
       
    79 
       
    80 #include <elements/metacontainer.inl>
       
    81 
       
    82 #endif //METACONTAINER_H
       
    83 
       
    84