This commit is contained in:
Jeff Hill
2000-09-11 16:15:29 +00:00
parent 2e86137945
commit f58dd57315
3 changed files with 28 additions and 3 deletions

View File

@@ -3,13 +3,14 @@ C++ templates:
tsSLList.h - type safe single linked list template
tsDLList.h - type safe double linked list template
resourceLib.h - hash table template
tsFreeeList.h - free list allocator / deallocator
the test subdir contains examples
Since I am using templates the linked lists are type safe
(no casting of pointers ala ellList and dllList).
Also, the node class in embedded in the item on the
list (more efficent use of pool).
list (more efficient use of pool).
The file resourceLib.h provides a core hashing library
"resTable <itemClass, idClass>" where "itemClass" objects

View File

@@ -761,7 +761,7 @@ inline tsDLIterBD<T> tsDLIterBD<T>::operator -- (int) // postfix --
return tmp;
}
#include <tsDLListDeprecated.h>
#include "tsDLListDeprecated.h"
#endif // tsDLListH_include

View File

@@ -10,6 +10,31 @@
* Author: Jeff Hill
*/
//
// To allow your class to be allocated off of a free list
// using the new operator:
//
// 1) add the following static, private free list data member
// to your class
//
// static tsFreeList < class classXYZ, 1024 > freeList;
//
// 2) add the following member functions to your class
//
// inline void * classXYZ::operator new ( size_t size )
// {
// return classXYZ::freeList.allocate ( size );
// }
//
// inline void classXYZ::operator delete ( void *pCadaver, size_t size )
// {
// classXYZ::freeList.release ( pCadaver, size );
// }
//
// If you wish to force use of the new operator, then declare your class's
// destructor as a private member function.
//
#include <stdio.h>
#include <typeinfo>
#include "osiMutex.h"
@@ -18,7 +43,6 @@
# pragma warning ( disable : 4291 )
#endif
template < class T, unsigned DEBUG_LEVEL >
union tsFreeListItem {
public: