Bullet Collision Detection & Physics Library
btList.h
Go to the documentation of this file.
1/*
2Copyright (c) 2003-2006 Gino van den Bergen / Erwin Coumans https://bulletphysics.org
3
4This software is provided 'as-is', without any express or implied warranty.
5In no event will the authors be held liable for any damages arising from the use of this software.
6Permission is granted to anyone to use this software for any purpose,
7including commercial applications, and to alter it and redistribute it freely,
8subject to the following restrictions:
9
101. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
112. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
123. This notice may not be removed or altered from any source distribution.
13*/
14
15#ifndef BT_GEN_LIST_H
16#define BT_GEN_LIST_H
17
19{
20public:
21 btGEN_Link() : m_next(0), m_prev(0) {}
22 btGEN_Link(btGEN_Link *next, btGEN_Link *prev) : m_next(next), m_prev(prev) {}
23
24 btGEN_Link *getNext() const { return m_next; }
25 btGEN_Link *getPrev() const { return m_prev; }
26
27 bool isHead() const { return m_prev == 0; }
28 bool isTail() const { return m_next == 0; }
29
31 {
32 m_next = link;
33 m_prev = link->m_prev;
34 m_next->m_prev = this;
35 m_prev->m_next = this;
36 }
37
39 {
40 m_next = link->m_next;
41 m_prev = link;
42 m_next->m_prev = this;
43 m_prev->m_next = this;
44 }
45
46 void remove()
47 {
50 }
51
52private:
55};
56
58{
59public:
61
62 btGEN_Link *getHead() const { return m_head.getNext(); }
63 btGEN_Link *getTail() const { return m_tail.getPrev(); }
64
65 void addHead(btGEN_Link *link) { link->insertAfter(&m_head); }
66 void addTail(btGEN_Link *link) { link->insertBefore(&m_tail); }
67
68private:
71};
72
73#endif //BT_GEN_LIST_H
btGEN_Link m_tail
Definition: btList.h:70
btGEN_Link * getHead() const
Definition: btList.h:62
btGEN_List()
Definition: btList.h:60
void addHead(btGEN_Link *link)
Definition: btList.h:65
btGEN_Link * getTail() const
Definition: btList.h:63
void addTail(btGEN_Link *link)
Definition: btList.h:66
btGEN_Link m_head
Definition: btList.h:69