Go to the documentation of this file.
35 #ifndef ACTIONLIB__MANAGED_LIST_H_
36 #define ACTIONLIB__MANAGED_LIST_H_
39 #include <boost/thread.hpp>
40 #include <boost/shared_ptr.hpp>
41 #include <boost/weak_ptr.hpp>
83 iterator(
typename std::list<TrackedElem>::iterator it)
85 typename std::list<TrackedElem>::iterator
it_;
104 "ManagedList: The DestructionGuard associated with this list has already been destructed. You must delete all list handles before deleting the ManagedList");
169 ROS_ERROR_NAMED(
"actionlib",
"getElem() should not see invalid handles");
178 ROS_ERROR_NAMED(
"actionlib",
"getElem() should not see invalid handles");
190 ROS_ERROR_NAMED(
"actionlib",
"operator== should not see invalid handles");
196 return it_ == rhs.it_;
233 tracked_t.elem = elem;
235 typename std::list<TrackedElem>::iterator list_it =
list_.insert(
list_.end(), tracked_t);
241 list_it->handle_tracker_ = tracker;
243 return Handle(tracker, managed_it);
255 iterator
begin() {
return iterator(
list_.begin()); }
262 std::list<TrackedElem>
list_;
268 if (
it_->handle_tracker_.expired()) {
269 ROS_ERROR_NAMED(
"actionlib",
"Tried to create a handle to a list elem with refcount 0");
279 #endif // ACTIONLIB__MANAGED_LIST_H_
boost::function< void(iterator)> CustomDeleter
bool isProtected()
Checks if the ScopedProtector successfully protected the DestructionGuard.
Handle add(const T &elem)
Add an element to the back of the ManagedList.
Protects a DestructionGuard until this object goes out of scope.
boost::weak_ptr< void > handle_tracker_
std::list< TrackedElem >::iterator it_
#define ROS_ERROR_NAMED(name,...)
void erase(iterator it)
Removes an element from the ManagedList.
boost::shared_ptr< DestructionGuard > guard_
wrapper around an STL list to help with reference counting Provides handles elements in an STL list....
void defaultDeleter(iterator it)
boost::shared_ptr< void > handle_tracker_
#define ROS_DEBUG_NAMED(name,...)
ElemDeleter(iterator it, CustomDeleter deleter, const boost::shared_ptr< DestructionGuard > &guard)
bool operator!=(const iterator &rhs) const
bool operator==(const Handle &rhs) const
Checks if two handles point to the same list elem.
bool operator==(const iterator &rhs) const
Handle()
Construct an empty handle.
Handle & operator=(const Handle &rhs)
void reset()
stop tracking the list element with this handle, even though the Handle hasn't gone out of scope
std::list< TrackedElem > list_
T & getElem()
get the list element that this handle points to fails/asserts if this is an empty handle
Handle createHandle()
Creates a refcounted Handle from an iterator.
actionlib
Author(s): Eitan Marder-Eppstein, Vijay Pradeep, Mikael Arguedas
autogenerated on Fri May 19 2023 02:36:55