26 static const int32_t DEFAULT_TIMEOUT = 500;
31 HebiLookupPtr lookup_;
36 float initial_group_feedback_frequency_{100.0f};
41 int32_t initial_group_command_lifetime_{250};
81 std::shared_ptr<Group>
getGroupFromNames(
const std::vector<std::string>& families,
82 const std::vector<std::string>& names, int32_t timeout_ms = DEFAULT_TIMEOUT);
98 std::shared_ptr<Group>
getGroupFromMacs(
const std::vector<MacAddress>& addresses,
99 int32_t timeout_ms = DEFAULT_TIMEOUT);
115 std::shared_ptr<Group>
getGroupFromFamily(
const std::string& family, int32_t timeout_ms = DEFAULT_TIMEOUT);
136 int32_t timeout_ms = DEFAULT_TIMEOUT);
221 HebiLookupEntryListPtr lookup_list_;
227 class Iterator final {
230 using value_type = Entry;
231 using difference_type = int;
232 using pointer = Entry*;
233 using reference = Entry;
234 using iterator_category = std::bidirectional_iterator_tag;
237 Iterator() =
default;
238 explicit Iterator(
const EntryList& list,
size_t current);
241 reference operator*()
const;
244 Iterator& operator++();
245 Iterator operator++(
int);
246 Iterator& operator--();
247 Iterator operator--(
int);
250 bool operator==(
const Iterator& rhs)
const;
251 bool operator!=(
const Iterator& rhs)
const;
262 EntryList(HebiLookupEntryListPtr lookup_list) : lookup_list_(lookup_list) {}
266 Entry operator[](
size_t index) const;
270 Iterator
begin() const;
271 Iterator
end() const;
EntryList(HebiLookupEntryListPtr lookup_list)
Definition: lookup.hpp:262
Lookup()
Creates a Lookup object which can create Module and Group references. Typically, only one Lookup obje...
Definition: lookup.cpp:7
double getLookupFrequencyHz() const
Gets the rate [Hz] at which "discovery" packets are broadcast.
Definition: lookup.cpp:76
A simple wrapper class for internal C-API HebiMacAddress objects to allow interfacing with API calls ...
Definition: mac_address.hpp:13
Iterator begin() const
Definition: lookup.cpp:144
Definition: lookup.hpp:210
#define HEBI_DISABLE_COPY_MOVE(Class)
Definition: util.hpp:6
std::shared_ptr< EntryList > getEntryList()
Definition: lookup.cpp:148
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:43
~EntryList() noexcept
Definition: lookup.cpp:114
~Lookup() noexcept
Destructor frees all resources created by Lookup object, and stops the background query thread.
Definition: lookup.cpp:9
std::shared_ptr< Group > getConnectedGroupFromMac(const MacAddress &address, int32_t timeout_ms=DEFAULT_TIMEOUT)
Get a group from all modules known to connect to a module with the given mac address.
Definition: lookup.cpp:60
std::shared_ptr< Group > getGroupFromMacs(const std::vector< MacAddress > &addresses, int32_t timeout_ms=DEFAULT_TIMEOUT)
Get a group from modules with the given mac addresses.
Definition: lookup.cpp:31
int32_t getInitialGroupCommandLifetimeMs()
Gets the default command lifetime value for groups created from this lookup.
Definition: lookup.cpp:72
void setInitialGroupFeedbackFrequencyHz(float frequency)
Sets the default feedback frequency value for groups created from this lookup.
Definition: lookup.cpp:70
Iterator end() const
Definition: lookup.cpp:146
bool setLookupFrequencyHz(double frequency)
Sets the lookup rate [Hz].
Definition: lookup.cpp:78
void setInitialGroupCommandLifetimeMs(int32_t ms)
Sets the default command lifetime value for groups created from this lookup.
Definition: lookup.cpp:74
std::shared_ptr< Group > getConnectedGroupFromName(const std::string &family, const std::string &name, int32_t timeout_ms=DEFAULT_TIMEOUT)
Get a group from all modules known to connect to a module with the given name and family.
Definition: lookup.cpp:51
Maintains a registry of network-connected modules and returns Group objects to the user.
Definition: lookup.hpp:24
float getInitialGroupFeedbackFrequencyHz()
Gets the default feedback frequency value for groups created from this lookup.
Definition: lookup.cpp:68
std::shared_ptr< Group > getGroupFromNames(const std::vector< std::string > &families, const std::vector< std::string > &names, int32_t timeout_ms=DEFAULT_TIMEOUT)
Get a group from modules with the given names and families.
Definition: lookup.cpp:11
size_t size() const
Definition: lookup.cpp:142