MNClient.h
1 /*****************************************************************************
2 **
3 ** Header file for Muster API Notificator client object
4 **
5 ** Name : MBClient.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 MNCLIENT_H
19 #define MNCLIENT_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 MNClient {
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  time_t connectionTime;
72 
73  public:
74  MNClient();
75  virtual ~MNClient();
76 
77  virtual void Clear();
78 
79  virtual long getClientId();
80  virtual int getHostPlatform();
81  virtual const std::string getHostIP();
82  virtual const std::string getUsername();
83  virtual const std::string getHostname();
84  virtual bool getIsAuthenticated();
85  virtual time_t getConnectionTime();
86 
87  virtual void setClientId(long _clientId);
88  virtual void setHostPlatform(int _hostPlatform);
89  virtual void setHostIP(const std::string& _hostIp);
90  virtual void setHostname(const std::string& _hostName);
91  virtual void setUsername(const std::string& _username);
92  virtual void setIsAuthenticated(bool _isAuthenticated);
93  virtual void setConnectionTime(time_t _connectionTime);
94 
96  void castedRelease();
98  };
99 
101 }
102 
103 
104 
105 #endif
Class holding a client connection details.
Definition: MNClient.h:60