IMPSengine/datautils/inc/impssessionident.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002 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: Identification of unique CSP session
       
    15 * 
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CIMPSSESSIONIDENT_H
       
    20 #define CIMPSSESSIONIDENT_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <s32file.h>
       
    25 
       
    26 
       
    27 // CLASS DECLARATION
       
    28 
       
    29 
       
    30 // Identification of unique CSP session.
       
    31 // Notice that this class does not store any data and thus this
       
    32 // can be used only for passing CSP identification in function calls.
       
    33 // References to data members are temporary only and may not be valid
       
    34 // after function call, and thus each class entity should make an own
       
    35 // copy of data if it needs that data later on.
       
    36 class TImpsSessionIdent
       
    37     {
       
    38     public:
       
    39         /**
       
    40         * Constructor
       
    41         * @param aSID CSP session id
       
    42         * @param aSAP SAP address
       
    43         * @param aUserId WV user id
       
    44         */
       
    45         IMPORT_C TImpsSessionIdent( const TDesC& aSID,
       
    46                                     const TDesC& aSAP, const TDesC& aUserId );
       
    47 
       
    48     public:  // New methods
       
    49 
       
    50         /**
       
    51         * Accessors
       
    52         */
       
    53         inline TPtrC SID() const;
       
    54         inline TPtrC SAP() const;
       
    55         inline TPtrC UserId() const;
       
    56 
       
    57         /**
       
    58         * check if all fields are zero length
       
    59         * @return ETrue if all is zero
       
    60         */
       
    61         inline TBool IsZero() const;
       
    62 
       
    63     private:    // Data
       
    64         const TDesC&           iSID;
       
    65         const TDesC&           iSAP;
       
    66         const TDesC&           iUserId;
       
    67 
       
    68     };
       
    69 
       
    70 
       
    71 inline TPtrC TImpsSessionIdent::SID() const
       
    72     {
       
    73     return iSID;
       
    74     }
       
    75 
       
    76 inline TPtrC TImpsSessionIdent::SAP() const
       
    77     {
       
    78     return iSAP;
       
    79     }
       
    80 
       
    81 inline TPtrC TImpsSessionIdent::UserId() const
       
    82     {
       
    83     return iUserId;
       
    84     }
       
    85 
       
    86 inline TBool TImpsSessionIdent::IsZero() const
       
    87     {
       
    88     return ( !iSAP.Length() && !iSID.Length() && !iUserId.Length() ) ? ETrue : EFalse;
       
    89     }
       
    90 
       
    91 
       
    92 #endif      // ?INCLUDE_H   
       
    93 
       
    94 // End of File
       
    95