Data Structures | Macros | Typedefs | Enumerations | Functions
Eo Class

Data Structures

struct  _Eo_Op_Description
 
struct  _Eo_Ops
 This struct holds the ops and the size of the ops. More...
 
struct  _Eo_Class_Description
 This struct holds the description of a class. More...
 

Macros

#define EO_DEFINE_CLASS(class_get_func_name, class_desc, parent_class, ...)
 A convenience macro to be used for creating the class_get function. More...
 
#define EO_VERSION   2
 The current version of EO.
 
#define EO_OVERRIDE_OPS_DEFINE(ops, ...)
 Define an array of override functions for eo_override. More...
 

Typedefs

typedef enum _Eo_Class_Type Eo_Class_Type
 A convenience typedef for _Eo_Class_Type.
 
typedef struct _Eo_Op_Description Eo_Op_Description
 
typedef struct _Eo_Ops Eo_Ops
 
typedef struct _Eo_Class_Description Eo_Class_Description
 A convenience typedef for _Eo_Class_Description.
 

Enumerations

enum  _Eo_Class_Type {
  EO_CLASS_TYPE_REGULAR = 0,
  EO_CLASS_TYPE_REGULAR_NO_INSTANT,
  EO_CLASS_TYPE_INTERFACE,
  EO_CLASS_TYPE_MIXIN
}
 An enum representing the possible types of an Eo class. More...
 

Functions

EAPI const Eo_Classeo_class_new (const Eo_Class_Description *desc, const Eo_Class *parent,...)
 Create a new class. More...
 
EAPI Eina_Bool eo_override (Eo *obj, const Eo_Ops *ops)
 Override Eo functions of this object. More...
 
EAPI Eina_Bool eo_isa (const Eo *obj, const Eo_Class *klass)
 Check if an object "is a" klass. More...
 
EAPI const char * eo_class_name_get (const Eo_Class *klass)
 Gets the name of the passed class. More...
 

Detailed Description

Macro Definition Documentation

◆ EO_DEFINE_CLASS

#define EO_DEFINE_CLASS (   class_get_func_name,
  class_desc,
  parent_class,
  ... 
)

A convenience macro to be used for creating the class_get function.

This macro is fairly simple but should still be used as it'll let us improve things easily.

Parameters
class_get_func_namethe name of the wanted class_get function name.
class_descthe class description.
parent_classThe parent class for the function. Look at eo_class_new() for more information.
...List of extensions. Look at eo_class_new() for more information.

You must use this macro if you want thread safety in class creation.

◆ EO_OVERRIDE_OPS_DEFINE

