HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Set< K, H, P > Class Template Reference

#include <UT_Set.h>

+ Inheritance diagram for UT_Set< K, H, P >:

Public Types

typedef hboost::unordered_set
< K, H, P
Base
 
typedef H Hasher
 
typedef P Equal
 
typedef Base::key_type key_type
 
typedef Base::value_type value_type
 
typedef Base::hasher hasher
 
typedef Base::key_equal key_equal
 
typedef Base::iterator iterator
 
typedef Base::const_iterator const_iterator
 

Public Member Functions

 UT_Set (const Hasher &hf=Hasher(), const Equal &eql=Equal())
 
template<typename InputIt >
 UT_Set (InputIt first, InputIt last, const Hasher &hf=Hasher(), const Equal &eql=Equal())
 
 UT_Set (const K &k, const Hasher &hf=Hasher(), const Equal &eql=Equal())
 
 UT_Set (std::initializer_list< K > init, const Hasher &hf=Hasher(), const Equal &eql=Equal())
 
int64 getMemoryUsage (bool inclusive) const
 
bool contains (const K &key) const
 
bool contains (const UT_Set< K > &src) const
 
void clear ()
 
UT_Set< K, H, P > & operator|= (const UT_Set< K, H, P > &src)
 Set-wise boolean operations. More...
 
UT_Set< K, H, P > & operator&= (const UT_Set< K, H, P > &src)
 
UT_Set< K, H, P > & operator-= (const UT_Set< K, H, P > &src)
 

Detailed Description

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
class UT_Set< K, H, P >

Examples:
field3d/f3d_io.C.

Definition at line 58 of file UT_Set.h.

Member Typedef Documentation

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef hboost::unordered_set<K, H, P> UT_Set< K, H, P >::Base

Definition at line 61 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::const_iterator UT_Set< K, H, P >::const_iterator

Definition at line 159 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef P UT_Set< K, H, P >::Equal

Definition at line 63 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef H UT_Set< K, H, P >::Hasher

Definition at line 62 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::hasher UT_Set< K, H, P >::hasher

Definition at line 156 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::iterator UT_Set< K, H, P >::iterator

Definition at line 158 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::key_equal UT_Set< K, H, P >::key_equal

Definition at line 157 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::key_type UT_Set< K, H, P >::key_type

Definition at line 154 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
typedef Base::value_type UT_Set< K, H, P >::value_type

Definition at line 155 of file UT_Set.h.

Constructor & Destructor Documentation

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_Set< K, H, P >::UT_Set ( const Hasher hf = Hasher(),
const Equal eql = Equal() 
)
inlineexplicit

Definition at line 65 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
template<typename InputIt >
UT_Set< K, H, P >::UT_Set ( InputIt  first,
InputIt  last,
const Hasher hf = Hasher(),
const Equal eql = Equal() 
)
inline

Definition at line 71 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_Set< K, H, P >::UT_Set ( const K &  k,
const Hasher hf = Hasher(),
const Equal eql = Equal() 
)
inline

Definition at line 79 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_Set< K, H, P >::UT_Set ( std::initializer_list< K >  init,
const Hasher hf = Hasher(),
const Equal eql = Equal() 
)
inline

Constructs a set from an initializer list: UT_Set<int> some_set({5,123,500});

Definition at line 89 of file UT_Set.h.

Member Function Documentation

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
void UT_Set< K, H, P >::clear ( void  )
inline

The implementation of clear() is O(bucket_count()), not O(size()), which can cause unexpected performance issues if the map has a large capacity. For std::unordered_map this was defect 2550 (http://cplusplus.github.io/LWG/lwg-defects.html#2550) When updating or changing the underlying implemention, verify if this is still necessary.

Definition at line 124 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
bool UT_Set< K, H, P >::contains ( const K &  key) const
inline

Determines membership in a set, a bit more semantically readable than count() or find()

Definition at line 108 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
bool UT_Set< K, H, P >::contains ( const UT_Set< K > &  src) const
inline

Definition at line 111 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
int64 UT_Set< K, H, P >::getMemoryUsage ( bool  inclusive) const
inline

Definition at line 99 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_Set<K,H,P>& UT_Set< K, H, P >::operator&= ( const UT_Set< K, H, P > &  src)
inline

Definition at line 140 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_Set<K,H,P>& UT_Set< K, H, P >::operator-= ( const UT_Set< K, H, P > &  src)
inline

Definition at line 147 of file UT_Set.h.

template<typename K, typename H = hboost::hash<K>, typename P = std::equal_to<K>>
UT_Set<K,H,P>& UT_Set< K, H, P >::operator|= ( const UT_Set< K, H, P > &  src)
inline

Set-wise boolean operations.

Definition at line 136 of file UT_Set.h.


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