PECengine/AttributeLibrary2/Src/CPEngSessionSlotObject.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Base class for session slot, reference counted objects.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPENGSESSIONSLOTOBJECT_H
       
    19 #define CPENGSESSIONSLOTOBJECT_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <E32Base.h>
       
    23 
       
    24 
       
    25 
       
    26 //FORWARD DECLARATION
       
    27 class CPEngSessionSlotObjectCon;
       
    28 class CPEngSessionSlotId;
       
    29 
       
    30 
       
    31 
       
    32 // CLASS DECLARATION
       
    33 /**
       
    34  * Base class for session slot, reference counted objects.
       
    35  *
       
    36  * @since 3.0
       
    37  */
       
    38 NONSHARABLE_CLASS( CPEngSessionSlotObject ) : public CBase
       
    39     {
       
    40 public:  // Access count &  Destructor
       
    41 
       
    42     /**
       
    43      * Destructor.
       
    44      */
       
    45     virtual ~CPEngSessionSlotObject();
       
    46 
       
    47 
       
    48     /**
       
    49      * Opens the reference to object.
       
    50      *
       
    51      * @since 3.0
       
    52      */
       
    53     virtual void Open();
       
    54 
       
    55 
       
    56     /**
       
    57      * Closes the reference to object.
       
    58      *
       
    59      * @since 3.0
       
    60      */
       
    61     virtual void Close();
       
    62 
       
    63 
       
    64 
       
    65 protected:  // Constructors
       
    66 
       
    67     /**
       
    68      * C++ default constructor.
       
    69      */
       
    70     CPEngSessionSlotObject();
       
    71 
       
    72 
       
    73     /**
       
    74      * Symbian OS constructor.
       
    75      * Derived class must call this to provide
       
    76      * the session slot id.
       
    77      */
       
    78     void ConstructL( const CPEngSessionSlotId& aSlotId );
       
    79 
       
    80 
       
    81 
       
    82 public:  //New functions
       
    83 
       
    84 
       
    85     /**
       
    86      * Reference to session slot ID where
       
    87      * the object is connected.
       
    88      *
       
    89      * @since 3.0
       
    90      * @return The session slot ID.
       
    91      */
       
    92     const CPEngSessionSlotId& SlotId() const;
       
    93 
       
    94 
       
    95     /**
       
    96      * Sets the object owner.
       
    97      * Owner can be set only once.
       
    98      *
       
    99      * @since 3.0
       
   100      * @param aOwner The object owner.
       
   101      */
       
   102     void SetOwner( CObject& aOwner );
       
   103 
       
   104 
       
   105     /**
       
   106      * Gets the object's current
       
   107      * reference count.
       
   108      *
       
   109      * @since 3.0
       
   110      * @return The object current reference count.
       
   111      */
       
   112     TInt RefCount() const;
       
   113 
       
   114 
       
   115 
       
   116 private:    // Friend declaration
       
   117 
       
   118     /**
       
   119      * Friend declaration.
       
   120      *
       
   121      * @since 3.0
       
   122      */
       
   123     friend class CPEngSessionSlotObjectCon;     // CSI: 36 #
       
   124 
       
   125 
       
   126 
       
   127 private:    // Data
       
   128 
       
   129     //OWN: Reference access count
       
   130     TInt    iAccessCount;
       
   131 
       
   132     //OWN: Session slot ID.
       
   133     CPEngSessionSlotId*     iSlotId;
       
   134 
       
   135     //REF: The container.
       
   136     CPEngSessionSlotObjectCon*  iContainer;
       
   137 
       
   138     //REF: The owner.
       
   139     CObject*    iOwner;
       
   140 
       
   141     };
       
   142 
       
   143 
       
   144 #endif      // CPENGSESSIONSLOTOBJECT_H
       
   145 
       
   146 // End of File