commsfwtools/commstools/utracedecoder/inc/messagedefparser/aliasidentifier.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2007-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 #ifndef ALIASIDENTIFIER_H
       
    17 #define ALIASIDENTIFIER_H
       
    18 
       
    19 #include "nodemessagetypes.h"
       
    20 
       
    21 namespace Parser
       
    22 {
       
    23 const int KAliasIdentifier = 0x0001;
       
    24 
       
    25 template<typename BASECLASS>
       
    26 class CAliasIdentifier : public BASECLASS
       
    27     {
       
    28     public:
       
    29         explicit CAliasIdentifier<BASECLASS>(const char* aName, const BASECLASS* aIdentifier)
       
    30             : BASECLASS(aName), iIdentifier(aIdentifier)
       
    31             {
       
    32             iFlags |= KAliasIdentifier;
       
    33             }
       
    34 
       
    35         virtual void Describe(const unsigned char* aData, unsigned int aLength, const void* aOptions, std::ostream& aDescription) const;
       
    36         virtual int TotalSize() const;
       
    37 
       
    38         const char* RealName() const;
       
    39 
       
    40     private:
       
    41         const BASECLASS* iIdentifier;
       
    42     };
       
    43 
       
    44 
       
    45 template<typename BASECLASS>
       
    46 void CAliasIdentifier<BASECLASS>::Describe(const unsigned char *aData, unsigned int aLength, const void *aOptions, std::ostream &aDescription) const
       
    47     {
       
    48     iIdentifier->Describe(aData, aLength, aOptions, aDescription);
       
    49     }
       
    50 
       
    51 
       
    52 template<typename BASECLASS>
       
    53 int CAliasIdentifier<BASECLASS>::TotalSize() const
       
    54     {
       
    55     return iIdentifier->TotalSize();
       
    56     }
       
    57 
       
    58 template<typename BASECLASS>
       
    59 const char* CAliasIdentifier<BASECLASS>::RealName() const
       
    60     {
       
    61     return iIdentifier->Name();
       
    62     }
       
    63 
       
    64 } // namespace Parser
       
    65 
       
    66 #endif
       
    67 // ALIASIDENTIFIER_H
       
    68