Kea 2.5.7
isc::data::ServerTag Class Reference

Represents a server tag. More...

#include <server_tag.h>

Public Member Functions

 ServerTag ()
 Default constructor.
 
 ServerTag (const std::string &tag)
 Constructor.
 
bool amAll () const
 Checks if the server tag is set to "all servers".
 
std::string get () const
 Returns server tag as string.
 
bool operator< (const ServerTag &other) const
 Overload of the less operator for using ServerTag in sets.
 

Static Public Attributes

static std::string ALL = "all"
 Server tag for all servers as text.
 

Detailed Description

Represents a server tag.

The server tag is a label identifying a server or all servers which configuration is stored in the database. The label "all" is reserved and it means "all servers". A configuration object in the database associated with this server tag belongs to all servers. The server tag must not be empty, must not be longer than 256 characters (excluding leading and terminating whitespaces, which are trimmed) and must not be set to "any" which has a special meaning for the server selector.

Definition at line 25 of file server_tag.h.

Constructor & Destructor Documentation

◆ ServerTag() [1/2]

isc::data::ServerTag::ServerTag ( )

Default constructor.

Creates server tag for all servers.

Definition at line 19 of file server_tag.cc.

◆ ServerTag() [2/2]

isc::data::ServerTag::ServerTag ( const std::string &  tag)
explicit

Constructor.

Parameters
tagserver tag provided as string. The tag is converted to lower case.

Definition at line 23 of file server_tag.cc.

References isc_throw.

Member Function Documentation

◆ amAll()

bool isc::data::ServerTag::amAll ( ) const

Checks if the server tag is set to "all servers".

Returns
true if the server tag is set to all servers, false otherwise.

Definition at line 42 of file server_tag.cc.

References ALL.

◆ get()

std::string isc::data::ServerTag::get ( ) const
inline

Returns server tag as string.

Returns
lower case server tag.

Definition at line 51 of file server_tag.h.

Referenced by isc::db::ServerFetcher::get(), isc::db::Server::getServerTagAsText(), and isc::data::operator<<().

◆ operator<()

bool isc::data::ServerTag::operator< ( const ServerTag other) const
inline

Overload of the less operator for using ServerTag in sets.

Parameters
otherother server tag to compare to.
Returns
true if this server tag is less than the other server tag.

Definition at line 59 of file server_tag.h.

Member Data Documentation

◆ ALL

std::string isc::data::ServerTag::ALL = "all"
static

Server tag for all servers as text.

Definition at line 29 of file server_tag.h.

Referenced by amAll(), and isc::data::StampedElement::hasAllServerTag().


The documentation for this class was generated from the following files: