37 static const int32_t DEFAULT_TIMEOUT = 500;
42 HebiLookupPtr lookup_;
47 float initial_group_feedback_frequency_{100.0f};
52 int32_t initial_group_command_lifetime_{250};
92 std::shared_ptr<Group>
getGroupFromNames(
const std::vector<std::string>& families,
const std::vector<std::string>& names, int32_t timeout_ms=DEFAULT_TIMEOUT);
108 std::shared_ptr<Group>
getGroupFromMacs(
const std::vector<MacAddress>& addresses, int32_t timeout_ms=DEFAULT_TIMEOUT);
124 std::shared_ptr<Group>
getGroupFromFamily(
const std::string& family, int32_t timeout_ms=DEFAULT_TIMEOUT);
144 std::shared_ptr<Group>
getConnectedGroupFromName(
const std::string& family,
const std::string& name, int32_t timeout_ms=DEFAULT_TIMEOUT);
214 HebiLookupEntryListPtr lookup_list_;
224 using value_type = Entry;
225 using difference_type = int;
226 using pointer = Entry*;
227 using reference = Entry;
228 using iterator_category = std::bidirectional_iterator_tag;
231 Iterator() =
default;
232 explicit Iterator(
const EntryList& list,
size_t current);
235 reference operator*()
const;
238 Iterator& operator++();
239 Iterator operator++(
int);
240 Iterator& operator--();
241 Iterator operator--(
int);
244 bool operator==(
const Iterator& rhs)
const;
245 bool operator!=(
const Iterator& rhs)
const;
249 size_t current_ { 0 };
257 EntryList(HebiLookupEntryListPtr lookup_list) : lookup_list_(lookup_list) {}
265 Iterator
begin()
const;
266 Iterator
end()
const;
EntryList(HebiLookupEntryListPtr lookup_list)
Definition: lookup.hpp:257
Iterator begin() const
Definition: lookup.cpp:175
Lookup()
Creates a Lookup object which can create Module and Group references. Typically, only one Lookup obje...
Definition: lookup.cpp:6
A simple wrapper class for internal C-API HebiMacAddress objects to allow interfacing with API calls ...
Definition: mac_address.hpp:12
Definition: lookup.hpp:201
#define HEBI_DISABLE_COPY_MOVE(Class)
Definition: util.hpp:7
size_t size() const
Definition: lookup.cpp:170
std::shared_ptr< EntryList > getEntryList()
Definition: lookup.cpp:185
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:48
~EntryList() noexcept
Definition: lookup.cpp:140
~Lookup() noexcept
Destructor frees all resources created by Lookup object, and stops the background query thread...
Definition: lookup.cpp:11
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:66
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:35
int32_t getInitialGroupCommandLifetimeMs()
Gets the default command lifetime value for groups created from this lookup.
Definition: lookup.cpp:85
void setInitialGroupFeedbackFrequencyHz(float frequency)
Sets the default feedback frequency value for groups created from this lookup.
Definition: lookup.cpp:80
void setInitialGroupCommandLifetimeMs(int32_t ms)
Sets the default command lifetime value for groups created from this lookup.
Definition: lookup.cpp:90
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:57
Maintains a registry of network-connected modules and returns Group objects to the user...
Definition: lookup.hpp:34
Entry operator[](size_t index) const
Definition: lookup.cpp:146
Iterator end() const
Definition: lookup.cpp:180
float getInitialGroupFeedbackFrequencyHz()
Gets the default feedback frequency value for groups created from this lookup.
Definition: lookup.cpp:75
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:16