16 std::shared_ptr<Group>
Lookup::getGroupFromNames(
const std::vector<std::string>& families,
const std::vector<std::string>& names, int32_t timeout_ms)
18 std::shared_ptr<Group> ptr;
19 std::vector<const char *> names_cstrs;
20 std::vector<const char *> families_cstrs;
21 names_cstrs.reserve(names.size());
22 families_cstrs.reserve(families.size());
24 std::transform(std::begin(names), std::end(names),
25 std::back_inserter(names_cstrs), [] (
const std::string& name) {
return name.c_str(); });
26 std::transform(std::begin(families), std::end(families),
27 std::back_inserter(families_cstrs), [] (
const std::string& family) {
return family.c_str(); });
37 std::shared_ptr<Group> ptr;
38 std::vector<const HebiMacAddress*> addresses_c;
39 addresses_c.reserve(addresses.size());
40 std::transform(std::begin(addresses), std::end(addresses),
50 std::shared_ptr<Group> ptr;
59 std::shared_ptr<Group> ptr;
68 std::shared_ptr<Group> ptr;
96 : list_(list), current_(current)
137 return !(*
this == rhs);
148 size_t required_size;
150 auto buffer =
new char [required_size];
152 std::string name(buffer, required_size-1);
156 buffer =
new char [required_size];
158 std::string family(buffer, required_size-1);
166 Entry e = { name, family, mac };
187 std::shared_ptr<Lookup::EntryList> ptr;
189 if (entry_list !=
nullptr)
190 return std::make_shared<Lookup::EntryList>(entry_list);
float initial_group_feedback_frequency_
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.
struct _HebiGroup * HebiGroupPtr
The C-style's API representation of a group.
Lookup()
Creates a Lookup object which can create Module and Group references. Typically, only one Lookup obje...
A simple wrapper class for internal C-API HebiMacAddress objects to allow interfacing with API calls ...
HebiStatusCode hebiLookupEntryListGetName(HebiLookupEntryListPtr lookup_list, size_t index, char *buffer, size_t *length)
bool operator==(const Iterator &rhs) const
std::shared_ptr< EntryList > getEntryList()
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.
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.
size_t hebiLookupEntryListGetSize(HebiLookupEntryListPtr lookup_list)
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.
~Lookup() noexcept
Destructor frees all resources created by Lookup object, and stops the background query thread...
HebiLookupEntryListPtr hebiCreateLookupEntryList(HebiLookupPtr lookup)
Return a snapshot of the contents of the module registry – i.e., which modules have been found by th...
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.
reference operator*() const
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.
HebiStatusCode hebiLookupEntryListGetFamily(HebiLookupEntryListPtr lookup_list, size_t index, char *buffer, size_t *length)
int32_t getInitialGroupCommandLifetimeMs()
Gets the default command lifetime value for groups created from this lookup.
HebiLookupEntryListPtr lookup_list_
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.
bool operator!=(const Iterator &rhs) const
HebiLookupPtr hebiLookupCreate(void)
Create a Lookup instance.
void setInitialGroupFeedbackFrequencyHz(float frequency)
Sets the default feedback frequency value for groups created from this lookup.
void setInitialGroupCommandLifetimeMs(int32_t ms)
Sets the default command lifetime value for groups created from this lookup.
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...
Entry operator[](size_t index) const
HebiStatusCode hebiLookupEntryListGetMacAddress(HebiLookupEntryListPtr lookup_list, size_t index, HebiMacAddress *mac_address)
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.
int32_t initial_group_command_lifetime_
float getInitialGroupFeedbackFrequencyHz()
Gets the default feedback frequency value for groups created from this lookup.
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 > 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.
void hebiLookupRelease(HebiLookupPtr lookup)
Frees resources created by the lookup object.