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_NonCopyable.h>
19 
20 #include <ctime>
21 
22 class UT_IpAddressV4;
23 class UT_IpAddressV6;
24 class UT_StringHolder;
25 
26 /// Adapter to retrieve basic server information
28 {
29 public:
30  virtual ~NET_IServerInfo() = default;
31 
33 
34  virtual const UT_IpAddressV4& ipv4() const = 0;
35  virtual const UT_IpAddressV6& ipv6() const = 0;
36  virtual UT_StringHolder hostname() const = 0;
37  virtual time_t currentTime() const { return time(nullptr); }
38 
39 protected:
40  NET_IServerInfo() = default;
41 };
42 
43 class NET_WebServer;
44 
45 /// Retrieve server information from a web server.
47 {
48 public:
49  NET_ServerInfo(NET_WebServer& server);
50 
51  const UT_IpAddressV4& ipv4() const override;
52  const UT_IpAddressV6& ipv6() const override;
53  UT_StringHolder hostname() const override;
54 
55 private:
56  NET_WebServer& myServer;
57 };
58 
59 #endif // __NET_SERVERINFO_H__
60 
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.
This represents a Ipv6 address.
Definition: UT_IpAddress.h:137
Retrieve server information from a web server.