logsui/logsengine/inc/logsduplicatelookup.h
changeset 16 c5af8598d22c
equal deleted inserted replaced
14:f27aebe284bb 16:c5af8598d22c
       
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef LOGSDUPLICATELOOKUP_H
       
    19 #define LOGSDUPLICATELOOKUP_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <QList>
       
    23 #include <QHash>
       
    24 
       
    25 // FORWARD DECLARATION
       
    26 class LogsEvent;
       
    27 
       
    28 typedef QHash<QString, LogsEvent*> LogsLookupHash;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 class LogsDuplicateLookup {
       
    32 public:
       
    33     explicit LogsDuplicateLookup();
       
    34     virtual ~LogsDuplicateLookup();
       
    35     
       
    36     void invalidate();
       
    37     void cleanup();
       
    38     int addLookupEntry( LogsEvent& event );
       
    39     LogsEvent* findDuplicate( const LogsEvent& event ) const;
       
    40 private:
       
    41     QString constructLookupKey( const LogsEvent& event ) const;
       
    42     bool validLookupEvent( const LogsEvent& event ) const;
       
    43     
       
    44 private:
       
    45     QList< LogsLookupHash* > mDirectionLookupTables;
       
    46     
       
    47 private: // For testing
       
    48     
       
    49     friend class UT_LogsDuplicateLookup;
       
    50     friend class UT_LogsReaderStates;
       
    51 };
       
    52                 
       
    53 
       
    54 #endif      // LOGSDUPLICATELOOKUP_H
       
    55 
       
    56 
       
    57 // End of File
       
    58       
       
    59 
       
    60         
       
    61