contents up previous next

wxnode

wxnodebase is the node structure used in linked lists (see wxlist) and derived classes. you should never use wxnodebase class directly, however, because it works with untyped (void *) data and this is unsafe. use wxnodebase-derived classes which are automatically defined by wx_declare_list and wx_define_list macros instead as described in wxlist documentation (see example there). also note that although there is a class called wxnode, it is defined for backwards compatibility only and usage of this class is strongly deprecated.

in the documentation below, the type t should be thought of as a "template'' parameter: this is the type of data stored in the linked list or, in other words, the first argument of wx_declare_list macro. also, wxnode is written as wxnode<t> even though it isn't really a template class -- but it helps to think of it as if it were.

derived from

none.

include files

<wx/list.h>

see also

wxlist, wxhashtable

members

wxnode<t>::getdata
wxnode<t>::getnext
wxnode<t>::getprevious
wxnode<t>::setdata
wxnode<t>::indexof


wxnode<t>::getdata

t * getdata() const

retrieves the client data pointer associated with the node.


wxnode<t>::getnext

wxnode<t> * getnext() const

retrieves the next node or null if this node is the last one.


wxnode<t>::getprevious

wxnode<t> * getprevious()

retrieves the previous node or null if this node is the first one in the list.


wxnode<t>::setdata

void setdata(t *data)

sets the data associated with the node (usually the pointer will have been set when the node was created).


wxnode<t>::indexof

int indexof()

returns the zero-based index of this node within the list. the return value will be wxnot_found if the node has not been added to a list yet.