53 inline virtual const char*
get_name()
const {
return "ListElement"; }
60 "Next element in list.");
88 "Delete data on destruction?");
90 "Number of elements.");
92 "First element in list.");
99 this->delete_data=p_delete_data;
104 SG_DEBUG(
"Destroying List %p\n",
this);
112 SG_DEBUG(
"Destroying List Element %p\n", d);
135 return current->
data;
152 return current->
data;
164 if ((current != NULL) && (current->
next != NULL))
166 current = current->
next;
169 return current->
data;
181 if ((current != NULL) && (current->
prev != NULL))
183 current = current->
prev;
186 return current->
data;
202 return current->
data;
224 return p_current->
data;
242 return p_current->
data;
255 if ((p_current != NULL) && (p_current->
next != NULL))
257 p_current = p_current->
next;
260 return p_current->
data;
273 if ((p_current != NULL) && (p_current->
prev != NULL))
275 p_current = p_current->
prev;
278 return p_current->
data;
291 if (p_current != NULL)
295 return p_current->
data;
324 if ((element =
new CListElement(data, current)) != NULL)
326 current->
next = element;
390 if (current->
prev != NULL)
395 current->
prev = element;
434 current = element->
next;
436 current = element->
prev;
438 if (element == first)
439 first = element->
next;
442 last = element->
prev;
467 inline virtual const char*
get_name()
const {
return "List"; }
479 int32_t num_elements;
CSGObject * get_next_element()
Class ShogunException defines an exception which is thrown whenever an error inside of shogun occurs...
CSGObject * delete_element()
virtual const char * get_name() const
void add(bool *param, const char *name, const char *description="")
CSGObject * get_first_element()
Class SGObject is the base class of all shogun objects.
CList(bool p_delete_data=false)
CSGObject * get_current_element(CListElement *&p_current)
CSGObject * get_last_element(CListElement *&p_current)
int32_t get_num_elements()
CSGObject * get_previous_element()
virtual ~CListElement()
destructor
CListElement(CSGObject *p_data, CListElement *p_prev=NULL, CListElement *p_next=NULL)
virtual void load_serializable_post()
Class ListElement, defines how an element of the the list looks like.
bool append_element(CSGObject *data)
CSGObject * get_next_element(CListElement *&p_current)
CSGObject * get_previous_element(CListElement *&p_current)
CSGObject * get_last_element()
virtual const char * get_name() const
CSGObject * get_first_element(CListElement *&p_current)
bool append_element_at_listend(CSGObject *data)
virtual void load_serializable_post()
CSGObject * get_current_element()
Class List implements a doubly connected list for low-level-objects.
bool insert_element(CSGObject *data)