EnTT 3.16.0
Loading...
Searching...
No Matches
entt::basic_meta_associative_container_traits< Type > Struct Template Reference

General purpose implementation of meta associative container traits. More...

#include <container.hpp>

Public Types

using size_type = typename meta_associative_container::size_type
 Unsigned integer type.
using iterator = typename meta_associative_container::iterator
 Meta iterator type.

Static Public Member Functions

static size_type size (const void *container)
 Returns the number of elements in a container.
static bool clear (void *container)
 Clears a container.
static bool reserve (void *container, const size_type sz)
 Increases the capacity of a container.
static iterator iter (const meta_ctx &area, void *container, const void *as_const, const bool end)
 Returns a possibly const iterator to the beginning or the end.
static bool insert (void *container, const void *key, const void *value)
 Inserts an element into a container, if the key does not exist.
static size_type erase (void *container, const void *key)
 Removes an element from a container.
static iterator find (const meta_ctx &area, void *container, const void *as_const, const void *key)
 Finds an element with a given key.

Static Public Attributes

static constexpr bool key_only = internal::key_only_associative_container_v<Type>
 True in case of key-only containers, false otherwise.

Detailed Description

template<typename Type>
struct entt::basic_meta_associative_container_traits< Type >

General purpose implementation of meta associative container traits.

Template Parameters
TypeType of underlying associative container.

Definition at line 191 of file container.hpp.

Member Typedef Documentation

◆ iterator

template<typename Type>
using entt::basic_meta_associative_container_traits< Type >::iterator = typename meta_associative_container::iterator

Meta iterator type.

Definition at line 197 of file container.hpp.

◆ size_type

template<typename Type>
using entt::basic_meta_associative_container_traits< Type >::size_type = typename meta_associative_container::size_type

Unsigned integer type.

Definition at line 195 of file container.hpp.

Member Function Documentation

◆ clear()

template<typename Type>
bool entt::basic_meta_associative_container_traits< Type >::clear ( void * container)
inlinestaticnodiscard

Clears a container.

Parameters
containerOpaque pointer to a container of the given type.
Returns
True in case of success, false otherwise.

Definition at line 216 of file container.hpp.

◆ erase()

template<typename Type>
size_type entt::basic_meta_associative_container_traits< Type >::erase ( void * container,
const void * key )
inlinestaticnodiscard

Removes an element from a container.

Parameters
containerOpaque pointer to a container of the given type.
keyAn opaque key value of an element to remove.
Returns
Number of elements removed (either 0 or 1).

Definition at line 272 of file container.hpp.

◆ find()

template<typename Type>
iterator entt::basic_meta_associative_container_traits< Type >::find ( const meta_ctx & area,
void * container,
const void * as_const,
const void * key )
inlinestatic

Finds an element with a given key.

Parameters
areaThe context to pass to the newly created iterator.
containerOpaque pointer to a container of the given type.
as_constConst opaque pointer fallback.
keyOpaque key value of an element to search for.
Returns
An iterator to the element with the given key, if any.

Definition at line 284 of file container.hpp.

◆ insert()

template<typename Type>
bool entt::basic_meta_associative_container_traits< Type >::insert ( void * container,
const void * key,
const void * value )
inlinestaticnodiscard

Inserts an element into a container, if the key does not exist.

Parameters
containerOpaque pointer to a container of the given type.
keyAn opaque key value of an element to insert.
valueOptional opaque value to insert (key-value containers).
Returns
True if the insertion took place, false otherwise.

Definition at line 258 of file container.hpp.

◆ iter()

template<typename Type>
iterator entt::basic_meta_associative_container_traits< Type >::iter ( const meta_ctx & area,
void * container,
const void * as_const,
const bool end )
inlinestatic

Returns a possibly const iterator to the beginning or the end.

Parameters
areaThe context to pass to the newly created iterator.
containerOpaque pointer to a container of the given type.
as_constConst opaque pointer fallback.
endFalse to get a pointer that is past the last element.
Returns
An iterator to the first or past the last element of the container.

Definition at line 245 of file container.hpp.

◆ reserve()

template<typename Type>
bool entt::basic_meta_associative_container_traits< Type >::reserve ( void * container,
const size_type sz )
inlinestaticnodiscard

Increases the capacity of a container.

Parameters
containerOpaque pointer to a container of the given type.
szDesired capacity.
Returns
True in case of success, false otherwise.

Definition at line 227 of file container.hpp.

◆ size()

template<typename Type>
size_type entt::basic_meta_associative_container_traits< Type >::size ( const void * container)
inlinestaticnodiscard

Returns the number of elements in a container.

Parameters
containerOpaque pointer to a container of the given type.
Returns
Number of elements.

Definition at line 207 of file container.hpp.

Member Data Documentation

◆ key_only

template<typename Type>
bool entt::basic_meta_associative_container_traits< Type >::key_only = internal::key_only_associative_container_v<Type>
staticconstexpr

True in case of key-only containers, false otherwise.

Definition at line 200 of file container.hpp.


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