examples/ForumNokia/Symbian_OS_End-to-End_Sockets_API_Example/SocketTaskManager_S60/inc/TaskManagerEngineReader.h

00001 /*
00002 * ============================================================================
00003 *  Name     : CTaskManagerEngineReader from TaskManagerEngineReader.h
00004 *  Part of  : TaskManager
00005 *  Created  : 15/03/2006 by Forum Nokia
00006 *  Version  : 1.2
00007 *  Copyright: Nokia Corporation
00008 * ============================================================================
00009 */
00010 
00011 #ifndef __TASKMANAGERENGINEREADER_H__
00012 #define __TASKMANAGERENGINEREADER_H__
00013 
00014 // INCLUDE FILES
00015 #include <in_sock.h>
00016 
00017 // FORWARD DECLARATIONS
00018 class CSecureSocket;
00019 
00020 // CLASS DECLARATIONS
00021 
00025 class MEngineNotifier
00026     {
00027 public:
00028     virtual TBool PackageReceivedL( const TDesC8& aData ) = 0;
00029     };
00030 
00031 
00036 class CTaskManagerEngineReader : public CActive
00037     {
00038 public:
00039 
00043         static CTaskManagerEngineReader* NewL( MEngineNotifier& aNotifier );
00044     static CTaskManagerEngineReader* NewLC( MEngineNotifier& aNotifier );
00045 
00049         ~CTaskManagerEngineReader();
00050 
00054         void Start();
00055         
00060     void SetSecureSocket( CSecureSocket* aSocket );
00061 
00062 protected: // from CActive
00063 
00067         void DoCancel();
00068 
00072         void RunL();    
00073 
00074 private:
00075 
00080         CTaskManagerEngineReader( MEngineNotifier& aNotifier );
00081 
00085         void ConstructL();
00086 
00090         void IssueRead();
00091 
00092 private: // Member variables
00093 
00094     // The size of the read buffer in bytes.
00095     enum { KReadBufferSize = 20 };
00096 
00097     // Socket to read data from.
00098     CSecureSocket*          iSocket;
00099 
00100     // Buffer for receiving data.
00101         TBuf8<KReadBufferSize>  iBuffer;
00102 
00103     // Handle to notify engine.
00104     MEngineNotifier&        iNotifier;
00105     
00106     // Stores the amount of bytes read from socket.
00107     // Must be defined even though it's not used anywhere except when reading.
00108     TSockXfrLength          iDummyLength;
00109     };
00110 
00111 #endif
00112 
00113 // End of file

Generated by  doxygen 1.6.2