MClient.h
1 /*****************************************************************************
2 **
3 ** Header file for Muster API Client object
4 **
5 ** Name : MClient.h
6 ** Author : Leonardo Bernardini
7 ** Version : Alpha 9.0 Wed May 17th 2017
8 **
9 ** Copyright 2000-2019, Virtual Vertex
10 ** All Rights Reserved.
11 **
12 ** This file contains UNPUBLISHED PROPRIETARY SOURCE CODE.
13 ** The contents of this file may not be disclosed to third parties, copied
14 ** or duplicated in any form, in whole or in part, without the prior written
15 ** permission of the author.
16 **
17 *****************************************************************************/
18 #ifndef MCLIENT_H
19 #define MCLIENT_H
20 
21 #ifdef WIN32
22 // Windows definitions
23 #ifdef MCLIENTLIB_EXPORTS
24 #define MCLIENTLIB_API __declspec(dllexport)
25 #else
26 #define MCLIENTLIB_API __declspec(dllimport)
27 #endif
28 #else
29 
30 #ifndef MCLIENTLIB_EXPORTS
31 #ifdef LINUX
32 #define MCLIENTLIB_API
33 #else
34 #define MCLIENTLIB_API
35 #endif
36 #else
37 #define MCLIENTLIB_API
38 #endif
39 #endif
40 
41 // Disable STL Export warning, member is private, we don't need direct access from the DLL client
42 #if defined(_WIN32)
43 #pragma warning(disable: 4251)
44 #endif // _WIN32
45 
46 #include <string>
47 
48 namespace MClientLib {
49 
60  class MCLIENTLIB_API MClient {
61  public:
62 
63 
64  private:
65  long clientId;
66  int hostPlatform;
67  std::string hostIP;
68  std::string hostName; // Instance name
69  bool isAuthenticated;
70  std::string username;
71  unsigned long long rightsMask;
72  int networkEventsMask;
73  time_t connectionTime;
74 
75  public:
76  MClient();
77  virtual ~MClient();
78 
79  virtual void Clear();
80 
81  virtual long getClientId();
82  virtual int getHostPlatform();
83  virtual const std::string getHostIP();
84  virtual const std::string getUsername();
85  virtual const std::string getHostname();
86  virtual bool getIsAuthenticated();
87  virtual unsigned long long getRightsMask();
88  virtual int getNetworkEventsMask();
89  virtual time_t getConnectionTime();
90 
91  virtual void setClientId(long _clientId);
92  virtual void setHostPlatform(int _hostPlatform);
93  virtual void setHostIP(const std::string& _hostIp);
94  virtual void setHostname(const std::string& _hostName);
95  virtual void setUsername(const std::string& _username);
96  virtual void setIsAuthenticated(bool _isAuthenticated);
97  virtual void setRightsMask(unsigned long long _rightsMask);
98  virtual void setNetworkEventsMask(int _networkEventsMask);
99  virtual void setConnectionTime(time_t _connectionTime);
100 
102  void castedRelease();
104  };
105 
107 }
108 
109 
110 
111 #endif
Class holding a client connection details.
Definition: MClient.h:60