ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcbLIST.hpp
Go to the documentation of this file.
1
7#ifndef ngcbLIST_H
8#define ngcbLIST_H
9
10
11#ifndef __cplusplus
12#error This is a C++ include file and cannot be used from plain C
13#endif
14
15/*
16 * System Headers
17 */
18#include <stdlib.h>
19#include <stdio.h>
20#include <string.h>
21
22/*
23 * Local Headers
24 */
25#include <ngc/core/ngcb.h>
26
27
28
33{
34public:
36 void *item;
37
40
42 ngcbLIST();
43
45 ngcbLIST(void *newItem, unsigned long int id);
46
48 virtual ~ngcbLIST();
49
51 ngcbLIST *First() const;
52
54 unsigned long int Id() const;
55
57 int IsEmpty() const;
58
60 size_t Size() const;
61
63 void Clear();
64
66 void Add(void *newItem, unsigned long int id);
67
69 void Remove(unsigned long int id);
70
72 void *PopFront();
73
75 void Add(unsigned long int newItem, unsigned long int id);
76
78 void Add(long int newItem, unsigned long int id);
79
81 void Add(unsigned int newItem, unsigned long int id);
82
84 void Add(int newItem, unsigned long int id);
85
87 void Add(void *newItem, void *id);
88
90 void Add(void *newItem);
91
93 void Remove(void *listItem);
94
96 void *Get(void *listItem) const;
97
99 void *Get(unsigned long int id) const;
100
102 int GetScalar(unsigned long int *scalar, unsigned long int id) const;
103
105 int GetScalar(long int *scalar, unsigned long int id) const;
106
108 int GetScalar(unsigned int *scalar, unsigned long int id) const;
109
111 int GetScalar(int *scalar, unsigned long int id) const;
112
114 void Print(FILE *s) const;
115
116protected:
117private:
119 ngcbLIST *insert_;
120
122 unsigned long int id_;
123
125 size_t size_;
126};
127
128#endif
129
130
131
void * item
Item.
Definition ngcbLIST.hpp:36
virtual ~ngcbLIST()
Destructor.
Definition ngcbLIST.cpp:26
int IsEmpty() const
Check, if list is empty.
Definition ngcbLIST.cpp:35
unsigned long int Id() const
Get identifier.
Definition ngcbLIST.cpp:33
void Remove(unsigned long int id)
Remove item from list.
Definition ngcbLIST.cpp:60
int GetScalar(unsigned long int *scalar, unsigned long int id) const
Get unsigned long scalar item from list.
Definition ngcbLIST.cpp:146
void * PopFront()
Remove first item from list.
Definition ngcbLIST.cpp:77
void * Get(void *listItem) const
Get referenced item from list.
Definition ngcbLIST.cpp:131
void Add(void *newItem, unsigned long int id)
Add item to list.
Definition ngcbLIST.cpp:50
void Print(FILE *s) const
Print list to stream (debugging function)
Definition ngcbLIST.cpp:202
ngcbLIST()
List constructor.
Definition ngcbLIST.cpp:14
void Clear()
Clear list.
Definition ngcbLIST.cpp:39
size_t Size() const
Get current list size.
Definition ngcbLIST.cpp:37
ngcbLIST * First() const
Return list entry point.
Definition ngcbLIST.cpp:31
ngcbLIST * next
Next item.
Definition ngcbLIST.hpp:39