We want to be consistent with the previous layout, to avoid needlessly breaking existing codes. The header update means client codes are not required to include all of the stepcode library includes explicitly - i.e., stepcode itself does not force this requirement with its own internal includes. However, if client codes do not want to add the library prefixes to their own includes as we have for stepcode, they should still be able to add the various includes and work as before. Adjust the include directory names accordingly.
63 lines
1.4 KiB
C++
63 lines
1.4 KiB
C++
#ifndef singlelinklist_h
|
|
#define singlelinklist_h
|
|
|
|
/*
|
|
* NIST STEP Core Class Library
|
|
* clstepcore/SingleLinkList.h
|
|
* April 1997
|
|
* David Sauder
|
|
* KC Morris
|
|
|
|
* Development of this software was funded by the United States Government,
|
|
* and is not subject to copyright.
|
|
*/
|
|
|
|
#include <sc_export.h>
|
|
|
|
/** Base class for a singly-linked list.
|
|
* \sa SingleLinkNode
|
|
*
|
|
* node which represents the value is contained in the subclass
|
|
* since it may have different types for different lists
|
|
*/
|
|
class SC_CORE_EXPORT SingleLinkList {
|
|
protected:
|
|
class SingleLinkNode * head;
|
|
SingleLinkNode * tail;
|
|
public:
|
|
virtual SingleLinkNode * NewNode();
|
|
virtual void AppendNode( SingleLinkNode * );
|
|
virtual void DeleteNode( SingleLinkNode * );
|
|
|
|
virtual void Empty();
|
|
virtual void DeleteFollowingNodes( SingleLinkNode * );
|
|
virtual SingleLinkNode * GetHead() const;
|
|
|
|
int EntryCount() const;
|
|
|
|
SingleLinkList();
|
|
virtual ~SingleLinkList();
|
|
};
|
|
|
|
/** Base class for nodes of a single-linked list.
|
|
* \sa SingleLinkList
|
|
*/
|
|
class SC_CORE_EXPORT SingleLinkNode {
|
|
friend class SingleLinkList;
|
|
public:
|
|
SingleLinkList * owner;
|
|
SingleLinkNode * next;
|
|
|
|
virtual SingleLinkNode * NextNode() const {
|
|
return next;
|
|
}
|
|
|
|
SingleLinkNode() : owner( 0 ), next( 0 ) {
|
|
}
|
|
|
|
virtual ~SingleLinkNode() {
|
|
}
|
|
};
|
|
|
|
#endif
|