EnTT: entt::basic_meta_associative_container_traits< Type > Struct Template Reference

EnTT 3.15.0

Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
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 | begin (const meta_ctx &area, void *container, const void *as_const)
| Returns a possibly const iterator to the beginning.
static iterator | end (const meta_ctx &area, void *container, const void *as_const)
| Returns a possibly const iterator to 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

  Type | Type of underlying associative container.

Definition at line 195 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 201 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 199 of file container.hpp.

## Member Function Documentation

## ◆ begin()

template<typename Type>

static iterator entt::basic_meta_associative_container_traits< Type >::begin | ( | const meta_ctx & | area,
|  | void * | container,
|  | const void * | as_const )
| inlinestatic

Returns a possibly const iterator to the beginning.

Parameters

  area | The context to pass to the newly created iterator.
  container | Opaque pointer to a container of the given type.
  as_const | Const opaque pointer fallback.

Returns
  An iterator to the first element of the container.

Definition at line 247 of file container.hpp.

## ◆ clear()

template<typename Type>

static bool entt::basic_meta_associative_container_traits< Type >::clear | ( | void * | container | ) |
| inlinestaticnodiscard

Clears a container.

Parameters

  container | Opaque pointer to a container of the given type.

Returns
  True in case of success, false otherwise.

Definition at line 220 of file container.hpp.

## ◆ end()

template<typename Type>

static iterator entt::basic_meta_associative_container_traits< Type >::end | ( | const meta_ctx & | area,
|  | void * | container,
|  | const void * | as_const )
| inlinestatic

Returns a possibly const iterator to the end.

Parameters

  area | The context to pass to the newly created iterator.
  container | Opaque pointer to a container of the given type.
  as_const | Const opaque pointer fallback.

Returns
  An iterator that is past the last element of the container.

Definition at line 259 of file container.hpp.

## ◆ erase()

template<typename Type>

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

Removes an element from a container.

Parameters

  container | Opaque pointer to a container of the given type.
  key | An opaque key value of an element to remove.

Returns
  Number of elements removed (either 0 or 1).

Definition at line 285 of file container.hpp.

## ◆ find()

template<typename Type>

static 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

  area | The context to pass to the newly created iterator.
  container | Opaque pointer to a container of the given type.
  as_const | Const opaque pointer fallback.
  key | Opaque key value of an element to search for.

Returns
  An iterator to the element with the given key, if any.

Definition at line 297 of file container.hpp.

## ◆ insert()

template<typename Type>

static 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

  container | Opaque pointer to a container of the given type.
  key | An opaque key value of an element to insert.
  value | Optional opaque value to insert (key-value containers).

Returns
  True if the insertion took place, false otherwise.

Definition at line 271 of file container.hpp.

## ◆ reserve()

template<typename Type>

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

Increases the capacity of a container.

Parameters

  container | Opaque pointer to a container of the given type.
  sz | Desired capacity.

Returns
  True in case of success, false otherwise.

Definition at line 231 of file container.hpp.

## ◆ size()

template<typename Type>

static size_type entt::basic_meta_associative_container_traits< Type >::size | ( | const void * | container | ) |
| inlinestaticnodiscard

Returns the number of elements in a container.

Parameters

  container | Opaque pointer to a container of the given type.

Returns
  Number of elements.

Definition at line 211 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 204 of file container.hpp.

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

- src/entt/meta/container.hpp