Open 3D Engine AzCore API Reference  2205.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Public Types | Public Member Functions | List of all members
AZStd::set< Key, Compare, Allocator > Class Template Reference

#include <set.h>

Public Types

typedef tree_type::traits_type traits_type
 
typedef tree_type::key_type key_type
 
typedef tree_type::value_type value_type
 
typedef tree_type::key_eq key_compare
 
typedef tree_type::key_eq value_compare
 
typedef tree_type::allocator_type allocator_type
 
typedef tree_type::size_type size_type
 
typedef tree_type::difference_type difference_type
 
typedef tree_type::pointer pointer
 
typedef tree_type::const_pointer const_pointer
 
typedef tree_type::reference reference
 
typedef tree_type::const_reference const_reference
 
typedef tree_type::iterator iterator
 
typedef tree_type::const_iterator const_iterator
 
typedef tree_type::reverse_iterator reverse_iterator
 
typedef tree_type::const_reverse_iterator const_reverse_iterator
 
using node_type = set_node_handle< set_node_traits< value_type, allocator_type, typename tree_type::node_type, typename tree_type::node_deleter > >
 
using insert_return_type = AZStd::AssociativeInternal::insert_return_type< iterator, node_type >
 

Public Member Functions

AZ_FORCE_INLINE set (const Compare &comp=Compare(), const Allocator &alloc=Allocator())
 
 set (const Allocator &alloc)
 
template<class InputIterator >
AZ_FORCE_INLINE set (InputIterator first, InputIterator last, const Compare &comp=Compare(), const Allocator &alloc=Allocator())
 
 set (std::initializer_list< value_type > list, const Compare &comp=Compare(), const Allocator &alloc=Allocator())
 
 set (std::initializer_list< value_type > list, const Allocator &alloc)
 
AZ_FORCE_INLINE set (const this_type &rhs)
 
AZ_FORCE_INLINE set (const this_type &rhs, const Allocator &alloc)
 
AZ_FORCE_INLINE this_typeoperator= (const this_type &rhs)
 
AZ_FORCE_INLINE key_compare key_comp () const
 
AZ_FORCE_INLINE value_compare value_comp () const
 
AZ_FORCE_INLINE iterator begin ()
 
AZ_FORCE_INLINE iterator end ()
 
AZ_FORCE_INLINE const_iterator begin () const
 
AZ_FORCE_INLINE const_iterator end () const
 
AZ_FORCE_INLINE reverse_iterator rbegin ()
 
AZ_FORCE_INLINE reverse_iterator rend ()
 
AZ_FORCE_INLINE const_reverse_iterator rbegin () const
 
AZ_FORCE_INLINE const_reverse_iterator rend () const
 
AZ_FORCE_INLINE bool empty () const
 
AZ_FORCE_INLINE size_type size () const
 
AZ_FORCE_INLINE size_type max_size () const
 
AZ_FORCE_INLINE void swap (this_type &rhs)
 
AZ_FORCE_INLINE pair< iterator, bool > insert (const value_type &value)
 
AZ_FORCE_INLINE iterator insert (iterator insertPos, const value_type &value)
 
template<class InputIterator >
AZ_FORCE_INLINE void insert (InputIterator first, InputIterator last)
 
 set (this_type &&rhs)
 
 set (this_type &&rhs, const Allocator &alloc)
 
this_typeoperator= (this_type &&rhs)
 
AZStd::pair< iterator, bool > insert (value_type &&value)
 
iterator insert (const_iterator insertPos, value_type &&value)
 
template<class ... InputArguments>
AZStd::pair< iterator, bool > emplace (InputArguments &&... arguments)
 
template<class ... InputArguments>
iterator emplace_hint (const_iterator insertPos, InputArguments &&... arguments)
 
insert_return_type insert (node_type &&nodeHandle)
 
iterator insert (const_iterator hint, node_type &&nodeHandle)
 
node_type extract (const key_type &key)
 
node_type extract (const_iterator it)
 
AZ_FORCE_INLINE iterator erase (const_iterator erasePos)
 
AZ_FORCE_INLINE size_type erase (const key_type &key)
 
AZ_FORCE_INLINE iterator erase (const_iterator first, const_iterator last)
 
AZ_FORCE_INLINE void clear ()
 
