Public Types | Public Member Functions | Data Fields
efl::eina::accessor_common_base< T > Struct Template Reference

Wraps an native Eina_Accessor and provide random access to data structures. More...

Public Types

typedef unsigned int key_type
 Type for accessor key. More...
 
typedef T mapped_type
 Type for accessor mapped elements. More...
 
typedef T value_type
 Type for accessor elements. More...
 
typedef std::size_t size_type
 Type for size information used in the accessor. More...
 

Public Member Functions

 accessor_common_base ()
 Default constructor. More...
 
 accessor_common_base (Eina_Accessor *impl)
 Create an accessor object that wraps the given Eina accessor. More...
 
 accessor_common_base (accessor_common_base< T > const &other)
 Copy constructor. More...
 
accessor_common_base< T > & operator= (accessor_common_base< T > const &other)
 Assignment Operator. More...
 
 ~accessor_common_base ()
 Destructor. More...
 
Eina_Accessornative_handle () const
 Get the handle for the wrapped Eina_Accessor. More...
 
Eina_Accessorrelease_native_handle ()
 Release the handle of the wrapped Eina_Accessor. More...
 
void swap (accessor_common_base< T > &other)
 Swap content between both objects. More...
 
 operator bool () const
 Cast to boolean based on the wrapped Eina_Accessor. More...
 

Data Fields

Eina_Accessor_impl
 

Detailed Description

template<typename T>
struct efl::eina::accessor_common_base< T >

Wraps an native Eina_Accessor and provide random access to data structures.

Member Typedef Documentation

◆ key_type

template<typename T>
typedef unsigned int efl::eina::accessor_common_base< T >::key_type

Type for accessor key.

◆ mapped_type

template<typename T>
typedef T efl::eina::accessor_common_base< T >::mapped_type

Type for accessor mapped elements.

◆ value_type

template<typename T>
typedef T efl::eina::accessor_common_base< T >::value_type

Type for accessor elements.

Same as mapped_type.

◆ size_type

template<typename T>
typedef std::size_t efl::eina::accessor_common_base< T >::size_type

Type for size information used in the accessor.

Constructor & Destructor Documentation

◆ accessor_common_base() [1/3]

template<typename T>
efl::eina::accessor_common_base< T >::accessor_common_base ( )
inline

Default constructor.

Creates an empty accessor.

◆ accessor_common_base() [2/3]

template<typename T>
efl::eina::accessor_common_base< T >::accessor_common_base ( Eina_Accessor impl)
inlineexplicit

Create an accessor object that wraps the given Eina accessor.

Parameters
implNative Eina_Accessor to be wrapped.

This constructor creates an accessor object that wraps the given Eina_Accessor and provides access to the data pointed by it.

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

◆ accessor_common_base() [3/3]

template<typename T>
efl::eina::accessor_common_base< T >::accessor_common_base ( accessor_common_base< T > const &  other)
inline

Copy constructor.

Creates a copy of the given accessor object.

Parameters
otherOther accessor object.

This constructor clones the internal Eina_Accessor of the given accessor object, so that the newly created object can be used freely.

◆ ~accessor_common_base()

template<typename T>
efl::eina::accessor_common_base< T >::~accessor_common_base ( )
inline

Destructor.

Free the internal Eina_Acessor.

References eina_accessor_free().

Member Function Documentation

◆ operator=()

template<typename T>
accessor_common_base<T>& efl::eina::accessor_common_base< T >::operator= ( accessor_common_base< T > const &  other)
inline

Assignment Operator.

Replace the current content.

Parameters
otherOther accessor object.
Exceptions
<tt>eina::system_error</tt>if the Eina accessor could not be cloned.

This operator replaces the current native Eina accessor by a copy of the native accessor inside the given object.

References eina_accessor_clone(), and eina_accessor_free().

◆ native_handle()

template<typename T>
Eina_Accessor* efl::eina::accessor_common_base< T >::native_handle ( ) const
inline

Get the handle for the wrapped Eina_Accessor.

Returns
Internal handle for the native Eina accessor.

This member function returns the native Eina_Accessor 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.

Referenced by efl::eina::accessor_common_base< T >::operator bool(), efl::eina::accessor< T, typename std::enable_if< ! std::is_base_of<::efl::eo::concrete, T >::value, T >::type >::operator bool(), and efl::eina::accessor< T, typename std::enable_if< std::is_base_of<::efl::eo::concrete, T >::value, T >::type >::operator bool().

◆ release_native_handle()

template<typename T>
Eina_Accessor* efl::eina::accessor_common_base< T >::release_native_handle ( )
inline

Release the handle of the wrapped Eina_Accessor.

Returns
Handle for the native Eina_Accessor.

◆ swap()

template<typename T>
void efl::eina::accessor_common_base< T >::swap ( accessor_common_base< T > &  other)
inline

Swap content between both objects.

Parameters
otherOther accessor object.

This member function swaps the internal Eina_Acessor with the given accessor object.

References efl::eina::swap().

◆ operator bool()

template<typename T>
efl::eina::accessor_common_base< T >::operator bool ( ) const
inlineexplicit

Cast to boolean based on the wrapped Eina_Accessor.

Returns
true if the wrapped handle is not NULL, false otherwise.

Boolean typecast overload for easy validation of the accessor object. Returns false if it does not have an internal Eina_Accessor, i.e. if the current handle is not NULL.

References efl::eina::accessor_common_base< T >::native_handle().