#define EO_OVERRIDE_OPS_DEFINE (   ops,
  ... 
)
Value:
const Eo_Op_Description _##ops##_descs[] = { __VA_ARGS__ }; \
const Eo_Ops ops = { _##ops##_descs, EINA_C_ARRAY_LENGTH(_##ops##_descs) }
#define EINA_C_ARRAY_LENGTH(arr)
Macro to return the array length of a standard c array.
Definition: eina_types.h:410
This struct holds the ops and the size of the ops.
Definition: Eo.h:401
Definition: Eo.h:388

Define an array of override functions for eo_override.

Parameters
opsA name for the Eo_Ops local variable to define
...A comma separated list of Eo_Op overrides, using #EO_OP_FUNC_OVERRIDE or #EO_OP_CLASS_FUNC_OVERRIDE

This can be used as follows:

EO_OVERRIDE_OPS_DEFINE(ops, EO_OP_FUNC_OVERRIDE(public_func, _my_func));
eo_override(obj, &ops);
See also
eo_override

Enumeration Type Documentation

◆ _Eo_Class_Type

An enum representing the possible types of an Eo class.

Enumerator
EO_CLASS_TYPE_REGULAR 

Regular class.

EO_CLASS_TYPE_REGULAR_NO_INSTANT 

Regular non instant-able class.

EO_CLASS_TYPE_INTERFACE 

Interface.

EO_CLASS_TYPE_MIXIN 

Mixin.

Function Documentation

◆ eo_class_new()

EAPI const Eo_Class* eo_class_new ( const Eo_Class_Description desc,
const Eo_Class parent,
  ... 
)

Create a new class.

Parameters
descthe class description to create the class with.
parentthe class to inherit from.
...A NULL terminated list of extensions (interfaces, mixins and the classes of any composite objects).
Returns
The new class's handle on success, or NULL otherwise.

You should use EO_DEFINE_CLASS. It'll provide thread safety and other features easily.

See also
EO_DEFINE_CLASS

◆ eo_override()

EAPI Eina_Bool eo_override ( Eo obj,
const Eo_Ops ops 
)

Override Eo functions of this object.

Parameters
opsThe op description to override with.
Returns
true on success, false otherwise.

This lets you override all of the Eo functions of this object (this one included) and repalce them with ad-hoc implementation. The contents of the array are copied so they can for example reside on the stack.

You are only allowed to override functions that are defined in the class or any of its interfaces (that is, eo_isa returning true).

If ops is #NULL, this will revert the obj to its original class without any function overrides.

It is not possible to override a function table of an object when it's already been overridden. Call eo_override(obj, NULL) first if you really need to do that.

References EINA_FALSE, EINA_TRUE, and ERR.

◆ eo_isa()

EAPI Eina_Bool eo_isa ( const Eo obj,
const Eo_Class klass 
)

Check if an object "is a" klass.

Parameters
objThe object to check
klassThe klass to check against.
Returns
EINA_TRUE if obj implements klass, EINA_FALSE otherwise.

Notice: This function does not support composite objects.

References EINA_FALSE.

Referenced by ecore_con_url_additional_header_add(), ecore_con_url_additional_headers_clear(), ecore_con_url_cookies_clear(), ecore_con_url_cookies_file_add(), ecore_con_url_cookies_ignore_old_session_set(), ecore_con_url_cookies_init(), ecore_con_url_cookies_jar_file_set(), ecore_con_url_cookies_jar_write(), ecore_con_url_cookies_session_clear(), ecore_con_url_data_get(), ecore_con_url_data_set(), ecore_con_url_fd_set(), ecore_con_url_free(), ecore_con_url_ftp_upload(), ecore_con_url_ftp_use_epsv_set(), ecore_con_url_http_version_set(), ecore_con_url_httpauth_set(), ecore_con_url_proxy_password_set(), ecore_con_url_proxy_set(), ecore_con_url_proxy_username_set(), ecore_con_url_received_bytes_get(), ecore_con_url_response_headers_get(), ecore_con_url_ssl_ca_set(), ecore_con_url_ssl_verify_peer_set(), ecore_con_url_status_code_get(), ecore_con_url_time(), ecore_con_url_timeout_set(), ecore_con_url_verbose_set(), ecore_exe_auto_limits_set(), ecore_exe_callback_pre_free_set(), ecore_exe_close_stdin(), ecore_exe_data_get(), ecore_exe_data_set(), ecore_exe_event_data_get(), ecore_exe_flags_get(), ecore_exe_free(), ecore_exe_hup(), ecore_exe_interrupt(), ecore_exe_kill(), ecore_exe_pid_get(), ecore_exe_quit(), ecore_exe_send(), ecore_exe_signal(), ecore_exe_tag_get(), ecore_exe_tag_set(), ecore_exe_terminate(), edje_edit_sound_tones_list_get(), edje_evas_global_perspective_get(), evas_object_del(), evas_object_name_get(), evas_object_name_set(), evas_object_smart_clipped_clipper_get(), evas_object_smart_interface_get(), evas_object_smart_members_get(), evas_object_smart_type_check(), evas_object_smart_type_check_ptr(), evas_object_top_at_pointer_get(), and evas_textblock_text_utf8_to_markup().

◆ eo_class_name_get()

EAPI const char* eo_class_name_get ( const Eo_Class klass)