Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::base::AllocSet< T, Compare > Class Template Reference

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

#include "allocset.h"

Inheritance diagram for ion::base::AllocSet< T, Compare >:
Collaboration diagram for ion::base::AllocSet< T, Compare >:

Public Types

typedef StlAllocator< TAllocType
 
typedef std::set< T, Compare,
AllocType
SetType
 

Public Member Functions

 AllocSet (const AllocatorPtr &alloc)
 
 AllocSet (const Allocatable &owner)
 
template<typename ContainerT >
 AllocSet (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 >
 AllocSet (const Allocatable &owner, const ContainerT &from)
 
 AllocSet (const AllocatorPtr &alloc, std::initializer_list< T > init)
 These constructors allow AllocSet to be initialized using c++11's list initialization: AllocSet<int> set(allocator, {1, 2, 3, 4});. More...
 
 AllocSet (const Allocatable &owner, std::initializer_list< T > init)
 

Public Attributes

keys
 STL member. More...
 

Detailed Description

template<typename T, typename Compare = std::less<T>>
class ion::base::AllocSet< T, Compare >

This class can be used in place of std::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:

AllocSet<int> local_set(allocator);

AllocSet 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: AllocSet<int> member_set_; };

Definition at line 50 of file allocset.h.

Member Typedef Documentation

template<typename T, typename Compare = std::less<T>>
typedef StlAllocator<T> ion::base::AllocSet< T, Compare >::AllocType

Definition at line 52 of file allocset.h.

template<typename T, typename Compare = std::less<T>>
typedef std::set<T, Compare, AllocType> ion::base::AllocSet< T, Compare >::SetType

Definition at line 53 of file allocset.h.

Constructor & Destructor Documentation

template<typename T, typename Compare = std::less<T>>
ion::base::AllocSet< T, Compare >::AllocSet ( const AllocatorPtr alloc)
inlineexplicit

Definition at line 54 of file allocset.h.

template<typename T, typename Compare = std::less<T>>
ion::base::AllocSet< T, Compare >::AllocSet ( const Allocatable owner)
inlineexplicit

Definition at line 57 of file allocset.h.

template<typename T, typename Compare = std::less<T>>
template<typename ContainerT >
ion::base::AllocSet< T, Compare >::AllocSet ( 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 63 of file allocset.h.

template<typename T, typename Compare = std::less<T>>
template<typename ContainerT >
ion::base::AllocSet< T, Compare >::AllocSet ( const Allocatable owner,
const ContainerT &  from 
)
inline

Definition at line 67 of file allocset.h.

template<typename T, typename Compare = std::less<T>>
ion::base::AllocSet< T, Compare >::AllocSet ( const AllocatorPtr alloc,
std::initializer_list< T init 
)
inline

These constructors allow AllocSet to be initialized using c++11's list initialization: AllocSet<int> set(allocator, {1, 2, 3, 4});.

Definition at line 74 of file allocset.h.

template<typename T, typename Compare = std::less<T>>
ion::base::AllocSet< T, Compare >::AllocSet ( const Allocatable owner,
std::initializer_list< T init 
)
inline

Definition at line 77 of file allocset.h.

Member Data Documentation

K std::set< K >::keys
inherited

STL member.


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