Public Member Functions | Static Public Member Functions
ecore::timer Struct Reference

Timers are objects that will call a given callback at some point. More...

Public Member Functions

 timer (Eo *eo)
 Eo Constructor. More...
 
 timer (std::nullptr_t)
 nullptr_t Constructor. More...
 
 timer (timer const &other)
 Copy Constructor.
 
void reset () const
 Reset a timer to its full interval. More...
 
void delay (double add_) const
 Add some delay for the next occurrence of a timer. More...
 
double interval_get () const
 Get the interval the timer ticks on. More...
 
void interval_set (double in_) const
 Change the interval the timer ticks off. More...
 
double pending_get () const
 Get the pending time regarding a timer.
 
template<typename F >
::efl::eo::signal_connection callback_callback_add_add (F &&callback_,::efl::eo::callback_priority priority_=::efl::eo::callback_priorities::default_)
 A callback was added.
 
template<typename T >
void callback_callback_add_call (T *info)
 A callback was added.
 
template<typename F >
::efl::eo::signal_connection callback_callback_del_add (F &&callback_,::efl::eo::callback_priority priority_=::efl::eo::callback_priorities::default_)
 A callback was deleted.
 
template<typename T >
void callback_callback_del_call (T *info)
 A callback was deleted.
 
template<typename F >
::efl::eo::signal_connection callback_del_add (F &&callback_,::efl::eo::callback_priority priority_=::efl::eo::callback_priorities::default_)
 Obj is being deleted.
 
template<typename T >
void callback_del_call (T *info)
 Obj is being deleted.
 
template<typename F0 , typename F1 >
 timer (::efl::eo::parent_type _p, _c_constructor< F0 > _c0, _c_loop_constructor< F1 > _c1)
 Constructs a new ecore::timer object. More...
 
template<typename F0 , typename F1 >
 timer (_c_constructor< F0 > _c0, _c_loop_constructor< F1 > _c1)
 
- Public Member Functions inherited from efl::eo::concrete
 concrete (Eo *eo)
 Class constructor. More...
 
 concrete ()
 Default constructor. More...
 
 ~concrete ()
 Class destructor.
 
 concrete (concrete const &other)
 
 concrete (concrete &&other)
 
concreteoperator= (concrete const &other)
 Assignment operator.
 
concreteoperator= (concrete &&other)
 
Eo_eo_ptr () const
 Return a pointer to the EO Object stored in this instance. More...
 
Eo_release ()
 Releases the reference from this concrete object and return the pointer to the EO Object stored in this instance. More...
 
void _reset (Eo *_ptr=nullptr)
 Reset the current pointer to reference a new Eo object.
 
int ref_get () const
 Get the reference count of this object. More...
 
void parent_set (concrete parent)
 Set the parent of this object. More...
 
eina::optional< concreteparent_get ()
 Get the parent of this object. More...
 
Eo_Dbg_Info dbg_info_get ()
 Get debug information of this object. More...
 
 operator bool () const
 
- Public Member Functions inherited from eo::base
 base (Eo *eo)
 Eo Constructor. More...
 
 base (std::nullptr_t)
 nullptr_t Constructor. More...
 
 base (base const &other)
 Copy Constructor.
 
void event_callback_forwarder_del (const Eo_Event_Description *desc_,::efl::eo::concrete new_obj_) const
 Remove an event callback forwarder for an event and an object. More...
 
void event_thaw () const
 thaw events of object. More...
 
void event_freeze () const
 freeze events of object. More...
 
void event_callback_array_del (const Eo_Callback_Array_Item *array_, const void *user_data_) const
 Del a callback array with a specific data associated to it for an event. More...
 
void wref_del (Eo **wref_) const
 Delete the weak reference passed. More...
 
void destructor () const
 Call the object's destructor. More...
 
::efl::eo::concrete finalize () const
 Called at the end of #eo_add. More...
 
void key_data_set (::efl::eina::string_view key_, const void *data_, eo_key_data_free_func free_func_) const
 Set generic data to object. More...
 
void * key_data_get (::efl::eina::string_view key_) const
 Get generic data from object. More...
 
void event_callback_del (const Eo_Event_Description *desc_, Eo_Event_Cb func_, const void *user_data_) const
 Del a callback with a specific data associated to it for an event. More...
 
void key_data_del (::efl::eina::string_view key_) const
 Del generic data from object. More...
 
void event_callback_array_priority_add (const Eo_Callback_Array_Item *array_, Eo_Callback_Priority priority_, const void *data_) const
 Add a callback array for an event with a specific priority. More...
 
void wref_add (::efl::eo::concrete *wref_) const
 Add a new weak reference to obj. More...
 
void dbg_info_get (Eo_Dbg_Info *root_node_) const
 Get dbg information from the object. More...
 
void event_callback_forwarder_add (const Eo_Event_Description *desc_,::efl::eo::concrete new_obj_) const
 Add an event callback forwarder for an event and an object. More...
 
bool event_callback_call (const Eo_Event_Description *desc_, void *event_info_) const
 Call the callbacks for an event of an object. More...
 
void event_callback_priority_add (const Eo_Event_Description *desc_, Eo_Callback_Priority priority_, Eo_Event_Cb cb_, const void *data_) const
 Add a callback for an event with a specific priority. More...
 
