3es  0.7
3esconnection.h
1 //
2 // author: Kazys Stepanas
3 //
4 #ifndef _3ESCONNECTION_H_
5 #define _3ESCONNECTION_H_
6 
7 #include "3es-core.h"
8 
9 #include <cstddef>
10 #include <cstdint>
11 
12 namespace tes
13 {
14  class Resource;
15  class Shape;
16  struct ServerInfoMessage;
17 
19  class _3es_coreAPI Connection
20  {
21  public:
23  virtual ~Connection() {}
24 
26  virtual void close() = 0;
27 
30  virtual void setActive(bool active) = 0;
31 
34  virtual bool active() const = 0;
35 
39  virtual const char *address() const = 0;
42  virtual uint16_t port() const = 0;
45  virtual bool isConnected() const = 0;
46 
51  virtual int create(const Shape &shape) = 0;
52 
57  virtual int destroy(const Shape &shape) = 0;
58 
63  virtual int update(const Shape &shape) = 0;
64 
72  virtual int updateFrame(float dt, bool flush = true) = 0;
73 
86  virtual int updateTransfers(unsigned byteLimit) = 0;
87 
97  virtual unsigned referenceResource(const Resource *resource) = 0;
98 
106  virtual unsigned releaseResource(const Resource *resource) = 0;
107 
109  virtual bool sendServerInfo(const ServerInfoMessage &info) = 0;
110 
114  virtual int send(const uint8_t *data, int byteCount) = 0;
115 
117  inline int send(const int8_t *data, int byteCount)
118  {
119  return send((const uint8_t*)data, byteCount);
120  }
121  };
122 }
123 
124 #endif // _3ESCONNECTION_H_
A base class for encapsulating a shape which is to be represented remotely.
Definition: 3esshape.h:39
Defines the interfaces for a client connection.
Definition: 3esconnection.h:19
Information about the server.
Definition: 3esmessages.h:160
Definition: 3esbounds.h:13
int send(const int8_t *data, int byteCount)
Definition: 3esconnection.h:117
The Resource base class defines an interface for any resource used by Shape objects such as MeshSet...
Definition: 3esresource.h:34
virtual ~Connection()
Virtual destructor.
Definition: 3esconnection.h:23