EpcTools
An event based multi-threaded C++ development framework.
Public Member Functions | List of all members
DNS::Query Class Reference

Defines a DNS query. More...

#include <dnsquery.h>

Public Member Functions

 Query (ns_type rtype, const std::string &domain)
 Class constructor. More...
 
 ~Query ()
 Class destructor. More...
 
Void addQuestion (Question *q)
 Adds a question record to a query results. More...
 
Void addAnswer (ResourceRecord *a)
 Adds an answer record to the query results. More...
 
Void addAuthority (ResourceRecord *a)
 Adds an authority record to the query results. More...
 
Void addAdditional (ResourceRecord *a)
 Adds an additional record to the query results. More...
 
ns_type getType ()
 Retrieves the named service type associated with this query. More...
 
const EStringgetDomain ()
 Retrieves the domain associated with this query. More...
 
uint32_t getTTL ()
 Retrieves the time to live (TTL) value associated with the query results. More...
 
time_t getExpires ()
 retrieves the expiration time associated with the query results. More...
 
Bool isExpired ()
 Retrieves an indication if the query results have expired. More...
 
Bool ignoreCache ()
 Retrieves an indication if the DNS cache for this query should be ignored. More...
 
const std::list< Question * > & getQuestions ()
 Retrieves the collection of query result question records. More...
 
const ResourceRecordList & getAnswers ()
 Retrieves the collection of query result answer records. More...
 
const ResourceRecordList & getAuthorities ()
 Retrieves the collection of query result authority records. More...
 
const ResourceRecordList & getAdditional ()
 Retrieves the collection of query result additional records. More...
 
Void dump ()
 Prints the information associated with this DNS query object. More...
 
EEventgetCompletionEvent ()
 Retrieves the completion event associated with this query. More...
 
EEventsetCompletionEvent (EEvent *event)
 Assigns the query completion event. More...
 
CachedDNSQueryCallback getCallback ()
 Retrieves the query completion callback function. More...
 
CachedDNSQueryCallback setCallback (CachedDNSQueryCallback cb)
 Assigns the query completion callback function for this DNS query. More...
 
Bool getError ()
 Retrieves the error indication. More...
 
Bool setError (Bool err)
 Assigns the error indication. More...
 
EStringgetErrorMsg ()
 Retrieves the error message associated with this DNS query. More...
 
EStringsetErrorMsg (const char *errmsg)
 Assigns the error message associated with this DNS query. More...
 
EStringsetErrorMsg (const std::string &errmsg)
 Assigns the error message associated with this DNS query. More...
 
Bool getIgnoreCache ()
 Retrieves the current ignore cache value. More...
 
Bool setIgnoreCache (Bool ignorecache)
 Assigns the ignore cache value. More...
 

Detailed Description

Defines a DNS query.

Constructor & Destructor Documentation

◆ Query()

DNS::Query::Query ( ns_type  rtype,
const std::string &  domain 
)
inline

Class constructor.

Parameters
rtypethe named server type for the query.
domainthe domain for the query.

◆ ~Query()

DNS::Query::~Query ( )
inline

Class destructor.

Member Function Documentation

◆ addAdditional()

Void DNS::Query::addAdditional ( ResourceRecord a)
inline

Adds an additional record to the query results.

Parameters
aa pointer to the additional record to add.

◆ addAnswer()

Void DNS::Query::addAnswer ( ResourceRecord a)
inline

Adds an answer record to the query results.

Parameters
aa pointer to the answer record to add.

◆ addAuthority()

Void DNS::Query::addAuthority ( ResourceRecord a)
inline

Adds an authority record to the query results.

Parameters
aa pointer to the authority record to add.

◆ addQuestion()

Void DNS::Query::addQuestion ( Question q)
inline

Adds a question record to a query results.

Parameters
qa pointer to the question record to add.

◆ dump()

Void DNS::Query::dump ( )
inline

Prints the information associated with this DNS query object.

◆ getAdditional()

