SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction > Class Template Reference

Using a string as a identifier for a node, store an allocated pointer to that node. More...

`#include <slikenet/DS_Hash.h>`

Inheritance diagram for DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >:

## Classes

struct | Node

## Public Member Functions

| Hash ()
| Default constructor.
| ~Hash ()
void | Push (key_type key, const data_type &input, const char *file, unsigned int line)
data_type * | Peek (key_type key)
bool | Pop (data_type &out, key_type key, const char *file, unsigned int line)
bool | RemoveAtIndex (HashIndex index, const char *file, unsigned int line)
bool | Remove (key_type key, const char *file, unsigned int line)
HashIndex | GetIndexOf (key_type key)
bool | HasData (key_type key)
data_type & | ItemAtIndex (const HashIndex &index)
key_type | KeyAtIndex (const HashIndex &index)
void | GetAsList (DataStructures::List< data_type > &itemList, DataStructures::List< key_type > &keyList, const char *file, unsigned int line) const
unsigned int | Size (void) const
void | Clear (const char *file, unsigned int line)
| Clear the list.

## Protected Member Functions

void | ClearIndex (unsigned int index, const char *file, unsigned int line)

## Protected Attributes

Node ** | nodeList
unsigned int | size

## Detailed Description

### template<class key_type, class data_type, unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>
class DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >

Using a string as a identifier for a node, store an allocated pointer to that node.

Definition at line 44 of file DS_Hash.h.

## Constructor & Destructor Documentation

template<class key_type , class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Hash | ( |  | ) |

Default constructor.

Definition at line 84 of file DS_Hash.h.

template<class key_type , class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::~Hash | ( |  | ) |

Definition at line 91 of file DS_Hash.h.

References _FILE_AND_LINE_.

## Member Function Documentation

template<class key_type , class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

void DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Clear | ( | const char * | file,
|  | unsigned int | line
| ) |  |

Clear the list.

Definition at line 304 of file DS_Hash.h.

References SLNet::OP_DELETE_ARRAY().

template<class key_type , class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

void DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::ClearIndex | ( | unsigned int | index,
|  | const char * | file,
|  | unsigned int | line
| ) |  |

protected

Definition at line 318 of file DS_Hash.h.

References DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::next, and SLNet::OP_DELETE().

template<class key_type, class data_type, unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

void DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::GetAsList | ( | DataStructures::List< data_type > & | itemList,
|  | DataStructures::List< key_type > & | keyList,
|  | const char * | file,
|  | unsigned int | line
| ) |  | const

Definition at line 333 of file DS_Hash.h.

References _FILE_AND_LINE_, DataStructures::List< list_type >::Clear(), DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::data, DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::next, DataStructures::List< list_type >::Push(), and DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::string.

template<class key_type, class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

HashIndex DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::GetIndexOf | ( | key_type | key | ) |

Definition at line 238 of file DS_Hash.h.

References DataStructures::HashIndex::primaryIndex, DataStructures::HashIndex::secondaryIndex, and DataStructures::HashIndex::SetInvalid().

template<class key_type, class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

bool DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::HasData | ( | key_type | key | ) |

Definition at line 270 of file DS_Hash.h.

template<class key_type , class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

data_type & DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::ItemAtIndex | ( | const HashIndex & | index | ) |

Definition at line 276 of file DS_Hash.h.

References DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::data, DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::next, DataStructures::HashIndex::primaryIndex, RakAssert, and DataStructures::HashIndex::secondaryIndex.

template<class key_type , class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

key_type DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::KeyAtIndex | ( | const HashIndex & | index | ) |

Definition at line 290 of file DS_Hash.h.

References DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::next, DataStructures::HashIndex::primaryIndex, RakAssert, DataStructures::HashIndex::secondaryIndex, and DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::string.

template<class key_type, class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

data_type * DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Peek | ( | key_type | key | ) |

Definition at line 114 of file DS_Hash.h.

References DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::data.

template<class key_type, class data_type, unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

bool DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Pop | ( | data_type & | out,
|  | key_type | key,
|  | const char * | file,
|  | unsigned int | line
| ) |  |

Definition at line 131 of file DS_Hash.h.

References _FILE_AND_LINE_, DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::data, DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::next, and SLNet::OP_DELETE().

template<class key_type, class data_type, unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

void DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Push | ( | key_type | key,
|  | const data_type & | input,
|  | const char * | file,
|  | unsigned int | line
| ) |  |

Definition at line 97 of file DS_Hash.h.

References DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::next.

template<class key_type, class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

bool DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Remove | ( | key_type | key,
|  | const char * | file,
|  | unsigned int | line
| ) |  |

Definition at line 232 of file DS_Hash.h.

template<class key_type , class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

bool DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::RemoveAtIndex | ( | HashIndex | index,
|  | const char * | file,
|  | unsigned int | line
| ) |  |

Definition at line 189 of file DS_Hash.h.

References DataStructures::HashIndex::IsInvalid(), DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Node::next, SLNet::OP_DELETE(), DataStructures::HashIndex::primaryIndex, and DataStructures::HashIndex::secondaryIndex.

template<class key_type , class data_type , unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

unsigned int DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::Size | ( | void |  | ) | const

Definition at line 357 of file DS_Hash.h.

## Member Data Documentation

template<class key_type, class data_type, unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

Node** DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::nodeList

protected

Definition at line 79 of file DS_Hash.h.

template<class key_type, class data_type, unsigned int HASH_SIZE, unsigned long(*)(const key_type &) hashFunction>

unsigned int DataStructures::Hash< key_type, data_type, HASH_SIZE, hashFunction >::size

protected

Definition at line 80 of file DS_Hash.h.

The documentation for this class was generated from the following file:

- Source/include/slikenet/DS_Hash.h