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

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

#include <container.hpp>

Public Types

using size_type = typename meta_sequence_container::size_type
 Unsigned integer type.
using iterator = typename meta_sequence_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 bool resize (void *container, const size_type sz)
 Resizes 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 iterator insert (const meta_ctx &area, void *container, const void *value, const void *cref, const iterator &it)
 Assigns one element to a container and constructs its object from a given opaque instance.
static iterator erase (const meta_ctx &area, void *container, const iterator &it)
 Erases an element from a container.

Static Public Attributes

static constexpr std::size_t extent = internal::sequence_container_extent_v<Type>
 Number of elements, or meta_dynamic_extent if dynamic.
static constexpr bool fixed_size = (extent != meta_dynamic_extent)
 True in case of fixed size containers, false otherwise.

Detailed Description

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

General purpose implementation of meta sequence container traits.

Template Parameters
TypeType of underlying sequence container.

Definition at line 65 of file container.hpp.

Member Typedef Documentation

◆ iterator

template<typename Type>
using entt::basic_meta_sequence_container_traits< Type >::iterator = typename meta_sequence_container::iterator

Meta iterator type.

Definition at line 71 of file container.hpp.

◆ size_type

template<typename Type>
using entt::basic_meta_sequence_container_traits< Type >::size_type = typename meta_sequence_container::size_type

Unsigned integer type.

Definition at line 69 of file container.hpp.

Member Function Documentation

◆ clear()

template<typename Type>
bool entt::basic_meta_sequence_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 92 of file container.hpp.

◆ erase()

template<typename Type>
iterator entt::basic_meta_sequence_container_traits< Type >::erase ( const meta_ctx & area,
void * container,
const iterator & it )
inlinestaticnodiscard

Erases an element from a container.

Parameters
areaThe context to pass to the newly created iterator.
containerOpaque pointer to a container of the given type.
itAn opaque iterator to the element to erase.
Returns
A possibly invalid iterator following the last removed element.

Definition at line 176 of file container.hpp.

◆ insert()

template<typename Type>
iterator entt::basic_meta_sequence_container_traits< Type >::insert ( const meta_ctx & area,
void * container,
const void * value,
const void * cref,
const iterator & it )
inlinestaticnodiscard

Assigns one element to a container and constructs its object from a given opaque instance.

Parameters
areaThe context to pass to the newly created iterator.
containerOpaque pointer to a container of the given type.
valueOptional opaque instance of the object to construct (as value type).
crefOptional opaque instance of the object to construct (as decayed const reference type).
itIterator before which the element will be inserted.
Returns
A possibly invalid iterator to the inserted element.

Definition at line 158 of file container.hpp.

◆ iter()

template<typename Type>
iterator entt::basic_meta_sequence_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 140 of file container.hpp.

◆ reserve()

template<typename Type>
bool entt::basic_meta_sequence_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 107 of file container.hpp.

◆ resize()

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

Resizes a container.

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

Definition at line 122 of file container.hpp.

◆ size()

template<typename Type>
size_type entt::basic_meta_sequence_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 83 of file container.hpp.

Member Data Documentation

◆ extent

template<typename Type>
std::size_t entt::basic_meta_sequence_container_traits< Type >::extent = internal::sequence_container_extent_v<Type>
staticconstexpr

Number of elements, or meta_dynamic_extent if dynamic.

Definition at line 74 of file container.hpp.

◆ fixed_size

template<typename Type>
bool entt::basic_meta_sequence_container_traits< Type >::fixed_size = (extent != meta_dynamic_extent)
staticconstexpr

True in case of fixed size containers, false otherwise.

Definition at line 76 of file container.hpp.


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