const ResourceRecordList& DNS::Query::getAdditional ( )
inline

Retrieves the collection of query result additional records.

Returns
a reference to the collection of query result additional records.

◆ getAnswers()

const ResourceRecordList& DNS::Query::getAnswers ( )
inline

Retrieves the collection of query result answer records.

Returns
a reference to the collection of query result answer records.

◆ getAuthorities()

const ResourceRecordList& DNS::Query::getAuthorities ( )
inline

Retrieves the collection of query result authority records.

Returns
a reference to the collection of query result authority records.

◆ getCallback()

CachedDNSQueryCallback DNS::Query::getCallback ( )
inline

Retrieves the query completion callback function.

Returns
the query completion callback function.

◆ getCompletionEvent()

EEvent* DNS::Query::getCompletionEvent ( )
inline

Retrieves the completion event associated with this query.

Returns
a pointer to the completion event associated with this query.

◆ getDomain()

const EString& DNS::Query::getDomain ( )
inline

Retrieves the domain associated with this query.

Returns
a reference to the domain.

◆ getError()

Bool DNS::Query::getError ( )
inline

Retrieves the error indication.

Returns
True indicats an error occurred, otherwise False.

◆ getErrorMsg()

EString& DNS::Query::getErrorMsg ( )
inline

Retrieves the error message associated with this DNS query.

Returns
the error message associated with this DNS query.

◆ getExpires()

time_t DNS::Query::getExpires ( )
inline

retrieves the expiration time associated with the query results.

Returns
the expiration time associated with the query results.

◆ getIgnoreCache()

Bool DNS::Query::getIgnoreCache ( )
inline

Retrieves the current ignore cache value.

Returns
the current ignore cache value.

◆ getQuestions()

const std::list<Question*>& DNS::Query::getQuestions ( )
inline

Retrieves the collection of query result question records.

Returns
a reference to the collection of query result question records.

◆ getTTL()

uint32_t DNS::Query::getTTL ( )
inline

Retrieves the time to live (TTL) value associated with the query results.

Returns
the time to live (TTL) value associated with the query results.

◆ getType()

ns_type DNS::Query::getType ( )
inline

Retrieves the named service type associated with this query.

Returns
the named service type associated with this query.

◆ ignoreCache()

Bool DNS::Query::ignoreCache ( )
inline

Retrieves an indication if the DNS cache for this query should be ignored.

Returns
an indication if the DNS cache for this query should be ignored.

◆ isExpired()

Bool DNS::Query::isExpired ( )
inline

Retrieves an indication if the query results have expired.

Returns
True indicates the query results have expired, otherwise False.

◆ setCallback()

CachedDNSQueryCallback DNS::Query::setCallback ( CachedDNSQueryCallback  cb)
inline

Assigns the query completion callback function for this DNS query.

Returns
the query completion callback function for this DNS query.

◆ setCompletionEvent()

EEvent* DNS::Query::setCompletionEvent ( EEvent event)
inline

Assigns the query completion event.

Returns
a pointer to the query completion event.

◆ setError()

Bool DNS::Query::setError ( Bool  err)
inline

Assigns the error indication.

Parameters
errthe error indication.
Returns
the assigned error indication.

◆ setErrorMsg() [1/2]

EString& DNS::Query::setErrorMsg ( const char *  errmsg)
inline

Assigns the error message associated with this DNS query.

Parameters
errmsgthe error message.
Returns
the error message associated with this DNS query.

◆ setErrorMsg() [2/2]

EString& DNS::Query::setErrorMsg ( const std::string &  errmsg)
inline

Assigns the error message associated with this DNS query.

Parameters
errmsgthe error message.
Returns
the error message associated with this DNS query.

◆ setIgnoreCache()

Bool DNS::Query::setIgnoreCache ( Bool  ignorecache)
inline

Assigns the ignore cache value.

Parameters
ignorecachethe ignore cache value.
Returns
the ignore cache value.

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