Go to the documentation of this file.
12 const std::vector<std::string>& names, int32_t timeout_ms) {
13 std::shared_ptr<Group> ptr;
14 std::vector<const char*> names_cstrs;
15 std::vector<const char*> families_cstrs;
16 names_cstrs.reserve(names.size());
17 families_cstrs.reserve(families.size());
19 std::transform(std::begin(names), std::end(names), std::back_inserter(names_cstrs),
20 [](
const std::string& name) {
return name.c_str(); });
21 std::transform(std::begin(families), std::end(families), std::back_inserter(families_cstrs),
22 [](
const std::string& family) {
return family.c_str(); });
25 names_cstrs.data(), names_cstrs.size(), timeout_ms);
32 std::shared_ptr<Group> ptr;
33 std::vector<const HebiMacAddress*> addresses_c;
34 addresses_c.reserve(addresses.size());
35 std::transform(std::begin(addresses), std::end(addresses), std::back_inserter(addresses_c),
44 std::shared_ptr<Group> ptr;
53 std::shared_ptr<Group> ptr;
61 std::shared_ptr<Group> ptr;
109 return this->current_ == rhs.
current_;
120 size_t required_size;
122 auto buffer =
new char[required_size];
124 std::string name(buffer, required_size - 1);
128 buffer =
new char[required_size];
130 std::string family(buffer, required_size - 1);
138 Entry e = {name, family, mac};
149 std::shared_ptr<Lookup::EntryList> ptr;
151 if (entry_list !=
nullptr)
152 return std::make_shared<Lookup::EntryList>(entry_list);
Lookup()
Creates a Lookup object which can create Module and Group references. Typically, only one Lookup obje...
HebiLookupEntryListPtr lookup_list_
HebiStatusCode hebiLookupSetLookupFrequencyHz(HebiLookupPtr lookup, double frequency)
sets the lookup request rate [Hz]
double getLookupFrequencyHz() const
Gets the rate [Hz] at which "discovery" packets are broadcast.
bool operator!=(const Iterator &rhs) const
HebiGroupPtr hebiGroupCreateConnectedFromName(HebiLookupPtr lookup, const char *family, const char *name, int32_t timeout_ms)
Create a group with all modules connected to module with the given name and family.
HebiLookupEntryListPtr hebiCreateLookupEntryList(HebiLookupPtr lookup)
Return a snapshot of the contents of the module registry – i.e., which modules have been found by the...
reference operator*() const
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.
struct HebiGroup_ * HebiGroupPtr
The C-style's API representation of a group.
HebiGroupPtr hebiGroupCreateFromFamily(HebiLookupPtr lookup, const char *family, int32_t timeout_ms)
Create a group with all modules known to the lookup with the given family.
int32_t initial_group_command_lifetime_
bool operator==(const Iterator &rhs) const
HebiGroupPtr hebiGroupCreateConnectedFromMac(HebiLookupPtr lookup, const HebiMacAddress *address, int32_t timeout_ms)
Create a group with all modules connected to module with the given MAC address.
float getInitialGroupFeedbackFrequencyHz()
Gets the default feedback frequency value for groups created from this lookup.
HebiStatusCode hebiLookupEntryListGetFamily(HebiLookupEntryListPtr lookup_list, size_t index, char *buffer, size_t *length)
A simple wrapper class for internal C-API HebiMacAddress objects to allow interfacing with API calls ...
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.
void hebiLookupRelease(HebiLookupPtr lookup)
Frees resources created by the lookup object.
void setInitialGroupCommandLifetimeMs(int32_t ms)
Sets the default command lifetime value for groups created from this lookup.
HebiStatusCode hebiLookupEntryListGetMacAddress(HebiLookupEntryListPtr lookup_list, size_t index, HebiMacAddress *mac_address)
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.
Entry operator[](size_t index) const
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.
size_t hebiLookupEntryListGetSize(HebiLookupEntryListPtr lookup_list)
HebiStatusCode hebiLookupEntryListGetName(HebiLookupEntryListPtr lookup_list, size_t index, char *buffer, size_t *length)
void hebiLookupEntryListRelease(HebiLookupEntryListPtr lookup_list)
Release resources for a given lookup entry list; list should not be used after this call.
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.
bool setLookupFrequencyHz(double frequency)
Sets the lookup rate [Hz].
std::shared_ptr< EntryList > getEntryList()
~Lookup() noexcept
Destructor frees all resources created by Lookup object, and stops the background query thread.
HebiGroupPtr hebiGroupCreateFromNames(HebiLookupPtr lookup, const char *const *families, size_t num_families, const char *const *names, size_t num_names, int32_t timeout_ms)
Create a group with modules matching the given names and families.
HebiLookupPtr hebiLookupCreate(const char *const *ifaces, size_t ifaces_length)
Lookup API.
int32_t getInitialGroupCommandLifetimeMs()
Gets the default command lifetime value for groups created from this lookup.
void setInitialGroupFeedbackFrequencyHz(float frequency)
Sets the default feedback frequency value for groups created from this lookup.
float initial_group_feedback_frequency_
HebiGroupPtr hebiGroupCreateFromMacs(HebiLookupPtr lookup, const HebiMacAddress *const *addresses, size_t num_addresses, int32_t timeout_ms)
Create a group of modules with the given MAC addresses.
double hebiLookupGetLookupFrequencyHz(HebiLookupPtr lookup)
gets the lookup request rate [Hz]
hebi_cpp_api_ros
Author(s): Chris Bollinger
, Matthew Tesch
autogenerated on Fri Aug 2 2024 08:35:18