Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cNetHostRange.h
Go to the documentation of this file.
1 //
4 //
5 #ifndef _INC_cNetHostRange_H
6 #define _INC_cNetHostRange_H
7 #ifndef NO_PRAGMA_ONCE
8 #pragma once
9 #endif
10 
11 #include "cNetHost.h"
12 #include "../Math/cValueRange.h"
13 
14 
15 namespace GrayLib
16 {
17  UNITTEST2_PREDEF(cNetHostRange);
18 
19  class GRAYLIB_LINK cNetHostRange4 : public cValueRange<UINT32>
20  {
29 
30  typedef cValueRange<UINT32> SUPER_t;
31 
32  public:
33  cNetHostRange4()
34  {
35  }
36  cNetHostRange4(const char* pszRange)
37  {
38  SetAddressRange(pszRange);
39  }
40  cNetHostRange4(cNetHost4 low)
41  : cValueRange(low.get_HostIp4_H(), low.get_HostIp4_H())
42  {
43  }
44  cNetHostRange4(cNetHost4 low, cNetHost4 high)
45  : cValueRange(low.get_HostIp4_H(), high.get_HostIp4_H())
46  {
47  }
48 
49  bool isRange() const
50  {
52  return(!(m_Lo == m_Hi));
53  }
54  bool IsAddrInRange(const cNetHost4& ip) const
55  {
57  return SUPER_t::IsInsideI(ip.get_HostIp4_H());
58  }
59 
60  bool SetAddressRange(const char* pszRange);
61 
62  UNITTEST_FRIEND(cNetHostRange);
63  };
64 };
65 
66 #endif // _INC_cNetHostRange_H
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define UNITTEST_FRIEND(n)
Define this in the class body to be unit tested. Allow the unit test to access private/protected stuf...
Definition: cUnitTestDecl.h:17
Definition: cValueRange.h:21
Definition: cMesh.h:22
UNITTEST2_PREDEF(cQuadtree)