Eina_Iteratorchildren_iterator_new () const
 Get an iterator on all childrens.
 
bool composite_attach (::efl::eo::concrete comp_obj_) const
 
bool composite_detach (::efl::eo::concrete comp_obj_) const
 
bool composite_part_is () const
 
::efl::eo::concrete parent_get () const
 Get the parent of an object. More...
 
void parent_set (::efl::eo::concrete parent_) const
 Set the parent of an object Parents keep references to their children so in order to delete objects that have parents you need to set parent to NULL or use eo_del() that does that for you (and also unrefs the object). More...
 
int event_global_freeze_count_get () const
 return freeze events of object. More...
 
int event_freeze_count_get () const
 return freeze events of object. More...
 
bool finalized_get () const
 
template<typename F >
::efl::eo::signal_connection callback_callback_add_add (F &&callback_,::efl::eo::callback_priority priority_=::efl::eo::callback_priorities::default_)
 A callback was added.
 
template<typename T >
void callback_callback_add_call (T *info)
 A callback was added.
 
template<typename F >
::efl::eo::signal_connection callback_callback_del_add (F &&callback_,::efl::eo::callback_priority priority_=::efl::eo::callback_priorities::default_)
 A callback was deleted.
 
template<typename T >
void callback_callback_del_call (T *info)
 A callback was deleted.
 
template<typename F >
::efl::eo::signal_connection callback_del_add (F &&callback_,::efl::eo::callback_priority priority_=::efl::eo::callback_priorities::default_)
 Obj is being deleted.
 
template<typename T >
void callback_del_call (T *info)
 Obj is being deleted.
 
 base (::efl::eo::parent_type _p)
 Constructs a new eo::base object. More...
 

Static Public Member Functions

template<typename F_func_ >
static _c_constructor< F_func_ > constructor (double in_, F_func_ &&func_)
 Create a timer to call in a given time from when the mainloop woke up from sleep. More...
 
template<typename F_func_ >
static _c_loop_constructor< F_func_ > loop_constructor (double in_, F_func_ &&func_)
 Create a timer to call in a given time from now. More...
 
static Eo_Class const * _eo_class ()
 
- Static Public Member Functions inherited from eo::base
static void event_global_freeze ()
 freeze events of object. More...
 
static void event_global_thaw ()
 thaw events of object. More...
 
static Eo_Class const * _eo_class ()
 

Additional Inherited Members

- Protected Attributes inherited from efl::eo::concrete
Eo_eo_raw
 The opaque EO Object.
 

Detailed Description

Timers are objects that will call a given callback at some point.

Constructor & Destructor Documentation

template<typename F0 , typename F1 >
ecore::timer::timer ( ::efl::eo::parent_type  _p,
_c_constructor< F0 >  _c0,
_c_loop_constructor< F1 >  _c1 
)
inlineexplicit

Constructs a new ecore::timer object.

Constructs a new ecore::timer object. If you want this object to be a child of another Eo object, use an efl::eo::parent expression, like the example.

Since this class have necessary constructor methods, you must call each one of them in the right place within this constructor parameters.

Example:

ecore::timer my_timer(efl::eo::parent = parent_object,
my_timer.constructor(in_, func_),
my_timer.loop_constructor(in_, func_));
See also
timer::constructor
timer::loop_constructor
timer(Eo* eo)
ecore::timer::timer ( Eo eo)
inlineexplicit

Eo Constructor.

Constructs the object from an Eo* pointer stealing its ownership.

Parameters
eoThe Eo object pointer.
ecore::timer::timer ( std::nullptr_t  )
inlineexplicit

nullptr_t Constructor.

Constructs an empty (null) object.

Member Function Documentation

template<typename F_func_ >
static _c_constructor<F_func_> ecore::timer::constructor ( double  in_,
F_func_ &&  func_ 
)
static

Create a timer to call in a given time from when the mainloop woke up from sleep.

Parameters
inThe time, in seconds, from when the main loop woke up, to go off
funcThe callback function to call when the timer goes off
dataA pointer to pass to the callback function as its data pointer
template<typename F_func_ >
static _c_loop_constructor<F_func_> ecore::timer::loop_constructor ( double  in_,
F_func_ &&  func_ 
)
static

Create a timer to call in a given time from now.

Parameters
inThe time, in seconds, from now when to go off
funcThe callback function to call when the timer goes off
dataA pointer to pass to the callback function as its data pointer
void ecore::timer::reset ( ) const

Reset a timer to its full interval.

This effectively makes

  • the timer start ticking off from zero now.
  • Note
    This is equivalent to (but faster than)
  • * ecore_timer_delay(timer, ecore_timer_interval_get(timer) - ecore_timer_pending_get(timer));
    *
  • Since
    1.2
void ecore::timer::delay ( double  add_) const

Add some delay for the next occurrence of a timer.

  • This doesn't affect the interval of a timer.
Parameters
addThe amount of time to delay the timer by in seconds
double ecore::timer::interval_get ( ) const

Get the interval the timer ticks on.

Parameters
inThe new interval in seconds
void ecore::timer::interval_set ( double  in_) const

Change the interval the timer ticks off.

If set during

  • a timer call, this will affect the next interval.
Parameters
inThe new interval in seconds