Go to the first, previous, next, last section, table of contents.


CNSLObject -- Node of Single Linked List

SYNOPSIS

#include <CNCL/SLObject.h>

TYPE

CN_SLOBJECT

BASE CLASSES

CNObject

DERIVED CLASSES

CNDLObject

RELATED CLASSES

CNSLList, CNSLIterator

DESCRIPTION

CNSLObject is a node in the CNSLList single linked list. It contains a pointer to the next and a pointer to the referenced object.

Constructors:

CNSLObject();
CNSLObject(CNParam *param);
CNSLObject(CNObject *obj);
Initializes CNSLObject and optionally sets a referenced object.

CNSLObjects have a private destructor and can therefore only be allocated on the heap. Furthermore CNSLObjects cannot be copied, no copy constructor is supplied; an attempt to do so results in a runtime error.

In addition to the member functions required by CNCL, CNSLObject provides:

CNSLObject *set_next(CNSLObject *p);
CNSLObject *next(CNSLObject *p);
CNSLObject *get_next();
CNSLObject *next();
Sets/gets the pointer to the next node. It returns the current pointer.
CNObject *object(CNObject *obj);
CNObject *object();
CNObject *set_object(CNObject *obj);
CNObject *get_object();
Gets/sets the pointer to the referenced object. It returns the current value.
void delete_object();
Deletes the referenced object.


Go to the first, previous, next, last section, table of contents.