const_iterator find (const key_type &key) const
 
iterator find (const key_type &key)
 
bool contains (const key_type &key) const
 
size_type count (const key_type &key) const
 
iterator lower_bound (const key_type &key)
 
const_iterator lower_bound (const key_type &key) const
 
iterator upper_bound (const key_type &key)
 
const_iterator upper_bound (const key_type &key) const
 
pair< iterator, iteratorequal_range (const key_type &key)
 
pair< const_iterator, const_iteratorequal_range (const key_type &key) const
 
template<typename ComparableToKey >
auto find (const ComparableToKey &key) const -> enable_if_t<::AZStd::Internal::is_transparent< key_compare, ComparableToKey >::value, const_iterator >
 
template<typename ComparableToKey >
auto find (const ComparableToKey &key) -> enable_if_t<::AZStd::Internal::is_transparent< key_compare, ComparableToKey >::value, iterator >
 
template<typename ComparableToKey >
auto contains (const ComparableToKey &key) const -> enable_if_t<::AZStd::Internal::is_transparent< key_compare, ComparableToKey >::value, bool >
 
template<typename ComparableToKey >
auto count (const ComparableToKey &key) const -> enable_if_t<::AZStd::Internal::is_transparent< key_compare, ComparableToKey >::value, size_type >
 
template<typename ComparableToKey >
auto lower_bound (const ComparableToKey &key) -> enable_if_t<::AZStd::Internal::is_transparent< key_compare, ComparableToKey >::value, iterator >
 
template<typename ComparableToKey >
auto lower_bound (const ComparableToKey &key) const -> enable_if_t<::AZStd::Internal::is_transparent< key_compare, ComparableToKey >::value, const_iterator >
 
template<typename ComparableToKey >
auto upper_bound (const ComparableToKey &key) -> enable_if_t<::AZStd::Internal::is_transparent< key_compare, ComparableToKey >::value, iterator >
 
template<typename ComparableToKey >
auto upper_bound (const ComparableToKey &key) const -> enable_if_t<::AZStd::Internal::is_transparent< key_compare, ComparableToKey >::value, const_iterator >
 
template<typename ComparableToKey >
auto equal_range (const ComparableToKey &key) -> enable_if_t<::AZStd::Internal::is_transparent< key_compare, ComparableToKey >::value, pair< iterator, iterator >>
 
template<typename ComparableToKey >
auto equal_range (const ComparableToKey &key) const -> enable_if_t<::AZStd::Internal::is_transparent< key_compare, ComparableToKey >::value, pair< const_iterator, const_iterator >>
 
Extensions

AZ_FORCE_INLINE allocator_type & get_allocator ()
 
const AZ_FORCE_INLINE allocator_type & get_allocator () const
 
AZ_FORCE_INLINE void set_allocator (const allocator_type &allocator)
 Set the vector allocator. If different than then current all elements will be reallocated.
 
AZ_INLINE bool validate () const
 
AZ_INLINE int validate_iterator (const const_iterator &iter) const
 Validates an iter iterator. Returns a combination of iterator_status_flag.
 
AZ_INLINE int validate_iterator (const iterator &iter) const
 
AZ_FORCE_INLINE void leak_and_reset ()
 

Detailed Description

template<class Key, class Compare = AZStd::less<Key>, class Allocator = AZStd::allocator>
class AZStd::set< Key, Compare, Allocator >

Ordered set container is complaint with C++0x (23.4.3) This is an associative container, all keys are unique. insert function will return false, if you try to add key that is in the set.

Check the set AZStdExamples.

Member Function Documentation

◆ leak_and_reset()

template<class Key , class Compare = AZStd::less<Key>, class Allocator = AZStd::allocator>
AZ_FORCE_INLINE void AZStd::set< Key, Compare, Allocator >::leak_and_reset ( )
inline

Resets the container without deallocating any memory or calling any destructor. This function should be used when we need very quick tear down. Generally it's used for temporary vectors and we can just nuke them that way. In addition the provided Allocators, has leak and reset flag which will enable automatically this behavior. So this function should be used in special cases AZStdExamples.

Note
This function is added to the vector for consistency. In the vector case we have only one allocation, and if the allocator allows memory leaks it can just leave deallocate function empty, which performance wise will be the same. For more complex containers this will make big difference.

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