eolain_cxx: Fix C++ support for new Eolian features

Added optional constructor methods for C++ Eolian wrappers.
Changed the interface of wrappers' main constructors.
If there are optional constructor methods they should be passed as variadic
template argument at the end of the constructor.
To support variadic template arguments, the optional "parent" parameter is
now the first parameter and there is another constructor without the
"parent" parameter.

Checking for @optinal and @nullable attributes instead of @nonull.
Now @nonull is the default, and eina::optional is only used when @optional
or @nullable attribute is specified.

The names of constructor methods no longer have the class name prefixed.

Added unit tests for checking the binding of optional constructors.
Added new .eo file to be used in the test.

Changed the generated documentation of constructors.

Changed the efl::eo::inherit accordingly, to address these new features.
Now the constructor methods should be explicit called in the
efl::eo::inherit constructor, which will receive them via variadic
template arguments.

Added another constructor to efl::eo::inherit for passing the parent
object.

Updated some tests and examples to follow the new interface.

Removed some code that is no longer necessary.

Also, fix Eolian C++ support for constructing properties. fix
assertion when parsing constructing properties.

Now if a property is a constructing property eolian_cxx will generate a
constructor method that have the property name (without the "_set" suffix).
This commit is contained in:
Vitor Sousa 2015-03-26 11:48:09 -03:00 committed by Felipe Magno de Almeida
parent 0f8eee760e
commit 2cfb62c066
3 changed files with 5 additions and 5 deletions

View File

@ -28,7 +28,7 @@ example_callbacks()
{
int count = 0;
efl::ecore::poller poller(
poller.ecore_poller_constructor(ECORE_POLLER_CORE, 1,
poller.constructor(ECORE_POLLER_CORE, 1,
[&count, &poller]
{
if (++count == 5)

View File

@ -17,7 +17,7 @@ struct ColourableCircle
: efl::eo::inherit<ColourableCircle, ::colourable>
{
ColourableCircle(int rgb)
: inherit_base(efl::eo::args<::colourable>(rgb))
: inherit_base(::colourable::rgb_24bits_constructor(rgb))
{}
int colour_get()
@ -46,7 +46,7 @@ struct ColourableBar
: efl::eo::inherit<ColourableBar, ::colourablesquare>
{
ColourableBar()
: inherit_base(efl::eo::args<::colourablesquare>(0))
: inherit_base(::colourable::rgb_24bits_constructor(0))
{}
int colour_get()

View File

@ -19,13 +19,13 @@ main()
int r, g, b;
::colourable obj1(
obj1.colourable_rgb_24bits_constructor(0x123456)
obj1.rgb_24bits_constructor(0x123456)
);
obj1.colour_set(0xc0ffee);
obj1.composite_colour_get(&r, &g, &b);
::colourablesquare obj2(
obj2.colourablesquare_size_constructor(10)
obj2.size_constructor(10)
);
obj2.composite_colour_set(r, g, b);
obj2.size_set(11);