Async 1.5.0
AsyncDnsLookup.h
Go to the documentation of this file.
1
37#ifndef ASYNC_DNS_LOOKUP_INCLUDED
38#define ASYNC_DNS_LOOKUP_INCLUDED
39
40
41/****************************************************************************
42 *
43 * System Includes
44 *
45 ****************************************************************************/
46
47#include <sigc++/sigc++.h>
48
49#include <vector>
50
51
52/****************************************************************************
53 *
54 * Project Includes
55 *
56 ****************************************************************************/
57
58#include <AsyncIpAddress.h>
59
60
61/****************************************************************************
62 *
63 * Local Includes
64 *
65 ****************************************************************************/
66
67
68
69/****************************************************************************
70 *
71 * Forward declarations
72 *
73 ****************************************************************************/
74
75class DnsLookupWorker;
76
77
78/****************************************************************************
79 *
80 * Namespace
81 *
82 ****************************************************************************/
83
84namespace Async
85{
86
87/****************************************************************************
88 *
89 * Defines & typedefs
90 *
91 ****************************************************************************/
92
93
94
95/****************************************************************************
96 *
97 * Exported Global Variables
98 *
99 ****************************************************************************/
100
101
102
103/****************************************************************************
104 *
105 * Class definitions
106 *
107 ****************************************************************************/
108
120class DnsLookup : public sigc::trackable
121{
122 public:
127 DnsLookup(const std::string& label);
128
133
138 const std::string &label(void) const { return m_label; }
139
144 bool resultsAreReady(void) { return m_results_ready; }
145
156 std::vector<IpAddress> addresses(void);
157
162 sigc::signal<void, DnsLookup&> resultsReady;
163
164
165 protected:
166
167 private:
168 DnsLookupWorker * m_worker;
169 std::string m_label;
170 bool m_results_ready;
171
172 void onResultsReady(void);
173
174}; /* class DnsLookup */
175
176
177} /* namespace */
178
179#endif /* ASYNC_DNS_LOOKUP_INCLUDED */
180
181
182
183/*
184 * This file has not been truncated
185 */
186
Platform independent representation of an IP address.
A class for performing asynchronous DNS lookups.
bool resultsAreReady(void)
Check if the DNS lookup is done or not.
~DnsLookup(void)
Destructor.
DnsLookup(const std::string &label)
Constructor.
const std::string & label(void) const
Return the associated label.
std::vector< IpAddress > addresses(void)
Return the addresses for the host in the query.
sigc::signal< void, DnsLookup & > resultsReady
A signal to indicate that the query has been completed.
Namespace for the asynchronous programming classes.