12 #include <boost/optional.hpp>
25 class AbstractMessageRenderer;
63 explicit RRTTL(uint32_t ttlval) : ttlval_(ttlval) {}
84 explicit RRTTL(
const std::string& ttlstr);
133 const std::string
toText()
const;
171 uint32_t
getValue()
const {
return (ttlval_); }
193 {
return (ttlval_ == other.ttlval_); }
196 {
return (ttlval_ == other.ttlval_); }
203 {
return (ttlval_ != other.ttlval_); }
206 {
return (ttlval_ != other.ttlval_); }
215 {
return (ttlval_ <= other.ttlval_); }
219 {
return (ttlval_ <= other.ttlval_); }
229 {
return (ttlval_ >= other.ttlval_); }
233 {
return (ttlval_ >= other.ttlval_); }
243 {
return (ttlval_ < other.ttlval_); }
247 {
return (ttlval_ < other.ttlval_); }
257 {
return (ttlval_ > other.ttlval_); }
261 {
return (ttlval_ > other.ttlval_); }
275 static const RRTTL max_ttl(0x7fffffff);
299 operator<<(std::ostream& os,
const RRTTL& rrttl);
bool leq(const RRTTL &other) const
Less-than or equal comparison for RRTTL against other.
static const RRTTL & MAX_TTL()
The TTL of the max allowable value, per RFC2181 Section 8.
bool operator<=(const RRTTL &other) const
Same as leq()
ostream & operator<<(std::ostream &os, const EDNS &edns)
Insert the EDNS as a string into stream.
Base class for all sorts of text parse errors.
bool operator>(const RRTTL &other) const
Same as gthan()
bool equals(const RRTTL &other) const
Return true iff two RRTTLs are equal.
bool operator<(const RRTTL &other) const
Same as lthan()
void toWire(AbstractMessageRenderer &renderer) const
Render the RRTTL in the wire format.
bool operator!=(const RRTTL &other) const
Same as nequals().
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
bool lthan(const RRTTL &other) const
Less-than comparison for RRTTL against other.
bool gthan(const RRTTL &other) const
Greater-than comparison for RRTTL against other.
The RRTTL class encapsulates TTLs used in DNS resource records.
uint32_t getValue() const
Returns the TTL value as a 32-bit unsigned integer.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
Defines the logger used by the top-level component of kea-dhcp-ddns.
bool operator==(const RRTTL &other) const
Same as equals().
static RRTTL * createFromText(const std::string &ttlstr)
A separate factory of RRTTL from text.
bool geq(const RRTTL &other) const
Greater-than or equal comparison for RRTTL against other.
const std::string toText() const
Convert the RRTTL to a string.
bool operator>=(const RRTTL &other) const
Same as geq()
InvalidRRTTL(const char *file, size_t line, const char *what)
A standard DNS module exception that is thrown if an RRTTL object is being constructed from an unreco...
bool nequals(const RRTTL &other) const
Return true iff two RRTTLs are not equal.
IncompleteRRTTL(const char *file, size_t line, const char *what)
A standard DNS module exception that is thrown if an RRTTL object is being constructed from a incompl...
RRTTL(uint32_t ttlval)
Constructor from an integer TTL value.