summaryrefslogtreecommitdiff
path: root/src/bin/eolian_cxx/eolian_wrappers.hh
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-07-09 15:55:24 -0300
committerSavio Sena <savio@expertisesolutions.com.br>2014-07-09 15:55:24 -0300
commit012b586c8b280272e0dca725028c2ec0b1d8be72 (patch)
tree9bfedb70683dd965f0eaeae7c8df13222aac206b /src/bin/eolian_cxx/eolian_wrappers.hh
parentd7b7f19e5e791d1b0b9304f4c42d550d7b3e7634 (diff)
eolian-cxx: Pass references instead of pointers.
Fix Eolian-Cxx API to pass references instead of pointers.
Diffstat (limited to 'src/bin/eolian_cxx/eolian_wrappers.hh')
-rw-r--r--src/bin/eolian_cxx/eolian_wrappers.hh45
1 files changed, 22 insertions, 23 deletions
diff --git a/src/bin/eolian_cxx/eolian_wrappers.hh b/src/bin/eolian_cxx/eolian_wrappers.hh
index d4e8eb8695..3893fefa0e 100644
--- a/src/bin/eolian_cxx/eolian_wrappers.hh
+++ b/src/bin/eolian_cxx/eolian_wrappers.hh
@@ -27,34 +27,34 @@ method_t const method = {};
27struct ctor_t { static constexpr ::Eolian_Function_Type value = ::EOLIAN_CTOR; }; 27struct ctor_t { static constexpr ::Eolian_Function_Type value = ::EOLIAN_CTOR; };
28ctor_t const ctor = {}; 28ctor_t const ctor = {};
29 29
30inline Eolian_Class * 30inline Eolian_Class*
31class_from_file(std::string const& file) 31class_from_file(std::string const& file)
32{ 32{
33 return ::eolian_class_find_by_file(file.c_str()); 33 return ::eolian_class_find_by_file(file.c_str());
34} 34}
35 35
36inline std::string 36inline std::string
37class_file(Eolian_Class const *& klass) 37class_file(Eolian_Class const& klass)
38{ 38{
39 return safe_str(::eolian_class_file_get(klass)); 39 return safe_str(::eolian_class_file_get(&klass));
40} 40}
41 41
42inline std::string 42inline std::string
43class_base_file(Eolian_Class const *& klass) 43class_base_file(Eolian_Class const& klass)
44{ 44{
45 return path_base(safe_str(::eolian_class_file_get(klass))); 45 return path_base(safe_str(::eolian_class_file_get(&klass)));
46} 46}
47 47
48inline std::string 48inline std::string
49class_name(Eolian_Class const *& klass) 49class_name(Eolian_Class const& klass)
50{ 50{
51 return safe_str(::eolian_class_name_get(klass)); 51 return safe_str(::eolian_class_name_get(&klass));
52} 52}
53 53
54inline std::string 54inline std::string
55class_full_name(Eolian_Class const *& klass) 55class_full_name(Eolian_Class const& klass)
56{ 56{
57 return safe_str(::eolian_class_full_name_get(klass)); 57 return safe_str(::eolian_class_full_name_get(&klass));
58} 58}
59 59
60inline Eolian_Class * 60inline Eolian_Class *
@@ -64,10 +64,10 @@ class_from_name(std::string const& classname)
64} 64}
65 65
66inline std::string 66inline std::string
67class_eo_name(Eolian_Class const *& klass) 67class_eo_name(Eolian_Class const& klass)
68{ 68{
69 std::string suffix; 69 std::string suffix;
70 switch (eolian_class_type_get(klass)) 70 switch (::eolian_class_type_get(&klass))
71 { 71 {
72 case EOLIAN_CLASS_REGULAR: 72 case EOLIAN_CLASS_REGULAR:
73 case EOLIAN_CLASS_ABSTRACT: 73 case EOLIAN_CLASS_ABSTRACT:
@@ -105,9 +105,9 @@ class_format_cxx(std::string const& fullname)
105} 105}
106 106
107inline std::string 107inline std::string
108class_prefix(Eolian_Class const *& klass) 108class_prefix(Eolian_Class const& klass)
109{ 109{
110 std::string prefix = safe_lower(::eolian_class_eo_prefix_get(klass)); 110 std::string prefix = safe_lower(::eolian_class_eo_prefix_get(&klass));
111 if (prefix.empty()) 111 if (prefix.empty())
112 prefix = safe_lower(find_replace(class_full_name(klass), ".", "_")); 112 prefix = safe_lower(find_replace(class_full_name(klass), ".", "_"));
113 assert(!prefix.empty()); 113 assert(!prefix.empty());
@@ -115,11 +115,10 @@ class_prefix(Eolian_Class const *& klass)
115} 115}
116 116
117inline efl::eolian::eo_class::eo_class_type 117inline efl::eolian::eo_class::eo_class_type
118class_type(Eolian_Class const *& klass) 118class_type(Eolian_Class const& klass)
119{ 119{
120 assert(klass != NULL);
121 efl::eolian::eo_class::eo_class_type type; 120 efl::eolian::eo_class::eo_class_type type;
122 Eolian_Class_Type cls_type = ::eolian_class_type_get(klass); 121 Eolian_Class_Type cls_type = ::eolian_class_type_get(&klass);
123 122
124 if (cls_type == EOLIAN_CLASS_REGULAR) 123 if (cls_type == EOLIAN_CLASS_REGULAR)
125 type = efl::eolian::eo_class::regular_; 124 type = efl::eolian::eo_class::regular_;
@@ -135,11 +134,11 @@ class_type(Eolian_Class const *& klass)
135} 134}
136 135
137inline std::string 136inline std::string
138class_namespace_full(Eolian_Class const *& klass) 137class_namespace_full(Eolian_Class const& klass)
139{ 138{
140 std::string s; 139 std::string s;
141 const Eina_List* list = 140 const Eina_List* list =
142 ::eolian_class_namespaces_list_get(klass), *itr; 141 ::eolian_class_namespaces_list_get(&klass), *itr;
143 void* name; 142 void* name;
144 EINA_LIST_FOREACH(list, itr, name) 143 EINA_LIST_FOREACH(list, itr, name)
145 { 144 {
@@ -151,10 +150,10 @@ class_namespace_full(Eolian_Class const *& klass)
151 return safe_lower(s); 150 return safe_lower(s);
152} 151}
153 152
154inline efl::eina::range_ptr_list<const Eolian_Class *> 153inline efl::eina::range_ptr_list<const Eolian_Class>
155class_list_all() 154class_list_all()
156{ 155{
157 return (Eina_List*)::eolian_all_classes_list_get(); 156 return ::eolian_all_classes_list_get();
158} 157}
159 158
160inline std::string 159inline std::string
@@ -308,7 +307,7 @@ parameter_type(Eolian_Function_Parameter const *& parameter, setter_t func_type)
308} 307}
309 308
310inline efl::eolian::eo_event 309inline efl::eolian::eo_event
311event_create(Eolian_Class const *& klass, const Eolian_Event *event_) 310event_create(Eolian_Class const& klass, const Eolian_Event *event_)
312{ 311{
313 efl::eolian::eo_event event; 312 efl::eolian::eo_event event;
314 const char *name, *type, *comment; 313 const char *name, *type, *comment;
@@ -325,10 +324,10 @@ event_create(Eolian_Class const *& klass, const Eolian_Event *event_)
325} 324}
326 325
327inline efl::eolian::events_container_type 326inline efl::eolian::events_container_type
328event_list(Eolian_Class const *& klass) 327event_list(Eolian_Class const& klass)
329{ 328{
330 efl::eolian::events_container_type events; 329 efl::eolian::events_container_type events;
331 const Eina_List* list = eolian_class_events_list_get(klass); 330 const Eina_List* list = ::eolian_class_events_list_get(&klass);
332 unsigned int length = eina_list_count(list); 331 unsigned int length = eina_list_count(list);
333 for (unsigned int i = 0; i < length; ++i) 332 for (unsigned int i = 0; i < length; ++i)
334 { 333 {