HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NET_ServerInfo.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: NET_ServerInfo.h
7  *
8  * COMMENTS:
9  *
10  *
11  */
12 
13 #ifndef __NET_SERVERINFO_H__
14 #define __NET_SERVERINFO_H__
15 
16 #include "NET_API.h"
17 
18 #include <UT/UT_IdnaName.h>
19 #include <UT/UT_NonCopyable.h>
20 
21 #include <ctime>
22 
23 class UT_IpAddressV4;
24 class UT_IpAddressV6;
25 class UT_StringHolder;
26 
27 /// Adapter to retrieve basic server information
29 {
30 public:
31  virtual ~NET_IServerInfo() = default;
32 
34 
35  virtual const UT_IpAddressV4& ipv4() const = 0;
36  virtual const UT_IpAddressV6& ipv6() const = 0;
37  virtual UT_StringHolder hostname() const = 0;
38  virtual UT_IdnaName machinename() const = 0;
39  virtual time_t currentTime() const { return time(nullptr); }
40 
41 protected:
42  NET_IServerInfo() = default;
43 };
44 
45 class NET_WebServer;
46 
47 /// Retrieve server information from a web server.
49 {
50 public:
51  NET_ServerInfo(NET_WebServer& server);
52 
53  const UT_IpAddressV4& ipv4() const override;
54  const UT_IpAddressV6& ipv6() const override;
55  UT_StringHolder hostname() const override;
56  UT_IdnaName machinename() const override;
57 
58 private:
59  NET_WebServer& myServer;
60 };
61 
62 #endif // __NET_SERVERINFO_H__
63 
GT_API const UT_StringHolder time
This represents a Ipv4 address.
Definition: UT_IpAddress.h:34
Adapter to retrieve basic server information.
virtual const UT_IpAddressV6 & ipv6() const =0
virtual UT_StringHolder hostname() const =0
virtual time_t currentTime() const
#define NET_API
Definition: NET_API.h:9
virtual const UT_IpAddressV4 & ipv4() const =0
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
virtual UT_IdnaName machinename() const =0
This represents a Ipv6 address.
Definition: UT_IpAddress.h:137
Retrieve server information from a web server.