epoc-cliapi-server.hpp

Go to the documentation of this file.
00001 // 
00002 // This code is derived from Symbian Ltd provided and copyrighted
00003 // example code from year 2000. Note, however, the boilerplate nature
00004 // of most Symbian client-server code, and therefore the lack of
00005 // originality in such code.
00006 // 
00007 
00008 // Here we define an active object that runs as part of the CL2
00009 // daemon, implementing a Symbian-client server providing access to
00010 // select functionality of the daemon.
00011 // 
00012 // The server runs whenever the CL2 daemon does, and too bad if a
00013 // client tries to use the API when CL2 is not running; this then is
00014 // not a transient server, as one would call it in Symbian vocabulary,
00015 // and not necessarily something that is always running either.
00016 
00017 #ifndef __epoc_cliapi_server_hpp__
00018 #define __epoc_cliapi_server_hpp__
00019 
00020 #include <e32base.h>
00021 
00022 // This is a Symbian active object that receives client requests from
00023 // the kernel and directs them to the appropriate session.
00024 // 
00025 // Either the (inherited) StartL or Start method may be used to
00026 // actually get the server running. Naturally there also is a Cancel
00027 // method, as this class is derived from CActive.
00028 class CCliapiServer : public CServer2
00029 {
00030 public:
00031   static CCliapiServer* NewLC();
00032   static CCliapiServer* NewL();
00033 
00034   // An overload of an inherited method.
00035   // 
00036   // The StartL (or Start) method specifies the name of the server;
00037   // the name is required when clients try to connect. We provide an
00038   // overload of Start that sets the name to be what the client
00039   // library expects.
00040   TInt Start();
00041 
00042   void AddSession();
00043   void DropSession();
00044   void Send(const TDesC& aMessage); // xxx may not want this
00045 
00046 private:
00047   CCliapiServer();
00048   void ConstructL();
00049   CSession2* NewSessionL(const TVersion& aVersion, 
00050        const RMessage2& aMessage) const;
00051 
00052 private:
00053   TInt iSessionCount;
00054 };
00055 
00056 #endif /* __epoc_cliapi_server_hpp__ */

ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:49:52 2011 by Doxygen 1.6.1