26 Lookup(std::string *addr =
nullptr);
56 const std::string &family, int32_t timeout_ms = DEFAULT_TIMEOUT);
79 std::string serial_number_;
86 PndLookupEntryListPtr lookup_list_;
92 class Iterator final {
95 using value_type = Entry;
96 using difference_type = int;
97 using pointer = Entry *;
98 using reference = Entry;
99 using iterator_category = std::bidirectional_iterator_tag;
101 Iterator() =
default;
102 explicit Iterator(
const EntryList &list,
size_t current);
104 reference operator*()
const;
106 Iterator &operator++();
107 Iterator operator++(
int);
108 Iterator &operator--();
109 Iterator operator--(
int);
111 bool operator==(
const Iterator &rhs)
const;
112 bool operator!=(
const Iterator &rhs)
const;
123 EntryList(PndLookupEntryListPtr lookup_list) : lookup_list_(lookup_list) {}
127 Entry operator[](
size_t index)
const;
131 Iterator begin()
const;
132 Iterator end()
const;
141 std::shared_ptr<EntryList> getEntryList();
147 PndLookupPtr lookup_;
149 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:32
~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:26
bool setLookupFrequencyHz(float frequency)
Sets the lookup rate [Hz].
Definition lookup.cpp:45
float getLookupFrequencyHz() const
Gets the rate [Hz] at which "discovery" packets are broadcast.
Definition lookup.cpp:41
void setNetWorks(std::string networks)
Sets the broadcast address for the lookup.
Definition lookup.cpp:22