13#include <boost/optional.hpp>
21class AbstractMessageRenderer;
64 explicit RRTTL(uint32_t ttlval) : ttlval_(ttlval) {
81 explicit RRTTL(
const std::string& ttlstr);
140 const std::string
toText()
const;
192 return (ttlval_ == other.ttlval_);
196 return (ttlval_ == other.ttlval_);
204 return (ttlval_ != other.ttlval_);
208 return (ttlval_ != other.ttlval_);
218 return (ttlval_ <= other.ttlval_);
223 return (ttlval_ <= other.ttlval_);
234 return (ttlval_ >= other.ttlval_);
239 return (ttlval_ >= other.ttlval_);
250 return (ttlval_ < other.ttlval_);
255 return (ttlval_ < other.ttlval_);
266 return (ttlval_ > other.ttlval_);
271 return (ttlval_ > other.ttlval_);
286 static const RRTTL max_ttl(0x7fffffff);
310operator<<(std::ostream& os,
const RRTTL& rrttl);
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
The AbstractMessageRenderer class is an abstract base class that provides common interfaces for rende...
Base class for all sorts of text parse errors.
A standard DNS module exception that is thrown if an RRTTL object is being constructed from a incompl...
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 an unreco...
InvalidRRTTL(const char *file, size_t line, const char *what)
The RRTTL class encapsulates TTLs used in DNS resource records.
bool operator!=(const RRTTL &other) const
Same as nequals().
bool operator>(const RRTTL &other) const
Same as gthan()
void toWire(AbstractMessageRenderer &renderer) const
Render the RRTTL in the wire format.
bool geq(const RRTTL &other) const
Greater-than or equal comparison for RRTTL against other.
static RRTTL * createFromText(const std::string &ttlstr)
A separate factory of RRTTL from text.
bool equals(const RRTTL &other) const
Return true iff two RRTTLs are equal.
bool operator==(const RRTTL &other) const
Same as equals().
bool leq(const RRTTL &other) const
Less-than or equal comparison for RRTTL against other.
RRTTL(uint32_t ttlval)
Constructor from an integer TTL value.
bool operator>=(const RRTTL &other) const
Same as geq()
bool nequals(const RRTTL &other) const
Return true iff two RRTTLs are not equal.
bool gthan(const RRTTL &other) const
Greater-than comparison for RRTTL against other.
uint32_t getValue() const
Returns the TTL value as a 32-bit unsigned integer.
bool operator<(const RRTTL &other) const
Same as lthan()
static const RRTTL & MAX_TTL()
The TTL of the max allowable value, per RFC2181 Section 8.
bool lthan(const RRTTL &other) const
Less-than comparison for RRTTL against other.
const std::string toText() const
Convert the RRTTL to a string.
bool operator<=(const RRTTL &other) const
Same as leq()
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
ostream & operator<<(std::ostream &os, const EDNS &edns)
Insert the EDNS as a string into stream.
Defines the logger used by the top-level component of kea-lfc.