efl::eina::_inarray_common_base Struct Reference

Public Types | Public Member Functions | Data Fields
efl::eina::_inarray_common_base Struct Reference
Eina C++Eina C++ » | Data Types » Containers » Inline Array

Common inarray interface for every value type. More...

## Public Types
typedef std::size_t | size_type
| Type for size information used in the array. More...
typedef Eina_Inarray * | native_handle_type
typedef Eina_Inarray const * | const_native_handle_type
| Type for the native `Eina_Inarray` handle. More...

## Public Member Functions
| _inarray_common_base (native_handle_type array)
| Type for constant native `Eina_Inarray` handle. More...
| _inarray_common_base (size_type member_size)
| Allocates a array with the given size for each element. More...
| ~_inarray_common_base ()
| Release the inline array memory. More...
size_type | size () const
| Get the current size of the array. More...
bool | empty () const
| Check if the array is empty. More...
native_handle_type | native_handle ()
| Get the handle for the wrapped Eina_Inarray. More...
const_native_handle_type | native_handle () const
| Get a constant handle for the wrapped Eina_Inarray. More...

## Data Fields
native_handle_type | _array

## Detailed Description

Common inarray interface for every value type.

## Member Typedef Documentation

## ◆ size_type

typedef std::size_t efl::eina::_inarray_common_base::size_type

Type for size information used in the array.

## ◆ const_native_handle_type

typedef Eina_Inarray const* efl::eina::_inarray_common_base::const_native_handle_type

Type for the native `Eina_Inarray` handle.

## Constructor & Destructor Documentation

## ◆ _inarray_common_base() [1/2]

efl::eina::_inarray_common_base::_inarray_common_base | ( | native_handle_type | array | ) |
| inlineexplicit

Type for constant native `Eina_Inarray` handle.

Creates a new array object from a handle to a native `Eina_Inarray`.

Parameters

  array | Handler to a native `Eina_Inarray`

This constructor wraps a pre-allocated `Eina_Inarray` providing an OO interface to it.

Warning
  It is important to note that the created array object gains ownership of the handle, deallocating it at destruction time.

## ◆ _inarray_common_base() [2/2]

efl::eina::_inarray_common_base::_inarray_common_base | ( | size_type | member_size | ) |
| inlineexplicit

Allocates a array with the given size for each element.

Parameters

  member_size | Size of each element in the array.

This constructor creates an inline array object with the given size (in bytes) for each element. All allocated memory will be released at destruction.

## ◆ ~_inarray_common_base()

efl::eina::_inarray_common_base::~_inarray_common_base | ( |  | ) |
| inline

Release the inline array memory.

This destructor release the internal native `Eina_Inarray` handle, freeing allocated memory.

References eina_inarray_free().

## Member Function Documentation

## ◆ size()

size_type efl::eina::_inarray_common_base::size | ( |  | ) | const
| inline

Get the current size of the array.

Returns
  Number of elements in the array.

This member function returns the current number of elements inside the inline array.

## ◆ empty()

bool efl::eina::_inarray_common_base::empty | ( |  | ) | const
| inline

Check if the array is empty.

Returns
  `true` if the array is empty, `false` otherwise.

This member function returns `true` if the array does not contain any elements, otherwise it returns `false`.

## ◆ native_handle() [1/2]

native_handle_type efl::eina::_inarray_common_base::native_handle | ( |  | ) |
| inline

Get the handle for the wrapped Eina_Inarray.

Returns
  Internal handle for the native Eina inline array.

This member function returns the native `Eina_Inarray` handle that is wrapped inside this object.

Warning
  It is important to take care when using it, since the handle will be automatically release upon object destruction.

## ◆ native_handle() [2/2]

const_native_handle_type efl::eina::_inarray_common_base::native_handle | ( |  | ) | const
| inline

Get a constant handle for the wrapped Eina_Inarray.

Returns
  Constant handle for the native Eina inline array.

Version of native_handle() for const-qualified objects. Return a constant handle instead.