mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 10:03:35 +08:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user