Quick Links: |
#include <bslalg_bidirectionallink.h>
Public Member Functions | |
BidirectionalLink () | |
BidirectionalLink (const BidirectionalLink &original) | |
~BidirectionalLink () | |
BidirectionalLink & | operator= (const BidirectionalLink &rhs) |
void | setNextLink (BidirectionalLink *next) |
void | setPreviousLink (BidirectionalLink *previous) |
void | reset () |
BidirectionalLink * | nextLink () const |
BidirectionalLink * | previousLink () const |
This POD-like class
describes a node suitable for use in a doubly- linked (bidirectional) list, holding the addresses of the preceding and succeeding nodes, either or both of which may be 0. This class is "POD-like" to facilitate efficient allocation and use in the context of a container implementations. In order to meet the essential requirements of a POD type, this class
does not declare a constructor or destructor. However its data members are private. It satisfies the requirements of a trivial type and a standard layout type defined by the C++11 standard. Note that this type does not contain any "payload" member data: Clients creating a doubly-linked list of data must define an appropriate node type that incorporates BidirectionalLink
(generally via inheritance), and that holds the "value" of any data stored in that node.
See Component bslalg_bidirectionallink
bslalg::BidirectionalLink::BidirectionalLink | ( | ) |
Create a BidirectionalLink
object having uninitialized values, or zero-initialized values if value-initialized.
bslalg::BidirectionalLink::BidirectionalLink | ( | const BidirectionalLink & | original | ) |
Create a BidirectionalLink
object having the same data member values as the specified original
object.
bslalg::BidirectionalLink::~BidirectionalLink | ( | ) |
Destroy this object.
BidirectionalLink& bslalg::BidirectionalLink::operator= | ( | const BidirectionalLink & | rhs | ) |
Assign to the data members of this object the values of the data members of the specified rhs
object, and return a reference providing modifiable access to this object.
void bslalg::BidirectionalLink::setNextLink | ( | BidirectionalLink * | next | ) |
Set the successor of this node to be the specified next
link.
void bslalg::BidirectionalLink::setPreviousLink | ( | BidirectionalLink * | previous | ) |
Set the predecessor of this node to be the specified prev
link.
void bslalg::BidirectionalLink::reset | ( | ) |
Set the nextLink
and previousLink
attributes of this value to 0.
BidirectionalLink* bslalg::BidirectionalLink::nextLink | ( | ) | const |
Return the address of the next node linked from this node.
BidirectionalLink* bslalg::BidirectionalLink::previousLink | ( | ) | const |
Return the address of the preceding node linked from this node.