Instance of a linked list object that contains a pointer to arbitrary data. More...
Public Types | |
typedef void(*) | ProcDataDelete(Object *pObject) |
Data deletion callback pointer. | |
Public Member Functions | |
Object () noexcept | |
Default constructor. | |
Object (void *pData, ProcDataDelete pDataDelete=proc_free_data) noexcept | |
Default constructor. | |
~Object () | |
Destructor. | |
Object * | get_next (void) const noexcept |
Get the next pointer in the list. | |
Object * | get_previous (void) const noexcept |
Get the previous pointer in the list. | |
void * | get_data (void) const noexcept |
Get the data pointer contained in the Object. | |
void | set_data (void *pInput) noexcept |
Set the data pointer that will be contained in the Object. | |
ProcDataDelete | get_data_delete_proc (void) const noexcept |
Get the disposal function pointer associated with the Object. | |
void | set_data_delete_proc (ProcDataDelete pProc) noexcept |
Set the disposal function pointer that will be contained in the Object. | |
Static Public Member Functions | |
static void | proc_null (Object *pObject) noexcept |
Memory release proc for doing nothing. | |
static void | proc_free_object_and_data (Object *pObject) noexcept |
Memory release proc for releasing the data and object. | |
static void | proc_free_data (Object *pObject) noexcept |
Memory release proc for releasing the data only. | |
static void | proc_free_object (Object *pObject) noexcept |
Memory release proc for releasing the object only. | |
static Object * | New (void *pData, ProcDataDelete pProc=proc_free_object_and_data) noexcept |
Create a new Object instance. | |
Private Member Functions | |
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
void | shutdown (void) noexcept |
Dispose of a single object. | |
void | insert_before (Object *pObject) noexcept |
Attach the input object before this one in the list. | |
void | insert_after (Object *pObject) noexcept |
Attach the input object after this one in the list. | |
Private Member Functions inherited from Burger::DoubleLinkedList | |
DoubleLinkedList () noexcept | |
Initializer for a DoubleLinkedList. | |
~DoubleLinkedList () | |
Destructor for a DoubleLinkedList. | |
void | detach (void) noexcept |
Detach this object from any attached linked list. | |
void | insert_after (DoubleLinkedList *pInput) noexcept |
Attach the input object after this one in the list. | |
void | insert_before (DoubleLinkedList *pInput) noexcept |
Attach the input object before this one in the list. | |
DoubleLinkedList * | get_next (void) const noexcept |
Get the next pointer in the list. | |
DoubleLinkedList * | get_previous (void) const noexcept |
Get the previous pointer in the list. | |
Private Attributes | |
void * | m_pData |
Pointer to the data. | |
ProcDataDelete | m_ProcDataDelete |
Data destructor callback. | |
Friends | |
class | LinkedListObjects |
Additional Inherited Members | |
Static Private Member Functions inherited from Burger::DoubleLinkedList | |
static DoubleLinkedList * | New (void) noexcept |
Create a new DoubleLinkedList instance. | |
Instance of a linked list object that contains a pointer to arbitrary data.
Each LinkedListObjects::Object has a pointer to the generic data that is contained and also a pointer to a function to discard the data once the entry itself is deleted. The function pointer could be nullptr meaning that the data can be deleted with a simple call to Burger::Free(). The data could also be pointing to the end of the base LinkedListObjects::Object structure if the LinkedListObjects::Object structure is part of a larger structure.
void( *) Burger::LinkedListObjects::Object::ProcDataDelete(Object *pObject) |
Data deletion callback pointer.
Function pointer to delete data that's associated with this LinkedListObjects::Object
pObject | Pointer to the object to act upon. |
|
privatedelete |
|
privatedelete |
|
inlinenoexcept |
Default constructor.
Initialize the structure and set up a deallocation pointer that will only dispose of the data. This constructor is the one used for derived classes or static instances where the disposal of this class is handled by the compiler.
|
inlinenoexcept |
Default constructor.
Initialize the structure and set up a deallocation pointer that will only dispose of the data. This constructor is the one used for derived classes or static instances where the disposal of this class requires finer control.
pData | Pointer to data to store in this object |
pDataDelete | Pointer to function to dispose of this object |
|
inline |
Destructor.
Unlink this object from the parent linked list and then dispose of the contents. All of this is performed in a call to shutdown()
|
inlinenoexcept |
Get the data pointer contained in the Object.
Return the application supplied data pointer. It can be nullptr
|
inlinenoexcept |
Get the disposal function pointer associated with the Object.
Return the application supplied data disposal pointer.
|
inlinenoexcept |
Get the next pointer in the list.
Return the pointer to the next object in the list. Since the list is circular, it's the caller's responsibility to ensure that the start and end are detected properly
|
inlinenoexcept |
Get the previous pointer in the list.
Return the pointer to the previous object in the list. Since the list is circular, it's the caller's responsibility to ensure that the start and end are detected properly
|
inlineprivatenoexcept |
Attach the input object after this one in the list.
Detach the input object from any linked list and then attach the input object after this one in the current list.
pObject | Pointer to a Object object to link after this one |
|
inlineprivatenoexcept |
Attach the input object before this one in the list.
Detach the input object from any linked list and then attach the input object before this one in the current list.
pObject | Pointer to a Object object to link before this one |
|
staticnoexcept |
Create a new Object instance.
Allocate memory using Burger::Alloc() and initialize an Object with it.
pData | Pointer to the data this object will control, nullptr is acceptable |
pProc | Pointer to the disposal function |
|
staticnoexcept |
Memory release proc for releasing the data only.
Call Burger::Free() on the data pointer only. The Object is assumed to be either static or allocated elsewhere
The data pointer is set to nullptr
pObject | Pointer to the Object with data to delete (The object's pointer is not disposed of) |
|
staticnoexcept |
Memory release proc for releasing the object only.
Call Burger::Free() on the Object pointer only. The data is assumed to be either static or allocated elsewhere
pObject | Pointer to the Object to delete |
|
staticnoexcept |
Memory release proc for releasing the data and object.
Call Burger::Free() on both the Object and data pointers. This is the default behavior if no function was supplied
pObject | Pointer to the Object and data to delete |
|
staticnoexcept |
Memory release proc for doing nothing.
For data that is allocated and released by other means, use this function to perform no action when an item is deleted from the linked list.
pObject | Pointer to the Object to delete (Not used) |
|
inlinenoexcept |
Set the data pointer that will be contained in the Object.
Sets the a new data pointer. It can be nullptr
pInput | The new data pointer for the Object |
|
inlinenoexcept |
Set the disposal function pointer that will be contained in the Object.
Sets the a new disposal function pointer.
pProc | The new disposal function pointer for the Object |
|
privatenoexcept |
Dispose of a single object.
Unlink this object from the parent linked list and then dispose of the contents.
|
friend |
|
private |
Pointer to the data.
|
private |
Data destructor callback.