CookMem 1.4.0
A C++ memory context / allocator
Loading...
Searching...
No Matches
cookmem::CircularList< Node > Class Template Reference

#include <circularlist.h>

Public Member Functions

void add (Node *ptr)
 
Node * remove ()
 
bool remove (Node *chunk)
 
bool contains (Node *chunk)
 
bool isEmpty () const
 

Detailed Description

template<class Node>
class cookmem::CircularList< Node >

A circular list maintenance logic.

The Node class should have next and prev variables.

Member Function Documentation

◆ add()

template<class Node >
void cookmem::CircularList< Node >::add ( Node *  ptr)
inline

Add a node to the list.

Parameters
ptra node pointer to be added to the list

◆ contains()

template<class Node >
bool cookmem::CircularList< Node >::contains ( Node *  chunk)
inline

Check if a chunk is in the list

◆ isEmpty()

template<class Node >
bool cookmem::CircularList< Node >::isEmpty ( ) const
inline

Check if the list is empty.

Returns
true if the list is empty. false otherwise.

◆ remove() [1/2]

template<class Node >
Node * cookmem::CircularList< Node >::remove ( )
inline

Remove the first node from the list.

Returns
the first node in the list.

◆ remove() [2/2]

template<class Node >
bool cookmem::CircularList< Node >::remove ( Node *  chunk)
inline

Remove a chunk from the list.

Parameters
chunkthe chunk to be removed.
Returns
true if the list is now empty. false otherwise.

The documentation for this class was generated from the following file: