Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::base::AllocUnorderedSet< Value, Hash, Pred > Class Template Reference

This class can be used in place of std::unordered_set to allow an Ion Allocator to be used for memory allocation. More...

#include "allocunorderedset.h"

Inheritance diagram for ion::base::AllocUnorderedSet< Value, Hash, Pred >:
Collaboration diagram for ion::base::AllocUnorderedSet< Value, Hash, Pred >:

Public Types

typedef StlAllocator< ValueAllocType
 
typedef std::unordered_set
< Value, Hash, Pred, AllocType
SetType
 

Public Member Functions

 AllocUnorderedSet (const AllocatorPtr &alloc)
 
 AllocUnorderedSet (const Allocatable &owner)
 
template<typename ContainerT >
 AllocUnorderedSet (const AllocatorPtr &alloc, const ContainerT &from)
 These constructors can be used to copy from "STL iterables": anything that provides a pair of compatible iterators via begin() and end(). More...
 
template<typename ContainerT >
 AllocUnorderedSet (const Allocatable &owner, const ContainerT &from)
 

Public Attributes

keys
 STL member. More...
 

Detailed Description

template<typename Value, typename Hash = ::std::hash<Value>, typename Pred = ::std::equal_to<Value>>
class ion::base::AllocUnorderedSet< Value, Hash, Pred >

This class can be used in place of std::unordered_set to allow an Ion Allocator to be used for memory allocation.

There is a constructor that takes the Allocator to be used as an argument. For example:

AllocUnorderedSet<int> local_set(allocator);

AllocUnorderedSet also provides a convenience constructor to declare class members of a derived Allocatable class. It uses the same Allocator that was used for the Allocatable. For example:

class MyClass : public Allocatable { public: ///< The set will use the same Allocator as the MyClass instance. MyClass() : member_set_(*this) {} ... private: AllocUnorderedSet<int> member_set_; };

Definition at line 52 of file allocunorderedset.h.

Member Typedef Documentation

template<typename Value , typename Hash = ::std::hash<Value>, typename Pred = ::std::equal_to<Value>>
typedef StlAllocator<Value> ion::base::AllocUnorderedSet< Value, Hash, Pred >::AllocType

Definition at line 55 of file allocunorderedset.h.

template<typename Value , typename Hash = ::std::hash<Value>, typename Pred = ::std::equal_to<Value>>
typedef std::unordered_set<Value, Hash, Pred, AllocType> ion::base::AllocUnorderedSet< Value, Hash, Pred >::SetType

Definition at line 56 of file allocunorderedset.h.

Constructor & Destructor Documentation

template<typename Value , typename Hash = ::std::hash<Value>, typename Pred = ::std::equal_to<Value>>
ion::base::AllocUnorderedSet< Value, Hash, Pred >::AllocUnorderedSet ( const AllocatorPtr alloc)
inlineexplicit

Definition at line 58 of file allocunorderedset.h.

template<typename Value , typename Hash = ::std::hash<Value>, typename Pred = ::std::equal_to<Value>>
ion::base::AllocUnorderedSet< Value, Hash, Pred >::AllocUnorderedSet ( const Allocatable owner)
inlineexplicit

Definition at line 61 of file allocunorderedset.h.

template<typename Value , typename Hash = ::std::hash<Value>, typename Pred = ::std::equal_to<Value>>
template<typename ContainerT >
ion::base::AllocUnorderedSet< Value, Hash, Pred >::AllocUnorderedSet ( const AllocatorPtr alloc,
const ContainerT &  from 
)
inline

These constructors can be used to copy from "STL iterables": anything that provides a pair of compatible iterators via begin() and end().

Definition at line 68 of file allocunorderedset.h.

template<typename Value , typename Hash = ::std::hash<Value>, typename Pred = ::std::equal_to<Value>>
template<typename ContainerT >
ion::base::AllocUnorderedSet< Value, Hash, Pred >::AllocUnorderedSet ( const Allocatable owner,
const ContainerT &  from 
)
inline

Definition at line 72 of file allocunorderedset.h.

Member Data Documentation

K std::unordered_set< K >::keys
inherited

STL member.


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