RobWorkProject  23.9.11-
Classes | Public Types | Public Member Functions | List of all members
ContactStrategyTracking Class Reference

Interface for a container of meta-data that can be used to track contact across multiple calls to a contact strategy, and allows attaching user specified data to the contact. More...

#include <ContactStrategyTracking.hpp>

Classes

struct  StrategyData
 Base struct that can be extended for strategy specific data. More...
 
struct  UserData
 Base struct that can be extended for user specific data. More...
 

Public Types

typedef rw::core::Ptr< ContactStrategyTrackingPtr
 Smart pointer type.
 

Public Member Functions

 ContactStrategyTracking ()
 Constructor.
 
 ContactStrategyTracking (const ContactStrategyTracking &tracking)
 Copy constructor. More...
 
virtual ~ContactStrategyTracking ()
 Destructor.
 
ContactStrategyTrackingoperator= (const ContactStrategyTracking &data)
 Assign data from other container to this container. More...
 
virtual const UserData::Ptr getUserData (std::size_t index) const
 Get user data for the contact with given index. More...
 
virtual void setUserData (std::size_t index, const UserData::Ptr data)
 Attach user data to a given contact. More...
 
virtual void remove (std::size_t index)
 Remove meta-data for a specific contact. More...
 
virtual void clear ()
 Clear all tracking information.
 
virtual std::size_t getSize () const
 Get the number of contacts tracked currently. More...
 
virtual StrategyDatagetStrategyData () const
 Get the current strategy data. More...
 
virtual void setStrategyData (StrategyData *data)
 Set the strategy data to store for tracking purposes. More...
 
virtual bool isInitialized () const
 Check whether data container has been initialized with strategy data. More...
 

Detailed Description

Interface for a container of meta-data that can be used to track contact across multiple calls to a contact strategy, and allows attaching user specified data to the contact.

Each ContactStrategy implementation should also implement the ContactStrategyTracking interface, to allow tracking contacts.

Constructor & Destructor Documentation

◆ ContactStrategyTracking()

Copy constructor.

Parameters
tracking[in] the tracking information to copy.

Member Function Documentation

◆ getSize()

virtual std::size_t getSize ( ) const
virtual

Get the number of contacts tracked currently.

Returns
the number of tracked contacts.

◆ getStrategyData()

virtual StrategyData* getStrategyData ( ) const
virtual

Get the current strategy data.

Returns
pointer to StrategyData, or NULL if none set.

◆ getUserData()

virtual const UserData::Ptr getUserData ( std::size_t  index) const
virtual

Get user data for the contact with given index.

Parameters
index[in] the contact to get user data for.
Returns
pointer to user data, or NULL if no user data is set.

◆ isInitialized()

virtual bool isInitialized ( ) const
virtual

Check whether data container has been initialized with strategy data.

Returns
true if initialized - NULL if not initialized, or if tracking is unsupported by strategy.

◆ operator=()

ContactStrategyTracking& operator= ( const ContactStrategyTracking data)

Assign data from other container to this container.

Parameters
data[in] the data to copy.
Returns
reference to this container.

◆ remove()

virtual void remove ( std::size_t  index)
virtual

Remove meta-data for a specific contact.

Parameters
index[in] the contact to remove.

◆ setStrategyData()

virtual void setStrategyData ( StrategyData data)
virtual

Set the strategy data to store for tracking purposes.

Parameters
data[in] a pointer to the strategy data.

◆ setUserData()

virtual void setUserData ( std::size_t  index,
const UserData::Ptr  data 
)
virtual

Attach user data to a given contact.

Parameters
index[in] the contact to set user data for.
data[in] a pointer to the data.

The documentation for this class was generated from the following file: