Usermode/AxWin4 - Server implementation runnable
[tpg/acess2.git] / Usermode / Applications / axwin4_src / Server / CClient.cpp
1 /*
2  * Acess2 GUI v4
3  * - By John Hodge (thePowersGang)
4  *
5  * CClient.cpp
6  * - IPC Client
7  */
8 #include <CClient.hpp>
9 #include <IIPCChannel.hpp>
10 #include <ipc.hpp>
11
12 namespace AxWin {
13
14 CClient::CClient(::AxWin::IIPCChannel& channel):
15         m_channel(channel)
16 {
17         
18 }
19
20 CClient::~CClient()
21 {
22         ::AxWin::IPC::DeregisterClient(*this);
23 }
24
25 CWindow* CClient::GetWindow(int ID)
26 {
27         if( ID == 0 )
28                 return 0;
29         
30         return m_windows[ID];
31 }
32
33 void CClient::SetWindow(int ID, CWindow* window)
34 {
35         if( m_windows[ID] ) {
36                 delete m_windows[ID];
37         }
38         m_windows[ID] = window;
39 }
40
41 void CClient::HandleMessage(CDeserialiser& message)
42 {
43         try {
44                 IPC::HandleMessage(*this, message);
45                 if( !message.IsConsumed() )
46                 {
47                         _SysDebug("NOTICE - CClient::HandleMessage - Trailing data in message");
48                 }
49         }
50         catch( const ::std::exception& e )
51         {
52                 _SysDebug("ERROR - Exception while processing message from client: %s", e.what());
53         }
54         catch( ... )
55         {
56                 _SysDebug("ERROR - Unknown exception while processing message from client");
57         }
58 }
59
60 };      // namespace AxWin
61

UCC git Repository :: git.ucc.asn.au