commsfwtools/commstools/utracedecoder/inc/eventoutputhandler.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 EVENTOUTPUTHANDLER_H
       
    17 #define EVENTOUTPUTHANDLER_H
       
    18 
       
    19 #include <vector>
       
    20 
       
    21 class CTraceEventBase;
       
    22 
       
    23 class MEventOutputHandler
       
    24     {
       
    25     public:
       
    26         inline bool ShowContextInfo() const
       
    27             {
       
    28             return iShowContextInfo;
       
    29             }
       
    30 
       
    31         inline bool SetShowContextInfo(bool aShowContextInfo)
       
    32             {
       
    33             bool lastValue = iShowContextInfo;
       
    34             iShowContextInfo = aShowContextInfo;
       
    35             return lastValue;
       
    36             }
       
    37 
       
    38         inline bool NewLineEnabled() const
       
    39             {
       
    40 			return iNewLineEnabledStack.size()? iNewLineEnabledStack.back(): false;
       
    41             }
       
    42 
       
    43         inline void PushNewLineEnabled(bool aNewLineEnabled)
       
    44             {
       
    45             iNewLineEnabledStack.push_back(aNewLineEnabled);
       
    46             }
       
    47 
       
    48         inline void PopNewLineEnabled()
       
    49             {
       
    50             iNewLineEnabledStack.pop_back();
       
    51             }
       
    52 
       
    53         inline void SetNewLineEnabled(bool aNewLineEnabled)
       
    54             {
       
    55             while (!iNewLineEnabledStack.empty())
       
    56                 {
       
    57                 iNewLineEnabledStack.pop_back();
       
    58                 }
       
    59             iNewLineEnabledStack.push_back(aNewLineEnabled);
       
    60             }
       
    61 
       
    62         virtual unsigned int CurrentFrame() const = 0;
       
    63         virtual void WriteEvent(const CTraceEventBase& aEvent) const = 0;
       
    64 
       
    65     private:
       
    66         std::vector<bool> iNewLineEnabledStack;
       
    67         bool iShowContextInfo;
       
    68     };
       
    69 
       
    70 #endif
       
    71 // EVENTOUTPUTHANDLER_H
       
    72