SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions
CList Class Reference

Detailed Description

Class List implements a doubly connected list for low-level-objects.

For higher level objects pointers should be used. The list supports calling delete() of an object that is to be removed from the list.

Definition at line 78 of file List.h.

Inheritance diagram for CList:
Inheritance graph
[legend]

Public Member Functions

 CList (bool p_delete_data=false)
virtual ~CList ()
int32_t get_num_elements ()
CSGObjectget_first_element ()
CSGObjectget_last_element ()
CSGObjectget_next_element ()
CSGObjectget_previous_element ()
CSGObjectget_current_element ()
bool append_element (CSGObject *data)
bool append_element_at_listend (CSGObject *data)
bool insert_element (CSGObject *data)
CSGObjectdelete_element ()
virtual void load_serializable_post () throw (ShogunException)
virtual const char * get_name () const
thread safe list access functions
CSGObjectget_first_element (CListElement *&p_current)
CSGObjectget_last_element (CListElement *&p_current)
CSGObjectget_next_element (CListElement *&p_current)
CSGObjectget_previous_element (CListElement *&p_current)
CSGObjectget_current_element (CListElement *&p_current)
- Public Member Functions inherited from CSGObject
 CSGObject ()
 CSGObject (const CSGObject &orig)
virtual ~CSGObject ()
virtual bool is_generic (EPrimitiveType *generic) const
template<class T >
void set_generic ()
void unset_generic ()
virtual void print_serializable (const char *prefix="")
virtual bool save_serializable (CSerializableFile *file, const char *prefix="")
virtual bool load_serializable (CSerializableFile *file, const char *prefix="")
void set_global_io (SGIO *io)
SGIOget_global_io ()
void set_global_parallel (Parallel *parallel)
Parallelget_global_parallel ()
void set_global_version (Version *version)
Versionget_global_version ()
SGVector< char * > get_modelsel_names ()
char * get_modsel_param_descr (const char *param_name)
index_t get_modsel_param_index (const char *param_name)

Additional Inherited Members

- Public Attributes inherited from CSGObject
SGIOio
Parallelparallel
Versionversion
Parameterm_parameters
Parameterm_model_selection_parameters
- Protected Member Functions inherited from CSGObject
virtual void load_serializable_pre () throw (ShogunException)
virtual void save_serializable_pre () throw (ShogunException)
virtual void save_serializable_post () throw (ShogunException)

Constructor & Destructor Documentation

CList ( bool  p_delete_data = false)

constructor

Parameters
p_delete_dataif data shall be deleted

Definition at line 85 of file List.h.

virtual ~CList ( )
virtual

Definition at line 102 of file List.h.

Member Function Documentation

bool append_element ( CSGObject data)

append element AFTER the current element

Parameters
datadata element to append
Returns
if appending was successful

Definition at line 307 of file List.h.

bool append_element_at_listend ( CSGObject data)

append at end of list

Parameters
datadata element to append
Returns
if appending was successful

Definition at line 350 of file List.h.

CSGObject* delete_element ( )

erases current element the new current element is the successor of the former current element

Returns
the elements data - if available - otherwise NULL

Definition at line 413 of file List.h.

CSGObject* get_current_element ( )

get current element in list

Returns
current element in list or NULL if not available

Definition at line 196 of file List.h.

CSGObject* get_current_element ( CListElement *&  p_current)

get current element in list

Parameters
p_currentcurrent list element
Returns
current element in list or NULL if not available

Definition at line 289 of file List.h.

CSGObject* get_first_element ( )

go to first element in list and return it

Returns
first element in list or NULL if list is empty

Definition at line 128 of file List.h.

CSGObject* get_first_element ( CListElement *&  p_current)

go to first element in list and return it

Parameters
p_currentcurrent list element
Returns
first element in list or NULL if list is empty

Definition at line 217 of file List.h.

CSGObject* get_last_element ( )

go to last element in list and return it

Returns
last element in list or NULL if list is empty

Definition at line 145 of file List.h.

CSGObject* get_last_element ( CListElement *&  p_current)

go to last element in list and return it

Parameters
p_currentcurrent list element
Returns
last element in list or NULL if list is empty

Definition at line 235 of file List.h.

virtual const char* get_name ( ) const
virtual
Returns
object name

Implements CSGObject.

Definition at line 467 of file List.h.

CSGObject* get_next_element ( )

go to next element in list and return it

Returns
next element in list or NULL if list is empty

Definition at line 162 of file List.h.

CSGObject* get_next_element ( CListElement *&  p_current)

go to next element in list and return it

Parameters
p_currentcurrent list element
Returns
next element in list or NULL if list is empty

Definition at line 253 of file List.h.

int32_t get_num_elements ( )

get number of elements in list

Returns
number of elements in list

Definition at line 122 of file List.h.

CSGObject* get_previous_element ( )

go to previous element in list and return it

Returns
previous element in list or NULL if list is empty

Definition at line 179 of file List.h.

CSGObject* get_previous_element ( CListElement *&  p_current)

go to previous element in list and return it

Parameters
p_currentcurrent list element
Returns
previous element in list or NULL if list is empty

Definition at line 271 of file List.h.

bool insert_element ( CSGObject data)

insert element BEFORE the current element

Parameters
datadata element to insert
Returns
if inserting was successful

Definition at line 364 of file List.h.

virtual void load_serializable_post ( ) throw (ShogunException)
virtual

Can (optionally) be overridden to post-initialize some member variables which are not PARAMETER::ADD'ed. Make sure that at first the overridden method BASE_CLASS::LOAD_SERIALIZABLE_POST is called.

Exceptions
ShogunExceptionWill be thrown if an error occurres.

Reimplemented from CSGObject.

Definition at line 452 of file List.h.


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

SHOGUN Machine Learning Toolbox - Documentation