Atlas-C++
wrapperClient.h
1 #include <Atlas/Net/Client.h>
2 #include <Python.h>
3 
4 #ifdef SWIG
5 %typemap(python,default) Filter* {
6  $target=0;
7 }
8 
9 %typemap(python,in) PyObject *instance {
10  $target = $source;
11 }
12 
13 
14 class wrapperClient {
15 #else
16 using namespace Atlas;
17 class wrapperClient : public Client {
18 #endif
19 public:
20  wrapperClient( Socket* s, Codec* c, Filter* f) : Client(s,c,f) {}
21 #ifdef SWIG
22  virtual ~wrapperClient();
23 
25  void doPoll();
27  void sendMsg( const Object& msg );
29  void readMsg( Object& msg );
31  void setCodec(Codec* acodec) { codec = acodec; }
32  //change Filter used by client
33  void setFilter(Filter* aFilter ) { filter = aFilter; }
34 #endif
35  virtual void gotMsg(const Object& msg);
38  virtual void gotDisconnect();
39  void setPythonInstance(PyObject *instance);
40 #ifdef SWIG
41  SOCKET getSock();
43  void chkMsgs();
44 
45  bool canRead();
46  bool canSend() const { return true; }
47 
48  bool gotErrs();
49 #endif
50 private:
51  PyObject *m_instance;
52 };
Definition: wrapperClient.h:17
The Atlas namespace.
Definition: Bridge.h:20
Atlas stream codec.
Definition: Codec.h:27
Atlas stream filter.
Definition: Filter.h:29
virtual void gotDisconnect()
to be overidden in subclesses. Called on a socket error/disconnect
virtual void gotMsg(const Object &msg)
to be overidden in subclasses. Called when doPoll() recieves a new object

Copyright 2000-2004 the respective authors.

This document can be licensed under the terms of the GNU Free Documentation License or the GNU General Public License and may be freely distributed under the terms given by one of these licenses.