26 Lookup(std::string *addr =
nullptr);
55 std::shared_ptr<Group>
getGroupFromFamily(
const std::string &family, int32_t timeout_ms = DEFAULT_TIMEOUT);
57 std::shared_ptr<Group> getGroupFromIps(
const std::vector<std::string> &ips);
80 std::string serial_number_;
87 PndLookupEntryListPtr lookup_list_;
93 class Iterator final {
96 using value_type = Entry;
97 using difference_type = int;
98 using pointer = Entry *;
99 using reference = Entry;
100 using iterator_category = std::bidirectional_iterator_tag;
103 explicit Iterator(
const EntryList &list,
size_t current);
105 reference operator*()
const;
107 Iterator &operator++();
108 Iterator operator++(
int);
109 Iterator &operator--();
110 Iterator operator--(
int);
112 bool operator==(
const Iterator &rhs)
const;
113 bool operator!=(
const Iterator &rhs)
const;
124 EntryList(PndLookupEntryListPtr lookup_list) : lookup_list_(lookup_list) {}
128 Entry operator[](
size_t index)
const;
132 Iterator begin()
const;
133 Iterator end()
const;
142 std::shared_ptr<EntryList> getEntryList();
144 DeviceList *getDeviceList();
150 PndLookupPtr lookup_;
152 static const int32_t DEFAULT_TIMEOUT = 500;
Maintains a registry of network-connected modules and returns Group objects to the user.
Definition lookup.hpp:16
std::shared_ptr< Group > getGroupFromFamily(const std::string &family, int32_t timeout_ms=DEFAULT_TIMEOUT)
Get a group from all known modules with the given family.
Definition lookup.cpp:30
~Lookup() noexcept
Destructor frees all resources created by Lookup object, and stops the background query thread.
Definition lookup.cpp:20
std::string getCtrlBoxIP()
Get CtrlBox ip address.
Definition lookup.cpp:24
bool setLookupFrequencyHz(float frequency)
Sets the lookup rate [Hz].
Definition lookup.cpp:51
float getLookupFrequencyHz() const
Gets the rate [Hz] at which "discovery" packets are broadcast.
Definition lookup.cpp:49
void setNetWorks(std::string networks)
Sets the broadcast address for the lookup.
Definition lookup.cpp:22