mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 16:19:05 +08:00
Merge branch 'release_v1.0.0'
This commit is contained in:
commit
2903ceaacc
@ -45,6 +45,7 @@ class __EXPORT ListNode
|
||||
public:
|
||||
ListNode() : _sibling(nullptr) {
|
||||
}
|
||||
virtual ~ListNode() {};
|
||||
void setSibling(T sibling) { _sibling = sibling; }
|
||||
T getSibling() { return _sibling; }
|
||||
T get() {
|
||||
@ -52,6 +53,11 @@ public:
|
||||
}
|
||||
protected:
|
||||
T _sibling;
|
||||
private:
|
||||
// forbid copy
|
||||
ListNode(const ListNode& other);
|
||||
// forbid assignment
|
||||
ListNode & operator = (const ListNode &);
|
||||
};
|
||||
|
||||
template<class T>
|
||||
@ -60,12 +66,18 @@ class __EXPORT List
|
||||
public:
|
||||
List() : _head() {
|
||||
}
|
||||
virtual ~List() {};
|
||||
void add(T newNode) {
|
||||
newNode->setSibling(getHead());
|
||||
setHead(newNode);
|
||||
}
|
||||
T getHead() { return _head; }
|
||||
private:
|
||||
protected:
|
||||
void setHead(T &head) { _head = head; }
|
||||
T _head;
|
||||
private:
|
||||
// forbid copy
|
||||
List(const List& other);
|
||||
// forbid assignment
|
||||
List& operator = (const List &);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user