Public Member Functions
efl::eo::wref< T > Struct Template Reference

Weak references to an EO Object. More...

Public Member Functions

 wref ()
 Default constructor. More...
 
 wref (Eo *obj)
 Class constructor. More...
 
 wref (T obj)
 Class constructor. More...
 
 ~wref ()
 Class destructor.
 
eina::optional< T > lock ()
 Try to acquire a strong reference to the underlying EO Object. More...
 
 wref (wref const &other)
 Copy constructor.
 
wrefoperator= (wref const &other)
 Assignment operator.
 

Detailed Description

template<typename T>
struct efl::eo::wref< T >

Weak references to an EO Object.

Constructor & Destructor Documentation

§ wref() [1/3]

template<typename T >
efl::eo::wref< T >::wref ( )
inline

Default constructor.

Create a empty weak reference.

§ wref() [2/3]

template<typename T >
efl::eo::wref< T >::wref ( Eo obj)
inlineexplicit

Class constructor.

Parameters
objThe EO Object to be referenced.

Create a weak reference to obj.

§ wref() [3/3]

template<typename T >
efl::eo::wref< T >::wref ( obj)
inline

Class constructor.

Parameters
objThe EO C++ Object to be referenced.

Create a weak reference to obj.

Member Function Documentation

§ lock()

template<typename T >
eina::optional<T> efl::eo::wref< T >::lock ( )
inline

Try to acquire a strong reference to the underlying EO Object.

This function checks whether the weak reference still points to a valid EO Object. If the reference is still valid it increments the reference counter of the object and returns a pointer to it.

Returns
If the lock was successfully acquired it returns a strong reference to the EO Object. Otherwise it returns an empty eina::optional.

Referenced by efl::eo::wref< T >::operator=(), efl::eo::wref< T >::wref(), and efl::eo::wref< T >::~wref().