ncdengine/inc/ncdpanics.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 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:   NCD Provider panic code definitions.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef NCD_PANICS_H
       
    20 #define NCD_PANICS_H
       
    21 
       
    22 /** Catalogs Engine panic category name */
       
    23 _LIT( KNcdPanicCategory, "NCD" );
       
    24 
       
    25 
       
    26 /** Catalogs Engine panic category panic codes */
       
    27 enum TNcdPanic
       
    28     {
       
    29 
       
    30     /** Raised when an invalid argument is passed to a method, caused by a programming error */
       
    31     ENcdPanicInvalidArgument = 0,
       
    32     
       
    33     /** Raised when an invalid index is passed to a method, caused by a programming error */
       
    34     ENcdPanicIndexOutOfRange,
       
    35     
       
    36     /** Raised when data that should exist, does not. Caused by a programming error */    
       
    37     ENcdPanicNoData
       
    38 
       
    39     };
       
    40 
       
    41 #define NCD_ASSERT_ALWAYS( decl, panic ) if ( !(decl) ) { DLERROR(("NCD assertion failed")); User::Panic( KNcdPanicCategory, (panic) ); }
       
    42 
       
    43 #ifdef CATALOGS_DEBUG_ASSERTS
       
    44 #   define NCD_ASSERT( decl, panic ) NCD_ASSERT_ALWAYS( (decl), (panic) );
       
    45 #else
       
    46 #   define NCD_ASSERT( decl, panic ) 
       
    47 #endif
       
    48 
       
    49 
       
    50     
       
    51 
       
    52 #endif // NCD_PANICS_H