ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcbLIST.hpp
Go to the documentation of this file.
1
8#ifndef ngcbLIST_H
9#define ngcbLIST_H
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
16/*
17 * System Headers
18 */
19#include <stdlib.h>
20#include <stdio.h>
21#include <string.h>
22
23/*
24 * Local Headers
25 */
26#include <ngc/core/ngcb.h>
27
28
29
34{
35public:
37 void *item;
38
41
43 ngcbLIST();
44
46 ngcbLIST(void *newItem, unsigned long int id);
47
49 virtual ~ngcbLIST();
50
52 ngcbLIST *First() const;
53
55 unsigned long int Id() const;
56
58 int IsEmpty() const;
59
61 size_t Size() const;
62
64 void Clear();
65
67 void Add(void *newItem, unsigned long int id);
68
70 void Remove(unsigned long int id);
71
73 void *PopFront();
74
76 void Add(unsigned long int newItem, unsigned long int id);
77
79 void Add(long int newItem, unsigned long int id);
80
82 void Add(unsigned int newItem, unsigned long int id);
83
85 void Add(int newItem, unsigned long int id);
86
88 void Add(void *newItem, void *id);
89
91 void Add(void *newItem);
92
94 void Remove(void *listItem);
95
97 void *Get(void *listItem) const;
98
100 void *Get(unsigned long int id) const;
101
103 int GetScalar(unsigned long int *scalar, unsigned long int id) const;
104
106 int GetScalar(long int *scalar, unsigned long int id) const;
107
109 int GetScalar(unsigned int *scalar, unsigned long int id) const;
110
112 int GetScalar(int *scalar, unsigned long int id) const;
113
115 void Print(FILE *s) const;
116
117protected:
118private:
120 ngcbLIST *insert_;
121
123 unsigned long int id_;
124
126 size_t size_;
127};
128
129#endif
130
131
132
void * item
Item.
Definition ngcbLIST.hpp:37
virtual ~ngcbLIST()
Destructor.
Definition ngcbLIST.cpp:27
int IsEmpty() const
Check, if list is empty.
Definition ngcbLIST.cpp:36
unsigned long int Id() const
Get identifier.
Definition ngcbLIST.cpp:34
void Remove(unsigned long int id)
Remove item from list.
Definition ngcbLIST.cpp:61
int GetScalar(unsigned long int *scalar, unsigned long int id) const
Get unsigned long scalar item from list.
Definition ngcbLIST.cpp:147
void * PopFront()
Remove first item from list.
Definition ngcbLIST.cpp:78
void * Get(void *listItem) const
Get referenced item from list.
Definition ngcbLIST.cpp:132
void Add(void *newItem, unsigned long int id)
Add item to list.
Definition ngcbLIST.cpp:51
void Print(FILE *s) const
Print list to stream (debugging function)
Definition ngcbLIST.cpp:203
ngcbLIST()
List constructor.
Definition ngcbLIST.cpp:15
void Clear()
Clear list.
Definition ngcbLIST.cpp:40
size_t Size() const
Get current list size.
Definition ngcbLIST.cpp:38
ngcbLIST * First() const
Return list entry point.
Definition ngcbLIST.cpp:32
ngcbLIST * next
Next item.
Definition ngcbLIST.hpp:40