new IntrusiveSortedList container used for uORB, WorkQueues, and WorkItems

- new intrusive linked list container (c++ template) that sorts on insertion
 - primarily for convenience inspecting things in the system like uORB or WorkQueues
 - uorb status or top sorted alphabetically 
 - work_queue status threads sorted by priority, then items sorted alphabetically within each
This commit is contained in:
Daniel Agar
2020-08-04 11:09:41 -04:00
committed by GitHub
parent dfc2160489
commit b6a17a6538
11 changed files with 502 additions and 13 deletions
+4 -1
View File
@@ -38,6 +38,7 @@
#include <lib/cdev/CDev.hpp>
#include <containers/IntrusiveSortedList.hpp>
#include <containers/List.hpp>
#include <px4_platform_common/atomic.h>
@@ -52,7 +53,7 @@ class SubscriptionCallback;
/**
* Per-object device instance.
*/
class uORB::DeviceNode : public cdev::CDev, public ListNode<uORB::DeviceNode *>
class uORB::DeviceNode : public cdev::CDev, public IntrusiveSortedListNode<uORB::DeviceNode *>
{
public:
DeviceNode(const struct orb_metadata *meta, const uint8_t instance, const char *path, ORB_PRIO priority,
@@ -65,6 +66,8 @@ public:
DeviceNode(DeviceNode &&) = delete;
DeviceNode &operator=(DeviceNode &&) = delete;
bool operator<=(const DeviceNode &rhs) const { return (strcmp(get_devname(), rhs.get_devname()) <= 0); }
/**
* Method to create a subscriber instance and return the struct
* pointing to the subscriber as a file pointer.