GCGlib
0.04.228
GCG Graphics Engine
|
Base abstract class for defining data structures in GCGlib. It indicates the minimum methods that all data structures must provide. Some abstract specializations of this class demand other interfaces to handle their elements under more specific or restricted conditions. More...
#include <gcg.h>
Private Member Functions | |
virtual uintptr_t | getCounter ()=0 |
Gets the number of elements stored in the data structure. More... | |
virtual bool | deleteAll ()=0 |
Deletes and removes all entries from the data structure. All resources used by the data structure are also released. More... | |
virtual gcgITERATOR * | getIterator (int traversemode=0)=0 |
Returns an iterator for traversing the elements of the data structure. The traversal order is defined by the parameter traversemode. The possible traverse modes are dependent on the data structure and its implementation. Always check the specific documentation of the specialized data structure to find the available traversing modes. The data structure must not be changed by insertions, removals or moves while the iterator is being used. You must delete the returned iterator after use. The iterator copies a minimal information from the data structure. Note that deleting an iterator does not affect the nodes. More... | |
virtual gcgITERATOR * | detach (int traversemode=0)=0 |
Force the data structure to be empty. It has the same effect as removing all entries from the data structure but keeping their chaining (which will used by the returned iterator). The entries are NOT deleted. In order to retrieve the detached entries, a gcgITERATOR with default traversal mode is returned (traversemode = 0). This is useful to process the nodes freely and without the possible restrictions of the underlying data structure. Thus, the gcgITERATOR returned by gcDATASTRUCTURE::detach() MUST be used to delete all the entries or reinsert them in another data structure. The traversal order of the iterator is defined by the parameter traversemode. The possible traverse modes are dependent on the data structure and its implementation. Always check the specific documentation of the specialized data structure to find the available traversing modes. All resources currently used by the data structure are released (becomes empty) but it can be reused normally. You must delete the gcgITERATOR after its use. More... | |
Additional Inherited Members | |
Public Member Functions inherited from gcgCLASS | |
void * | operator new (size_t size) |
Defines a new operator to be used by instatiations of GCGlib classes instead the global one. More... | |
void * | operator new (size_t size, const std::nothrow_t &) throw () |
Defines a new operator to be used by instantiations of GCGlib classes instead the global one. Returns a NULL pointer instead of throwing an exception if an error occurs. More... | |
void * | operator new[] (size_t size) |
Defines a new operator to be used by GCGlib array allocations instead the global one. More... | |
void * | operator new[] (size_t size, const std::nothrow_t &) throw () |
Defines a new operator to be used by vector allocations instead the global one. More... | |
void | operator delete (void *p) |
Defines a delete operator to free instances of GCGlib classes instead the global one. It is designed to match the new operator. More... | |
void | operator delete (void *p, const std::nothrow_t &) throw () |
Defines a delete operator to free instances of GCGlib classes instead the global one. It is designed to match the new operator. More... | |
void | operator delete[] (void *p) |
Defines a delete operator to free instances of arrays for GCGlib classes instead the global one. It is designed to match the new[] operator. More... | |
void | operator delete[] (void *p, const std::nothrow_t &) throw () |
Defines a delete operator to free instances of arrays for GCGlib classes instead the global one. It is designed to match the new[] operator. More... | |
Base abstract class for defining data structures in GCGlib. It indicates the minimum methods that all data structures must provide. Some abstract specializations of this class demand other interfaces to handle their elements under more specific or restricted conditions.
|
privatepure virtual |
Deletes and removes all entries from the data structure. All resources used by the data structure are also released.
Implemented in gcgPATRICIAMAP, gcgHASHTABLE, gcgAVLTREE, gcgDOUBLELINKEDLIST, and gcgLINKEDLIST.
|
privatepure virtual |
Force the data structure to be empty. It has the same effect as removing all entries from the data structure but keeping their chaining (which will used by the returned iterator). The entries are NOT deleted. In order to retrieve the detached entries, a gcgITERATOR with default traversal mode is returned (traversemode = 0). This is useful to process the nodes freely and without the possible restrictions of the underlying data structure. Thus, the gcgITERATOR returned by gcDATASTRUCTURE::detach() MUST be used to delete all the entries or reinsert them in another data structure. The traversal order of the iterator is defined by the parameter traversemode. The possible traverse modes are dependent on the data structure and its implementation. Always check the specific documentation of the specialized data structure to find the available traversing modes. All resources currently used by the data structure are released (becomes empty) but it can be reused normally. You must delete the gcgITERATOR after its use.
traversemode | Specifies the order that the available elements in a data structure must be traversed by the returned iterator. The possible traverse modes are dependent on the specialized data structure and its implementation. Always check the specific documentation of the data structure to find the available traversing modes. |
Implemented in gcgPATRICIAMAP, gcgHASHTABLE, gcgAVLTREE, gcgDOUBLELINKEDLIST, and gcgLINKEDLIST.
|
privatepure virtual |
Gets the number of elements stored in the data structure.
Implemented in gcgPATRICIAMAP, gcgHASHTABLE, gcgAVLTREE, gcgDOUBLELINKEDLIST, and gcgLINKEDLIST.
|
privatepure virtual |
Returns an iterator for traversing the elements of the data structure. The traversal order is defined by the parameter traversemode. The possible traverse modes are dependent on the data structure and its implementation. Always check the specific documentation of the specialized data structure to find the available traversing modes. The data structure must not be changed by insertions, removals or moves while the iterator is being used. You must delete the returned iterator after use. The iterator copies a minimal information from the data structure. Note that deleting an iterator does not affect the nodes.
traversemode | Specifies the order that the available elements in a data structure must be traversed. The possible traverse modes are dependent on the specialized data structure and its implementation. Always check the specific documentation of the data structure to find the available traversing modes. |
Implemented in gcgPATRICIAMAP, gcgHASHTABLE, gcgAVLTREE, gcgDOUBLELINKEDLIST, and gcgLINKEDLIST.