MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Hash_set< T, K > Class Template Reference

#include <sql_hset.h>

Classes

class  Iterator

Public Types

enum  { START_SIZE = 8 }
typedef T Value_type

Public Member Functions

 Hash_set ()
 ~Hash_set ()
bool insert (T *value)
bool is_empty () const
size_t size () const

Detailed Description

template<typename T, my_hash_get_key K>
class Hash_set< T, K >

A type-safe wrapper around mysys HASH.

Definition at line 27 of file sql_hset.h.

Constructor & Destructor Documentation

template<typename T, my_hash_get_key K>
Hash_set< T, K >::Hash_set ( )
inline

Constructs an empty hash. Does not allocate memory, it is done upon the first insert. Thus does not cause or return errors.

Definition at line 36 of file sql_hset.h.

template<typename T, my_hash_get_key K>
Hash_set< T, K >::~Hash_set ( )
inline

Destroy the hash by freeing the buckets table. Does not call destructors for the elements.

Definition at line 44 of file sql_hset.h.

Member Function Documentation

template<typename T, my_hash_get_key K>
bool Hash_set< T, K >::insert ( T *  value)
inline

Insert a single value into a hash. Does not tell whether the value was inserted – if an identical value existed, it is not replaced.

Return values
TRUEOut of memory.
FALSEOK. The value either was inserted or existed in the hash.

Definition at line 57 of file sql_hset.h.

Here is the caller graph for this function:

template<typename T, my_hash_get_key K>
bool Hash_set< T, K >::is_empty ( void  ) const
inline

Is this hash set empty?

Definition at line 67 of file sql_hset.h.

template<typename T, my_hash_get_key K>
size_t Hash_set< T, K >::size ( ) const
inline

Returns the number of unique elements.

Definition at line 69 of file sql_hset.h.


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