ncdengine/provider/server/inc/ncdstorable.h
changeset 4 32704c33136d
equal deleted inserted replaced
-1:000000000000 4:32704c33136d
       
     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:   Contains MStorable interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef M_NCD_STORABLE_H
       
    20 #define M_NCD_STORABLE_H
       
    21 
       
    22 
       
    23 // RWriteStream, RReadStream
       
    24 #include <s32strm.h> 
       
    25 
       
    26 
       
    27 /**
       
    28  * Interface for items that may be inserted to the database.
       
    29  *
       
    30  * @note Objects that are inserted to the database should
       
    31  * implement MNcdStorageDataItem-interface. This interface
       
    32  * is meant for the objects that MNcdStorageDataItem-object
       
    33  * may want to insert to the database. In other words,
       
    34  * MNcdStorageDataItem-forwards InternalizeL and ExternalizeL
       
    35  * calls to the objects that implement this interface.
       
    36  *
       
    37  */
       
    38 class MNcdStorable
       
    39 {
       
    40 
       
    41 public:
       
    42 
       
    43     /** 
       
    44      * Destructor
       
    45      *
       
    46      * By safety reasons it is always good idea to implement
       
    47      * virtual destructor for interfaces. If the object
       
    48      * is deleted using this interface, then also destructors
       
    49      * of child classes will be called.
       
    50      */
       
    51     virtual ~MNcdStorable() { }
       
    52 
       
    53     /**
       
    54      * Writes the implementing object's data to the stream
       
    55      *
       
    56      * @param aStream Write stream
       
    57      */
       
    58     virtual void ExternalizeL( RWriteStream& aStream ) = 0;
       
    59 
       
    60 
       
    61     /**
       
    62      * Reads the implementing object's data from the stream
       
    63      * 
       
    64      * @param aStream Read stream
       
    65      */
       
    66     virtual void InternalizeL( RReadStream& aStream ) = 0;    
       
    67 };
       
    68 
       
    69 
       
    70 #endif // M_NCD_STORABLE_H