Structure that implements all the necessary functions to manage the map of contacts. Handles their detection and updates the list of the detected contacts, newly removed contacts, etc., to apply the appropriate functions on them.
More...
|
| template<typename OnNewContact, typename OnMaintainedContact, typename OnRemovedContact, typename OnAddedContact = std::nullptr_t> |
| void | updateContacts (const std::set< std::string > &latestContactList, OnNewContact onNewContact, OnMaintainedContact onMaintainedContact, OnRemovedContact onRemovedContact, OnAddedContact onAddedContact=nullptr) |
| | Updates the list of contacts to inform whether they are newly set, removed, etc., and execute actions accordingly.
|
| std::unordered_map< std::string, ContactT > & | contacts () |
| | Get the map of all the contacts.
|
| bool | contactsDetected () const noexcept |
| ContactT * | findContact (const std::string &name) |
| | Accessor for the a contact associated to a surface contained in the map.
|
template<typename ContactT>
struct stateObservation::measurements::ContactsManager< ContactT >
Structure that implements all the necessary functions to manage the map of contacts. Handles their detection and updates the list of the detected contacts, newly removed contacts, etc., to apply the appropriate functions on them.
The template allows to define other kinds of contacts and thus add custom parameters to them.
Definition at line 18 of file ContactsManager.hpp.
template<typename ContactT>
template<typename OnNewContact, typename OnMaintainedContact, typename OnRemovedContact, typename OnAddedContact = std::nullptr_t>
| void stateObservation::measurements::ContactsManager< ContactT >::updateContacts |
( |
const std::set< std::string > & | latestContactList, |
|
|
OnNewContact | onNewContact, |
|
|
OnMaintainedContact | onMaintainedContact, |
|
|
OnRemovedContact | onRemovedContact, |
|
|
OnAddedContact | onAddedContact = nullptr ) |
Updates the list of contacts to inform whether they are newly set, removed, etc., and execute actions accordingly.
- Parameters
-
| latestContactList | Set containing the names of all contacts detected on the latest iteration. |
| onNewContact | Function to call on a newly detected contact |
| onMaintainedContact | Function to call on a contact maintainted since the last iteration |
| onRemovedContact | Function to call on a removed contact |
| onAddedContact | function to call when a contact is added to the manager |
- Returns
- void