mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 10:46:33 +08:00
List.hpp: Fix code style
This commit is contained in:
@@ -43,31 +43,35 @@ template<class T>
|
|||||||
class __EXPORT ListNode
|
class __EXPORT ListNode
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ListNode() : _sibling(nullptr) {
|
ListNode() : _sibling(nullptr)
|
||||||
|
{
|
||||||
}
|
}
|
||||||
virtual ~ListNode() {};
|
virtual ~ListNode() {};
|
||||||
void setSibling(T sibling) { _sibling = sibling; }
|
void setSibling(T sibling) { _sibling = sibling; }
|
||||||
T getSibling() { return _sibling; }
|
T getSibling() { return _sibling; }
|
||||||
T get() {
|
T get()
|
||||||
|
{
|
||||||
return _sibling;
|
return _sibling;
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
T _sibling;
|
T _sibling;
|
||||||
private:
|
private:
|
||||||
// forbid copy
|
// forbid copy
|
||||||
ListNode(const ListNode& other);
|
ListNode(const ListNode &other);
|
||||||
// forbid assignment
|
// forbid assignment
|
||||||
ListNode & operator = (const ListNode &);
|
ListNode &operator = (const ListNode &);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
class __EXPORT List
|
class __EXPORT List
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
List() : _head() {
|
List() : _head()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
virtual ~List() {};
|
virtual ~List() {};
|
||||||
void add(T newNode) {
|
void add(T newNode)
|
||||||
|
{
|
||||||
newNode->setSibling(getHead());
|
newNode->setSibling(getHead());
|
||||||
setHead(newNode);
|
setHead(newNode);
|
||||||
}
|
}
|
||||||
@@ -77,7 +81,7 @@ protected:
|
|||||||
T _head;
|
T _head;
|
||||||
private:
|
private:
|
||||||
// forbid copy
|
// forbid copy
|
||||||
List(const List& other);
|
List(const List &other);
|
||||||
// forbid assignment
|
// forbid assignment
|
||||||
List& operator = (const List &);
|
List &operator = (const List &);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user