2019-10-24 06:01:50 -07:00
/*
* Copyright 2019 by its authors . See AUTHORS .
*
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
*
* http : //www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing , software
* distributed under the License is distributed on an " AS IS " BASIS ,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND , either express or implied .
* See the License for the specific language governing permissions and
* limitations under the License .
*/
2017-11-23 16:50:16 -08:00
# ifndef EOLIAN_MONO_FUNCTION_DEFINITION_HH
# define EOLIAN_MONO_FUNCTION_DEFINITION_HH
# include <Eina.hh>
# include "grammar/generator.hpp"
# include "grammar/klass_def.hpp"
2019-08-23 10:00:26 -07:00
# include "grammar/kleene.hpp"
2017-11-23 16:50:16 -08:00
# include "grammar/indentation.hpp"
# include "grammar/list.hpp"
# include "grammar/alternative.hpp"
# include "grammar/attribute_reorder.hpp"
2019-08-23 10:00:26 -07:00
# include "grammar/counter.hpp"
2020-01-30 11:49:04 -08:00
# include "property_definition.hh"
2018-04-27 14:08:25 -07:00
# include "logging.hh"
2017-11-23 16:50:16 -08:00
# include "type.hh"
2018-04-16 12:26:13 -07:00
# include "name_helpers.hh"
2018-04-10 18:30:40 -07:00
# include "helpers.hh"
2017-11-23 16:50:16 -08:00
# include "function_helpers.hh"
# include "marshall_type.hh"
# include "parameter.hh"
2017-12-06 16:03:55 -08:00
# include "documentation.hh"
2017-11-23 16:50:16 -08:00
# include "using_decl.hh"
# include "generation_contexts.hh"
2018-04-16 12:26:13 -07:00
# include "blacklist.hh"
2017-11-23 16:50:16 -08:00
namespace eolian_mono {
struct native_function_definition_generator
{
attributes : : klass_def const * klass ;
2020-01-30 11:49:04 -08:00
std : : vector < attributes : : property_def > properties ;
2020-01-20 14:00:44 -08:00
2017-11-23 16:50:16 -08:00
template < typename OutputIterator , typename Context >
bool generate ( OutputIterator sink , attributes : : function_def const & f , Context const & context ) const
{
2018-04-27 14:08:25 -07:00
EINA_CXX_DOM_LOG_DBG ( eolian_mono : : domain ) < < " native_function_definition_generator: " < < f . c_name < < std : : endl ;
2019-01-15 23:29:56 -08:00
if ( blacklist : : is_function_blacklisted ( f , context ) )
2017-11-23 16:50:16 -08:00
return true ;
2019-04-23 02:48:03 -07:00
2020-01-30 11:49:04 -08:00
auto it = std : : find_if ( properties . begin ( ) , properties . end ( )
, [ & ] ( attributes : : property_def const & prop )
{
return ( prop . getter & & * prop . getter = = f )
| | ( prop . setter & & * prop . setter = = f ) ;
} ) ;
if ( it ! = properties . end ( ) )
{
if ( it - > getter & & * it - > getter = = f )
{
if ( property_generate_wrapper_getter ( * it , context ) )
return true ;
}
else
if ( property_generate_wrapper_setter ( * it , context ) )
return true ;
}
2019-04-23 02:48:03 -07:00
auto const & indent = current_indentation ( context ) ;
// Delegate for the C# method we will export to EO as a method implementation.
2017-11-23 16:50:16 -08:00
if ( ! as_generator
2019-04-23 02:48:03 -07:00
(
indent < < eolian_mono : : marshall_annotation ( true ) < < " \n "
< < indent < < " private delegate "
2017-11-23 16:50:16 -08:00
< < eolian_mono : : marshall_type ( true )
< < " "
< < string
2019-01-15 23:29:56 -08:00
< < " _delegate( " < < ( f . is_static ? " " : " System.IntPtr obj, System.IntPtr pd " )
< < ( ( ! f . is_static & & f . parameters . size ( ) > 0 ) ? " , " : " " )
< < ( grammar : : attribute_reorder < - 1 , - 1 >
2017-11-23 16:50:16 -08:00
(
2019-01-15 23:29:56 -08:00
( marshall_annotation < < " " < < marshall_parameter )
) % " , " )
2019-04-23 02:48:03 -07:00
< < " ); \n \n " )
2017-11-23 16:50:16 -08:00
. generate ( sink , std : : make_tuple ( f . return_type , f . return_type , f . c_name , f . parameters ) , context ) )
return false ;
2019-04-23 02:48:03 -07:00
// API delegate is the wrapper for the Eo methods exported from C that we will use from C#.
2017-11-23 16:50:16 -08:00
if ( ! as_generator
2019-04-23 02:48:03 -07:00
(
indent < < eolian_mono : : marshall_annotation ( true ) < < " \n "
2019-10-29 07:56:04 -07:00
< < indent < < " internal delegate "
2017-11-23 16:50:16 -08:00
< < eolian_mono : : marshall_type ( true )
2019-01-15 23:29:56 -08:00
< < " "
< < string < < " _api_delegate( " < < ( f . is_static ? " " : " System.IntPtr obj " )
< < ( ( ! f . is_static & & f . parameters . size ( ) > 0 ) ? " , " : " " )
< < ( grammar : : attribute_reorder < - 1 , - 1 >
2017-11-23 16:50:16 -08:00
(
2019-01-15 23:29:56 -08:00
( marshall_annotation < < " " < < marshall_parameter )
) % " , " )
2019-04-23 02:48:03 -07:00
< < " ); \n \n " )
2017-11-23 16:50:16 -08:00
. generate ( sink , std : : make_tuple ( f . return_type , f . return_type , f . c_name , f . parameters ) , context ) )
return false ;
2019-04-23 02:48:03 -07:00
// Delegate holder (so it can't be collected).
2019-01-15 23:29:56 -08:00
if ( ! as_generator
2019-10-29 07:56:04 -07:00
( indent < < " internal static readonly Efl.Eo.FunctionWrapper< " < < string < < " _api_delegate> " < < string < < " _ptr = new Efl.Eo.FunctionWrapper< "
2019-04-23 02:48:03 -07:00
< < string < < " _api_delegate>(Module, \" " < < string < < " \" ); \n \n " )
2019-01-15 23:29:56 -08:00
. generate ( sink , std : : make_tuple ( f . c_name , f . c_name , f . c_name , f . c_name ) , context ) )
return false ;
csharp: Skip non-public members from interfaces
Summary:
Eolian allows non-public members in interfaces and mixins (usually
@protected). As both kinds are converted to C# interfaces, this
causes problem as non-public members are forbidden in C# interfaces.
This commit changes eolian_mono by removing those members from the C#
interfaces. If a generated class implements the interface, the method is
generated as if it were a protected member of the class directly.
For mixed properties like `Efl.Io.Reader.CanRead { get; set @protected; }`,
the interface has only the public getter and the the implementing class has both
the public getter and the protected setter.
With this, C# devs won't be able to directly implement protected Eo
methods from interfaces. (But this really does not make sense from the
C# point of view).
ref T7494
Reviewers: segfaultxavi, felipealmeida, YOhoho
Reviewed By: YOhoho
Subscribers: cedric, brunobelo, Jaehyun_Cho, #reviewers, woohyun, #committers
Tags: #efl
Maniphest Tasks: T7494
Differential Revision: https://phab.enlightenment.org/D9800
2019-09-10 15:30:46 -07:00
// We do not generate the wrapper to be called from C for non public interface member directly.
if ( blacklist : : is_non_public_interface_member ( f , * klass ) )
return true ;
2019-09-10 15:47:47 -07:00
// Do not generate static method in interface
if ( ( ( klass - > type = = attributes : : class_type : : interface_ ) | |
( klass - > type = = attributes : : class_type : : mixin ) ) & & f . is_static )
return true ;
2019-04-23 02:48:03 -07:00
// Actual method implementation to be called from C.
2017-11-23 16:50:16 -08:00
std : : string return_type ;
if ( ! as_generator ( eolian_mono : : type ( true ) ) . generate ( std : : back_inserter ( return_type ) , f . return_type , context ) )
return false ;
2019-01-17 04:33:09 -08:00
std : : string klass_cast_name ;
eolian_mono: fix to call mixin's method in inherited class
Summary:
Eo mixin is converted to C# interface and C# concrete class.
When the mixin's method is called, the delegate function of Eo mixin's
C# concrete class is called.
Now, the delegate function of Eo mixin's C# concrete class calls C#
method with casting to Eo mixin's C# concrete class type.
e.g. ((IClickableConcrete)ws.Target).Press(button);
If a user defined C# class implements Eo mixin's C# interface, the
implemented method cannot be called because the user defined C# class
type is not the same as Eo mixin's C# concrete class.
To resolve the above issue, the type casting code is fixed.
Reviewers: felipealmeida, lauromoura, vitor.sousa, YOhoho
Reviewed By: YOhoho
Subscribers: bu5hm4n, YOhoho, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9111
2019-06-24 02:43:07 -07:00
if ( ( klass - > type = = attributes : : class_type : : interface_ ) | |
( ( klass - > type = = attributes : : class_type : : mixin ) & & ! f . is_static ) )
2019-01-17 04:33:09 -08:00
klass_cast_name = name_helpers : : klass_interface_name ( * klass ) ;
eolian_mono: fix to call mixin's method in inherited class
Summary:
Eo mixin is converted to C# interface and C# concrete class.
When the mixin's method is called, the delegate function of Eo mixin's
C# concrete class is called.
Now, the delegate function of Eo mixin's C# concrete class calls C#
method with casting to Eo mixin's C# concrete class type.
e.g. ((IClickableConcrete)ws.Target).Press(button);
If a user defined C# class implements Eo mixin's C# interface, the
implemented method cannot be called because the user defined C# class
type is not the same as Eo mixin's C# concrete class.
To resolve the above issue, the type casting code is fixed.
Reviewers: felipealmeida, lauromoura, vitor.sousa, YOhoho
Reviewed By: YOhoho
Subscribers: bu5hm4n, YOhoho, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9111
2019-06-24 02:43:07 -07:00
else
klass_cast_name = name_helpers : : klass_inherit_name ( * klass ) ;
2018-04-27 14:08:25 -07:00
2019-10-15 06:11:09 -07:00
std : : string self = " Efl.Eo.Globals.Super(obj, Efl.Eo.Globals.GetClass(obj)) " ;
2019-01-15 23:29:56 -08:00
if ( f . is_static )
self = " " ;
2017-11-23 16:50:16 -08:00
if ( ! as_generator
2019-11-14 19:07:11 -08:00
( indent < < " [SuppressMessage( \" Microsoft.Reliability \" , \" CA2000:DisposeObjectsBeforeLosingScope \" , Justification = \" The instantiated objects can be stored in the called Managed API method. \" )] \n "
< < indent < < " private static "
2017-11-23 16:50:16 -08:00
< < eolian_mono : : marshall_type ( true ) < < " "
< < string
< < " (System.IntPtr obj, System.IntPtr pd "
< < * ( " , " < < marshall_parameter )
< < " ) \n "
2019-04-23 02:48:03 -07:00
< < indent < < " { \n "
< < indent < < scope_tab < < " Eina.Log.Debug( \" function " < < string < < " was called \" ); \n "
csharp: Refactor wrapper lifetime.
Summary:
This commit makes use of the `ownership,shared` and `ownership,unique`
events from Efl.Object in order to avoid the C# wrapper from being
collected while C code holds a reference to the object.
For example, creating a list of items in a for loop and attaching events to
them would fails without this commit, as the C# GC may collect the wrapper.
The basic idea is that we use a `WrapperSupervisor`, which is stored in
the Eo data storage, with a GCHandle allocated for the lifetime of the
underlying Eo object. This supervisor takes care of holding either a
weak C# reference (when in unique mode, allowing the wrapper to be GC'd)
or a hard C# reference (when in shared mode, making the wrapper
non-collectable while the Eo has extra references).
One limitation is that object graphs can leak if a shared object in the
graph - an Eo child for example - stores a hard reference to another
object in the graph as a C# field. In this example, this causes the
parent to always have a hard C# reference (from the child) as the child
is non-collectable due to the parent holding an Eo reference to it.
Depends on D8678
Test Plan: `ninja test` and `make test`
Reviewers: lauromoura, felipealmeida, woohyun, segfaultxavi
Reviewed By: lauromoura
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9014
2019-05-31 13:43:11 -07:00
< < indent < < scope_tab < < " var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj); \n "
< < indent < < scope_tab < < " if (ws != null) \n "
2019-04-23 02:48:03 -07:00
< < indent < < scope_tab < < " { \n "
2019-09-23 16:50:27 -07:00
< < indent < < scope_tab < < scope_tab < < eolian_mono : : native_function_definition_preamble ( ) < < " \n "
2019-04-23 02:48:03 -07:00
< < indent < < scope_tab < < scope_tab < < " try \n "
< < indent < < scope_tab < < scope_tab < < " { \n "
< < indent < < scope_tab < < scope_tab < < scope_tab < < ( return_type ! = " void " ? " _ret_var = " : " " )
csharp: Refactor wrapper lifetime.
Summary:
This commit makes use of the `ownership,shared` and `ownership,unique`
events from Efl.Object in order to avoid the C# wrapper from being
collected while C code holds a reference to the object.
For example, creating a list of items in a for loop and attaching events to
them would fails without this commit, as the C# GC may collect the wrapper.
The basic idea is that we use a `WrapperSupervisor`, which is stored in
the Eo data storage, with a GCHandle allocated for the lifetime of the
underlying Eo object. This supervisor takes care of holding either a
weak C# reference (when in unique mode, allowing the wrapper to be GC'd)
or a hard C# reference (when in shared mode, making the wrapper
non-collectable while the Eo has extra references).
One limitation is that object graphs can leak if a shared object in the
graph - an Eo child for example - stores a hard reference to another
object in the graph as a C# field. In this example, this causes the
parent to always have a hard C# reference (from the child) as the child
is non-collectable due to the parent holding an Eo reference to it.
Depends on D8678
Test Plan: `ninja test` and `make test`
Reviewers: lauromoura, felipealmeida, woohyun, segfaultxavi
Reviewed By: lauromoura
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9014
2019-05-31 13:43:11 -07:00
< < ( f . is_static ? " " : " (( " ) < < klass_cast_name < < ( f . is_static ? " . " : " )ws.Target). " ) < < string
2017-11-23 16:50:16 -08:00
< < " ( " < < ( native_argument_invocation % " , " ) < < " ); \n "
2019-04-23 02:48:03 -07:00
< < indent < < scope_tab < < scope_tab < < " } \n "
< < indent < < scope_tab < < scope_tab < < " catch (Exception e) \n "
< < indent < < scope_tab < < scope_tab < < " { \n "
< < indent < < scope_tab < < scope_tab < < scope_tab < < " Eina.Log.Warning($ \" Callback error: {e.ToString()} \" ); \n "
< < indent < < scope_tab < < scope_tab < < scope_tab < < " Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); \n "
< < indent < < scope_tab < < scope_tab < < " } \n \n "
2019-09-23 16:50:27 -07:00
< < indent < < eolian_mono : : native_function_definition_epilogue ( * klass ) < < " \n "
2019-04-23 02:48:03 -07:00
< < indent < < scope_tab < < " } \n "
< < indent < < scope_tab < < " else \n "
< < indent < < scope_tab < < " { \n "
< < indent < < scope_tab < < scope_tab < < ( return_type ! = " void " ? " return " : " " ) < < string
2019-01-15 23:29:56 -08:00
< < " _ptr.Value.Delegate( " < < self < < ( ( ! f . is_static & & f . parameters . size ( ) > 0 ) ? " , " : " " ) < < ( argument % " , " ) < < " ); \n "
2019-04-23 02:48:03 -07:00
< < indent < < scope_tab < < " } \n "
< < indent < < " } \n \n "
2017-11-23 16:50:16 -08:00
)
. generate ( sink , std : : make_tuple ( f . return_type , escape_keyword ( f . name ) , f . parameters
, /***/ f . c_name /***/
, f
2018-05-02 15:49:37 -07:00
, name_helpers : : managed_method_name ( f )
2017-11-23 16:50:16 -08:00
, f . parameters
, f
, f . c_name
2018-04-27 14:08:25 -07:00
, f . parameters
2017-11-23 16:50:16 -08:00
)
, context ) )
return false ;
2019-01-15 23:29:56 -08:00
// Static functions do not need to be called from C
if ( f . is_static )
return true ;
2018-12-14 14:39:09 -08:00
// This is the delegate that will be passed to Eo to be called from C.
if ( ! as_generator (
2019-04-23 02:48:03 -07:00
indent < < " private static " < < f . c_name < < " _delegate " < < f . c_name < < " _static_delegate; \n \n "
2018-12-14 14:39:09 -08:00
) . generate ( sink , attributes : : unused , context ) )
2017-11-23 16:50:16 -08:00
return false ;
2019-04-23 02:48:03 -07:00
2017-11-23 16:50:16 -08:00
return true ;
}
} ;
2020-01-20 14:00:44 -08:00
2017-11-23 16:50:16 -08:00
struct function_definition_generator
{
template < typename OutputIterator , typename Context >
bool generate ( OutputIterator sink , attributes : : function_def const & f , Context const & context ) const
{
2018-04-27 14:08:25 -07:00
EINA_CXX_DOM_LOG_DBG ( eolian_mono : : domain ) < < " function_definition_generator: " < < f . c_name < < std : : endl ;
2019-09-10 15:47:47 -07:00
bool is_concrete = context_find_tag < class_context > ( context ) . current_wrapper_kind = = class_context : : concrete ;
2019-01-17 04:43:57 -08:00
if ( blacklist : : is_function_blacklisted ( f , context ) )
2017-11-23 16:50:16 -08:00
return true ;
2018-04-10 18:30:40 -07:00
2020-01-30 11:49:04 -08:00
auto function_scope = eolian_mono : : function_scope_get ( f ) ;
auto it = std : : find_if ( properties . begin ( ) , properties . end ( )
, [ & ] ( attributes : : property_def const & prop )
{
return ( prop . getter & & * prop . getter = = f )
| | ( prop . setter & & * prop . setter = = f ) ;
} ) ;
if ( it ! = properties . end ( ) )
{
if ( it - > getter & & * it - > getter = = f )
{
if ( property_generate_wrapper_getter ( * it , context ) )
function_scope = " internal " ;
}
else
if ( property_generate_wrapper_setter ( * it , context ) )
function_scope = " internal " ;
}
2019-09-10 15:47:47 -07:00
// Do not generate static function for concrete class
if ( is_concrete & & f . is_static )
return true ;
2017-11-23 16:50:16 -08:00
std : : string return_type ;
if ( ! as_generator ( eolian_mono : : type ( true ) ) . generate ( std : : back_inserter ( return_type ) , f . return_type , context ) )
return false ;
2017-12-06 16:03:55 -08:00
if ( ! as_generator
2020-01-12 16:45:16 -08:00
( documentation ( 2 ) ) . generate ( sink , f , context ) )
2017-12-06 16:03:55 -08:00
return false ;
csharp: Change to new class API.
Summary:
As discussed in T7204:
- Eo Interfaces/mixins -> C# Interfaces with concrete class
implementations
- Eo Regular/Abstracts -> Proper C# classes
- Added some new generators and helper methods.
- Refactored the class generator, splitting into helper methods
Eo handles now are stored only in the "root" class in any given
inheritance tree (generally, Efl.Object), and accessible to each child.
Methods also are defined in a single place instead of repeatedly
generated in everyfile, reducing the size of the generated .dll from
30MB to around 4.5MB.
Mixins are generated as C# interfaces but any regular class it inherits
from is lost, as we can't have interfaces inheriting from regular
classes. This will be dealt with in a later commit.
Summary of API Changes:
- Merged Inherit/Concrete classes. (These suffixes disappear from
regular classes).
- Interface still have implementations with 'Concrete' suffix for when
they are returned from methods.
- Removed 'I' from interface names.
- Removed interfaces for regular/abstract Eo classes.
- Concrete classes for interfaces/mixins hold the event argument struct.
- Removed '_' from classes, enums, structs, etc, as indicated in C#
naming conventions.
- Namespaces are now Camel.Cased.
- Renamed IWrapper's raw_handle/raw_klass to NativeHandle/NativeClass
Also renamed the test classes as after the namespace change, the
test namespace Test can conflict with the helper Test namespace.
(And use more meaningful names than Test.Testing...)
Also Fixes T7336 by removing a deprecated example and adding
efl_loop_timer_example to build system.
Fixes T7451 by hiding the class_get DllImports and renaming the IWrapper
fields. The native handlers are used in the manual binding.
Still need to work:
- As there are still some events names clashing (e.g. Efl.Ui.Bg with "resize"
from Efl.Gfx.Entity and Efl.Gfx.Image), Events are currently declared on
the interface and implemented "namespaced" in the classes,
requiring the cast to the interface to access the event.
- The Mixin Conundrum. Mixin inheritance will be dealt in a future
commit.
Depends on D7260
Reviewers: segfaultxavi, vitor.sousa, felipealmeida, Jaehyun_Cho
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7451, T7336
Differential Revision: https://phab.enlightenment.org/D7262
2018-11-29 15:04:37 -08:00
std : : string self = " this.NativeHandle " ;
2019-06-28 14:20:01 -07:00
// IsGeneratedBindingClass is set in the constructor, true if this
// instance is from a pure C# class (not generated).
csharp: Change to new class API.
Summary:
As discussed in T7204:
- Eo Interfaces/mixins -> C# Interfaces with concrete class
implementations
- Eo Regular/Abstracts -> Proper C# classes
- Added some new generators and helper methods.
- Refactored the class generator, splitting into helper methods
Eo handles now are stored only in the "root" class in any given
inheritance tree (generally, Efl.Object), and accessible to each child.
Methods also are defined in a single place instead of repeatedly
generated in everyfile, reducing the size of the generated .dll from
30MB to around 4.5MB.
Mixins are generated as C# interfaces but any regular class it inherits
from is lost, as we can't have interfaces inheriting from regular
classes. This will be dealt with in a later commit.
Summary of API Changes:
- Merged Inherit/Concrete classes. (These suffixes disappear from
regular classes).
- Interface still have implementations with 'Concrete' suffix for when
they are returned from methods.
- Removed 'I' from interface names.
- Removed interfaces for regular/abstract Eo classes.
- Concrete classes for interfaces/mixins hold the event argument struct.
- Removed '_' from classes, enums, structs, etc, as indicated in C#
naming conventions.
- Namespaces are now Camel.Cased.
- Renamed IWrapper's raw_handle/raw_klass to NativeHandle/NativeClass
Also renamed the test classes as after the namespace change, the
test namespace Test can conflict with the helper Test namespace.
(And use more meaningful names than Test.Testing...)
Also Fixes T7336 by removing a deprecated example and adding
efl_loop_timer_example to build system.
Fixes T7451 by hiding the class_get DllImports and renaming the IWrapper
fields. The native handlers are used in the manual binding.
Still need to work:
- As there are still some events names clashing (e.g. Efl.Ui.Bg with "resize"
from Efl.Gfx.Entity and Efl.Gfx.Image), Events are currently declared on
the interface and implemented "namespaced" in the classes,
requiring the cast to the interface to access the event.
- The Mixin Conundrum. Mixin inheritance will be dealt in a future
commit.
Depends on D7260
Reviewers: segfaultxavi, vitor.sousa, felipealmeida, Jaehyun_Cho
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7451, T7336
Differential Revision: https://phab.enlightenment.org/D7262
2018-11-29 15:04:37 -08:00
if ( do_super & & ! f . is_static )
2019-10-15 06:11:09 -07:00
self = " (IsGeneratedBindingClass ? " + self + " : Efl.Eo.Globals.Super( " + self + " , this.NativeClass)) " ;
2019-02-11 10:53:29 -08:00
else if ( f . is_static )
2019-02-09 09:45:27 -08:00
self = " " ;
csharp: Change to new class API.
Summary:
As discussed in T7204:
- Eo Interfaces/mixins -> C# Interfaces with concrete class
implementations
- Eo Regular/Abstracts -> Proper C# classes
- Added some new generators and helper methods.
- Refactored the class generator, splitting into helper methods
Eo handles now are stored only in the "root" class in any given
inheritance tree (generally, Efl.Object), and accessible to each child.
Methods also are defined in a single place instead of repeatedly
generated in everyfile, reducing the size of the generated .dll from
30MB to around 4.5MB.
Mixins are generated as C# interfaces but any regular class it inherits
from is lost, as we can't have interfaces inheriting from regular
classes. This will be dealt with in a later commit.
Summary of API Changes:
- Merged Inherit/Concrete classes. (These suffixes disappear from
regular classes).
- Interface still have implementations with 'Concrete' suffix for when
they are returned from methods.
- Removed 'I' from interface names.
- Removed interfaces for regular/abstract Eo classes.
- Concrete classes for interfaces/mixins hold the event argument struct.
- Removed '_' from classes, enums, structs, etc, as indicated in C#
naming conventions.
- Namespaces are now Camel.Cased.
- Renamed IWrapper's raw_handle/raw_klass to NativeHandle/NativeClass
Also renamed the test classes as after the namespace change, the
test namespace Test can conflict with the helper Test namespace.
(And use more meaningful names than Test.Testing...)
Also Fixes T7336 by removing a deprecated example and adding
efl_loop_timer_example to build system.
Fixes T7451 by hiding the class_get DllImports and renaming the IWrapper
fields. The native handlers are used in the manual binding.
Still need to work:
- As there are still some events names clashing (e.g. Efl.Ui.Bg with "resize"
from Efl.Gfx.Entity and Efl.Gfx.Image), Events are currently declared on
the interface and implemented "namespaced" in the classes,
requiring the cast to the interface to access the event.
- The Mixin Conundrum. Mixin inheritance will be dealt in a future
commit.
Depends on D7260
Reviewers: segfaultxavi, vitor.sousa, felipealmeida, Jaehyun_Cho
Reviewed By: vitor.sousa
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7451, T7336
Differential Revision: https://phab.enlightenment.org/D7262
2018-11-29 15:04:37 -08:00
2017-11-23 16:50:16 -08:00
if ( ! as_generator
2020-01-30 11:49:04 -08:00
( scope_tab ( 2 ) < < function_scope < < ( ( do_super & & ! f . is_static ) ? " virtual " : " " ) < < ( f . is_static ? " static " : " " ) < < return_type < < " " < < string < < " ( " < < ( parameter % " , " )
2019-09-23 16:50:27 -07:00
< < " ) { \n "
2020-01-12 16:45:16 -08:00
< < scope_tab ( 3 ) < < eolian_mono : : function_definition_preamble ( )
2019-01-15 23:29:56 -08:00
< < klass_full_native_inherit_name ( f . klass ) < < " . " < < string < < " _ptr.Value.Delegate( "
< < self
2019-11-06 18:34:18 -08:00
< < ( ( ! f . is_static & & ( f . parameters . size ( ) > 0 ) ) ? " , " : " " )
2019-02-09 09:45:27 -08:00
< < ( argument_invocation % " , " ) < < " ); \n "
2020-01-12 16:45:16 -08:00
< < scope_tab ( 3 ) < < eolian_mono : : function_definition_epilogue ( )
< < scope_tab ( 2 ) < < " } \n \n " )
2018-05-02 15:49:37 -07:00
. generate ( sink , std : : make_tuple ( name_helpers : : managed_method_name ( f ) , f . parameters , f , f . c_name , f . parameters , f ) , context ) )
2017-11-23 16:50:16 -08:00
return false ;
return true ;
}
bool do_super ;
2020-01-30 11:49:04 -08:00
std : : vector < attributes : : property_def > properties ;
2017-11-23 16:50:16 -08:00
} ;
struct function_definition_parameterized
{
2020-01-30 11:49:04 -08:00
function_definition_generator operator ( ) ( bool do_super , std : : vector < attributes : : property_def > properties ) const
{
return { do_super , properties } ;
}
function_definition_generator operator ( ) ( std : : vector < attributes : : property_def > properties ) const
2017-11-23 16:50:16 -08:00
{
2020-01-30 11:49:04 -08:00
return { false , properties } ;
2017-11-23 16:50:16 -08:00
}
} const function_definition ;
2020-01-30 11:49:04 -08:00
// function_definition_generator as_generator(function_definition_parameterized)
// {
// return {};
// }
2017-11-23 16:50:16 -08:00
struct native_function_definition_parameterized
{
2020-01-30 11:49:04 -08:00
native_function_definition_generator operator ( ) ( attributes : : klass_def const & klass , std : : vector < attributes : : property_def > properties ) const
2017-11-23 16:50:16 -08:00
{
2020-01-30 11:49:04 -08:00
return { & klass , properties } ;
2017-11-23 16:50:16 -08:00
}
} const native_function_definition ;
2019-08-05 07:17:52 -07:00
struct property_extension_method_definition_generator
{
template < typename OutputIterator , typename Context >
bool generate ( OutputIterator sink , attributes : : property_def const & property , Context context ) const
{
if ( blacklist : : is_property_blacklisted ( property , context ) )
return true ;
auto options = efl : : eolian : : grammar : : context_find_tag < options_context > ( context ) ;
if ( ! options . want_beta )
return true ; // Bindable is a beta feature for now.
auto get_params = property . getter . is_engaged ( ) ? property . getter - > parameters . size ( ) : 0 ;
auto set_params = property . setter . is_engaged ( ) ? property . setter - > parameters . size ( ) : 0 ;
std : : string managed_name = name_helpers : : property_managed_name ( property ) ;
if ( get_params > 0 | | set_params > 1 )
return true ;
std : : string dir_mod ;
if ( property . setter . is_engaged ( ) )
dir_mod = direction_modifier ( property . setter - > parameters [ 0 ] ) ;
if ( property . setter . is_engaged ( ) )
{
attributes : : type_def prop_type = property . setter - > parameters [ 0 ] . type ;
2020-01-21 18:33:41 -08:00
if ( ! as_generator ( scope_tab ( 2 ) < < " public static Efl.BindableProperty< " < < type ( true ) < < " > " < < managed_name < < " <T>(this Efl.Ui.ItemFactory<T> fac, Efl.Csharp.ExtensionTag< "
< < name_helpers : : klass_full_concrete_or_interface_name ( cls )
< < " , T>magic = null) where T : " < < name_helpers : : klass_full_concrete_or_interface_name ( cls ) < < " { \n "
2020-01-12 16:45:16 -08:00
< < scope_tab ( 2 ) < < scope_tab < < " return new Efl.BindableProperty< " < < type ( true ) < < " >( \" " < < property . name < < " \" , fac); \n "
< < scope_tab ( 2 ) < < " } \n \n "
2019-08-19 17:31:20 -07:00
) . generate ( sink , std : : make_tuple ( prop_type , prop_type ) , context ) )
return false ;
}
// Do we need BindablePart extensions for this class?
2019-08-23 10:12:08 -07:00
// IContent parts are handled directly through BindableFactoryParts
if ( ! helpers : : inherits_from ( cls , " Efl.Ui.LayoutPart " ) | | helpers : : inherits_from ( cls , " Efl.IContent " ) )
2019-08-19 17:31:20 -07:00
return true ;
if ( property . setter . is_engaged ( ) )
{
attributes : : type_def prop_type = property . setter - > parameters [ 0 ] . type ;
2020-01-21 18:33:41 -08:00
if ( ! as_generator ( scope_tab ( 2 ) < < " public static Efl.BindableProperty< " < < type ( true ) < < " > " < < managed_name < < " <T>(this Efl.BindablePart<T> part, Efl.Csharp.ExtensionTag< "
< < name_helpers : : klass_full_concrete_or_interface_name ( cls )
< < " , T>magic = null) where T : " < < name_helpers : : klass_full_concrete_or_interface_name ( cls ) < < " { \n "
2020-01-12 16:45:16 -08:00
< < scope_tab ( 2 ) < < scope_tab < < " Contract.Requires(part != null, nameof(part)); \n "
< < scope_tab ( 2 ) < < scope_tab < < " return new Efl.BindableProperty< " < < type ( true ) < < " >(part.PartName, \" " < < property . name < < " \" , part.Binder); \n "
< < scope_tab ( 2 ) < < " } \n \n "
2019-08-05 07:17:52 -07:00
) . generate ( sink , std : : make_tuple ( prop_type , prop_type ) , context ) )
return false ;
}
return true ;
}
grammar : : attributes : : klass_def const & cls ;
} ;
property_extension_method_definition_generator property_extension_method_definition ( grammar : : attributes : : klass_def const & cls )
{
return { cls } ;
}
2018-12-14 12:17:23 -08:00
struct property_wrapper_definition_generator
{
template < typename OutputIterator , typename Context >
2019-03-22 14:37:50 -07:00
bool generate ( OutputIterator sink , attributes : : property_def const & property , Context const & context ) const
2018-12-14 12:17:23 -08:00
{
2019-08-23 10:00:26 -07:00
using efl : : eolian : : grammar : : attribute_reorder ;
using efl : : eolian : : grammar : : counter ;
using efl : : eolian : : grammar : : attributes : : parameter_direction ;
using efl : : eolian : : grammar : : attributes : : parameter_def ;
2020-01-20 14:00:44 -08:00
if ( blacklist : : is_property_blacklisted ( property , * implementing_klass , context ) )
return true ;
2018-12-14 12:17:23 -08:00
csharp: Skip non-public members from interfaces
Summary:
Eolian allows non-public members in interfaces and mixins (usually
@protected). As both kinds are converted to C# interfaces, this
causes problem as non-public members are forbidden in C# interfaces.
This commit changes eolian_mono by removing those members from the C#
interfaces. If a generated class implements the interface, the method is
generated as if it were a protected member of the class directly.
For mixed properties like `Efl.Io.Reader.CanRead { get; set @protected; }`,
the interface has only the public getter and the the implementing class has both
the public getter and the protected setter.
With this, C# devs won't be able to directly implement protected Eo
methods from interfaces. (But this really does not make sense from the
C# point of view).
ref T7494
Reviewers: segfaultxavi, felipealmeida, YOhoho
Reviewed By: YOhoho
Subscribers: cedric, brunobelo, Jaehyun_Cho, #reviewers, woohyun, #committers
Tags: #efl
Maniphest Tasks: T7494
Differential Revision: https://phab.enlightenment.org/D9800
2019-09-10 15:30:46 -07:00
bool is_interface = context_find_tag < class_context > ( context ) . current_wrapper_kind = = class_context : : interface ;
2018-12-21 07:04:43 -08:00
bool is_static = ( property . getter . is_engaged ( ) & & property . getter - > is_static )
| | ( property . setter . is_engaged ( ) & & property . setter - > is_static ) ;
2019-09-10 15:47:47 -07:00
bool is_concrete = context_find_tag < class_context > ( context ) . current_wrapper_kind = = class_context : : concrete ;
2018-12-14 12:17:23 -08:00
2020-01-20 14:00:44 -08:00
if ( ( is_concrete | | is_interface ) & & is_static )
return true ;
auto get_params = property . getter . is_engaged ( ) ? property . getter - > parameters . size ( ) : 0 ;
//auto set_params = property.setter.is_engaged() ? property.setter->parameters.size() : 0;
// C# properties must have a single value.
//
// Single values in getters are automatically converted to return_type,
// meaning they should have 0 parameters.
//
// For setters, we ignore the return type - usually boolean.
// if (get_params > 0 || set_params > 1)
// return true;
2020-01-30 11:49:04 -08:00
if ( property . getter & & ! property . getter - > keys . empty ( ) )
2020-01-20 14:00:44 -08:00
return true ;
2020-01-30 11:49:04 -08:00
if ( property . setter & & ! property . setter - > keys . empty ( ) )
2020-01-20 14:00:44 -08:00
return true ;
2020-01-30 11:49:04 -08:00
2020-01-20 14:00:44 -08:00
if ( property . getter & & property . setter )
2019-08-23 10:00:26 -07:00
{
2020-01-30 11:49:04 -08:00
if ( property . setter - > values . size ( ) ! = property . getter - > values . size ( ) )
{
if ( ! std : : equal ( property . setter - > values . begin ( ) , property . setter - > values . end ( )
, property . getter - > values . begin ( ) ) )
return true ;
}
2019-08-23 10:00:26 -07:00
}
2018-12-14 12:17:23 -08:00
2020-01-20 14:00:44 -08:00
std : : vector < attributes : : parameter_def > parameters ;
if ( property . setter . is_engaged ( ) )
{
std : : transform ( property . setter - > parameters . begin ( ) , property . setter - > parameters . end ( )
, std : : back_inserter ( parameters )
, [ ] ( parameter_def p ) - > parameter_def
{
//p.direction = efl::eolian::attributes::parameter_direction::in;
return p ;
} ) ;
}
else if ( property . getter . is_engaged ( ) )
{
// if getter has parameters, then we ignore return type, otherwise
// we use the return type.
if ( get_params = = 0 )
parameters . push_back ( { parameter_direction : : in
, property . getter - > return_type , " propertyResult " , { }
, property . getter - > unit } ) ;
else
std : : transform ( property . getter - > parameters . begin ( ) , property . getter - > parameters . end ( )
, std : : back_inserter ( parameters )
, [ ] ( parameter_def p ) - > parameter_def
{
p . direction = parameter_direction : : in ;
return p ;
} ) ;
}
else
{
EINA_CXX_DOM_LOG_ERR ( eolian_mono : : domain ) < < " Property must have either a getter or a setter. " < < std : : endl ;
return false ;
}
std : : string dir_mod ;
if ( property . setter . is_engaged ( ) )
dir_mod = direction_modifier ( property . setter - > parameters [ 0 ] ) ;
2018-12-14 12:17:23 -08:00
std : : string managed_name = name_helpers : : property_managed_name ( property ) ;
2019-06-24 03:19:00 -07:00
std : : string scope = " public " ;
2020-01-20 14:00:44 -08:00
std : : string get_scope = property . getter . is_engaged ( ) ? eolian_mono : : function_scope_get ( * property . getter ) : " " ;
bool is_get_public = get_scope = = " public " ;
std : : string set_scope = property . setter . is_engaged ( ) ? eolian_mono : : function_scope_get ( * property . setter ) : " " ;
bool is_set_public = set_scope = = " public " ;
// No need to generate this wrapper as no accessor is public.
if ( is_interface & & ( ! is_get_public & & ! is_set_public ) )
return true ;
csharp: Skip non-public members from interfaces
Summary:
Eolian allows non-public members in interfaces and mixins (usually
@protected). As both kinds are converted to C# interfaces, this
causes problem as non-public members are forbidden in C# interfaces.
This commit changes eolian_mono by removing those members from the C#
interfaces. If a generated class implements the interface, the method is
generated as if it were a protected member of the class directly.
For mixed properties like `Efl.Io.Reader.CanRead { get; set @protected; }`,
the interface has only the public getter and the the implementing class has both
the public getter and the protected setter.
With this, C# devs won't be able to directly implement protected Eo
methods from interfaces. (But this really does not make sense from the
C# point of view).
ref T7494
Reviewers: segfaultxavi, felipealmeida, YOhoho
Reviewed By: YOhoho
Subscribers: cedric, brunobelo, Jaehyun_Cho, #reviewers, woohyun, #committers
Tags: #efl
Maniphest Tasks: T7494
Differential Revision: https://phab.enlightenment.org/D9800
2019-09-10 15:30:46 -07:00
2020-01-21 16:40:18 -08:00
// Do not generate set-only proeprty
if ( property . setter . is_engaged ( ) & & ! property . getter . is_engaged ( ) )
return true ;
csharp: Skip non-public members from interfaces
Summary:
Eolian allows non-public members in interfaces and mixins (usually
@protected). As both kinds are converted to C# interfaces, this
causes problem as non-public members are forbidden in C# interfaces.
This commit changes eolian_mono by removing those members from the C#
interfaces. If a generated class implements the interface, the method is
generated as if it were a protected member of the class directly.
For mixed properties like `Efl.Io.Reader.CanRead { get; set @protected; }`,
the interface has only the public getter and the the implementing class has both
the public getter and the protected setter.
With this, C# devs won't be able to directly implement protected Eo
methods from interfaces. (But this really does not make sense from the
C# point of view).
ref T7494
Reviewers: segfaultxavi, felipealmeida, YOhoho
Reviewed By: YOhoho
Subscribers: cedric, brunobelo, Jaehyun_Cho, #reviewers, woohyun, #committers
Tags: #efl
Maniphest Tasks: T7494
Differential Revision: https://phab.enlightenment.org/D9800
2019-09-10 15:30:46 -07:00
// C# interface members are declared automatically as public
if ( is_interface )
2019-06-24 03:19:00 -07:00
{
scope = " " ;
get_scope = " " ;
set_scope = " " ;
}
else if ( ( get_scope ! = " " ) & & ( get_scope = = set_scope ) )
{
scope = get_scope ;
get_scope = " " ;
set_scope = " " ;
}
2020-01-20 14:00:44 -08:00
else if ( ! property . setter . is_engaged ( ) | | ( get_scope = = scope ) )
2019-06-24 03:19:00 -07:00
{
scope = get_scope ;
get_scope = " " ;
}
2020-01-20 14:00:44 -08:00
else if ( ! property . getter . is_engaged ( ) | | ( set_scope = = scope ) )
2019-12-19 17:35:23 -08:00
{
2020-01-20 14:00:44 -08:00
scope = set_scope ;
set_scope = " " ;
2019-06-24 03:19:00 -07:00
}
2020-01-20 14:00:44 -08:00
if ( parameters . size ( ) = = 1 )
2019-08-23 10:00:26 -07:00
{
if ( ! as_generator (
2020-01-12 16:45:16 -08:00
documentation ( 2 )
2020-01-20 14:00:44 -08:00
< < scope_tab ( 2 ) < < scope < < ( is_static ? " static " : " " ) < < type ( true ) < < " " < < managed_name < < " { \n "
) . generate ( sink , std : : make_tuple ( property , parameters [ 0 ] . type ) , context ) )
2019-08-23 10:00:26 -07:00
return false ;
}
else
{
if ( ! as_generator
(
2020-01-12 16:45:16 -08:00
documentation ( 2 )
< < scope_tab ( 2 ) < < scope < < ( is_static ? " static ( " : " ( " )
2019-08-23 10:00:26 -07:00
< < ( attribute_reorder < 1 , - 1 > ( type ( true ) /*<< " " << argument*/ ) % " , " ) < < " ) "
< < managed_name < < " { \n "
2020-01-20 14:00:44 -08:00
) . generate ( sink , std : : make_tuple ( property , parameters ) , context ) )
2019-08-23 10:00:26 -07:00
return false ;
}
2018-12-14 12:17:23 -08:00
2020-01-20 14:00:44 -08:00
if ( property . getter . is_engaged ( ) & & is_interface )
2019-08-23 10:00:26 -07:00
{
2020-01-20 14:00:44 -08:00
if ( is_get_public )
2020-01-30 11:49:04 -08:00
{
2020-01-20 14:00:44 -08:00
if ( ! as_generator ( scope_tab ( 2 ) < < scope_tab < < set_scope < < " get; \n "
) . generate ( sink , attributes : : unused , context ) )
return false ;
2020-01-30 11:49:04 -08:00
}
2019-08-23 10:00:26 -07:00
}
2020-01-20 14:00:44 -08:00
else if ( property . getter . is_engaged ( ) & & get_params = = 0 /*parameters.size() == 1 && property.getter.is_engaged()*/ )
2019-08-23 10:00:26 -07:00
{
2020-01-20 14:00:44 -08:00
if ( ! as_generator
( scope_tab ( 2 ) < < scope_tab < < get_scope
< < " get " < < " { return " + name_helpers : : managed_method_name ( * property . getter ) + " (); } \n "
) . generate ( sink , attributes : : unused , context ) )
return false ;
}
else if ( parameters . size ( ) > = 1 & & property . getter )
{
if ( ! as_generator
( scope_tab ( 2 ) < < scope_tab < < get_scope < < " get "
< < " { \n "
< < * attribute_reorder < 1 , - 1 , 1 >
( scope_tab ( 4 ) < < type ( true ) < < " _out_ "
< < argument ( false ) < < " = default( " < < type ( true ) < < " ); \n "
)
< < scope_tab ( 4 ) < < name_helpers : : managed_method_name ( * property . getter )
< < " ( " < < ( ( " out _out_ " < < argument ( false ) ) % " , " ) < < " ); \n "
< < scope_tab ( 4 ) < < " return ( " < < ( ( " _out_ " < < argument ( false ) ) % " , " ) < < " ); \n "
< < scope_tab ( 3 ) < < " } " < < " \n "
) . generate ( sink , std : : make_tuple ( parameters , parameters , parameters ) , context ) )
return false ;
}
// else if (parameters.size() == 1)
// {
// if (!as_generator
// (scope_tab << scope_tab << get_scope << "get "
// << "{\n"
// << *attribute_reorder<1, -1, 1>(scope_tab(3) << type(true) << " _out_" << argument(false) << " = default(" << type(true) << ");\n")
// << scope_tab(3) << name_helpers::managed_method_name(*property.getter)
// << "(" << (("out _out_" << argument(false)) % ",") << ");\n"
// << scope_tab(3) << "return " << (("_out_"<< argument(false)) % ",") << ";\n"
// << scope_tab(2) << "}" << "\n"
// ).generate(sink, std::make_tuple(parameters, parameters, parameters), context))
// return false;
// }
2019-08-23 10:00:26 -07:00
2020-01-20 14:00:44 -08:00
if ( property . setter . is_engaged ( ) & & is_interface )
{
if ( is_set_public )
2020-01-30 11:49:04 -08:00
{
2020-01-20 14:00:44 -08:00
if ( ! as_generator ( scope_tab ( 2 ) < < scope_tab < < set_scope < < " set; \n "
) . generate ( sink , attributes : : unused , context ) )
return false ;
2020-01-30 11:49:04 -08:00
}
2020-01-20 14:00:44 -08:00
}
else if ( parameters . size ( ) = = 1 & & property . setter . is_engaged ( ) )
{
if ( ! as_generator ( scope_tab ( 2 ) < < scope_tab < < set_scope < < " set " < < " { " + name_helpers : : managed_method_name ( * property . setter ) + " ( " + dir_mod + " value); } \n "
) . generate ( sink , attributes : : unused , context ) )
return false ;
}
else if ( parameters . size ( ) > 1 & & property . setter . is_engaged ( ) )
{
if ( ! as_generator ( scope_tab ( 2 ) < < scope_tab < < set_scope < < " set " < < ( " { " + name_helpers : : managed_method_name ( * property . setter ) + " ( " + dir_mod ) < < ( ( " value.Item " < < counter ( 1 ) ) % " , " ) < < " ); } " < < " \n "
) . generate ( sink , parameters , context ) )
return false ;
2019-08-23 10:00:26 -07:00
}
2018-12-14 12:17:23 -08:00
2020-01-12 16:45:16 -08:00
if ( ! as_generator ( scope_tab ( 2 ) < < " } \n \n " ) . generate ( sink , attributes : : unused , context ) )
2018-12-14 12:17:23 -08:00
return false ;
return true ;
}
2020-01-20 14:00:44 -08:00
attributes : : klass_def const * implementing_klass ;
2019-03-21 10:38:45 -07:00
} ;
struct property_wrapper_definition_parameterized
{
2020-01-20 14:00:44 -08:00
property_wrapper_definition_generator operator ( ) ( attributes : : klass_def const & klass ) const
2019-03-21 10:38:45 -07:00
{
2020-01-20 14:00:44 -08:00
return { & klass } ;
2019-03-21 10:38:45 -07:00
}
2018-12-14 12:17:23 -08:00
} const property_wrapper_definition ;
2019-03-21 10:38:45 -07:00
property_wrapper_definition_generator as_generator ( property_wrapper_definition_parameterized )
{
return { } ;
}
2018-12-14 12:17:23 -08:00
2017-11-23 16:50:16 -08:00
}
namespace efl { namespace eolian { namespace grammar {
template < >
struct is_eager_generator < : : eolian_mono : : function_definition_generator > : std : : true_type { } ;
template < >
struct is_eager_generator < : : eolian_mono : : native_function_definition_generator > : std : : true_type { } ;
template < >
2019-08-05 07:17:52 -07:00
struct is_eager_generator < : : eolian_mono : : property_extension_method_definition_generator > : std : : true_type { } ;
template < >
2018-12-14 12:17:23 -08:00
struct is_eager_generator < : : eolian_mono : : property_wrapper_definition_generator > : std : : true_type { } ;
template < >
2019-03-21 10:38:45 -07:00
struct is_eager_generator < : : eolian_mono : : property_wrapper_definition_parameterized > : std : : true_type { } ;
template < >
2017-11-23 16:50:16 -08:00
struct is_generator < : : eolian_mono : : function_definition_generator > : std : : true_type { } ;
template < >
struct is_generator < : : eolian_mono : : native_function_definition_generator > : std : : true_type { } ;
template < >
struct is_generator < : : eolian_mono : : function_definition_parameterized > : std : : true_type { } ;
2018-12-14 12:17:23 -08:00
template < >
2019-08-05 07:17:52 -07:00
struct is_generator < : : eolian_mono : : property_extension_method_definition_generator > : std : : true_type { } ;
template < >
2018-12-14 12:17:23 -08:00
struct is_generator < : : eolian_mono : : property_wrapper_definition_generator > : std : : true_type { } ;
2019-03-21 10:38:45 -07:00
template < >
struct is_generator < : : eolian_mono : : property_wrapper_definition_parameterized > : std : : true_type { } ;
2017-11-23 16:50:16 -08:00
namespace type_traits {
template < >
struct attributes_needed < : : eolian_mono : : function_definition_generator > : std : : integral_constant < int , 1 > { } ;
template < >
struct attributes_needed < : : eolian_mono : : function_definition_parameterized > : std : : integral_constant < int , 1 > { } ;
template < >
struct attributes_needed < : : eolian_mono : : native_function_definition_generator > : std : : integral_constant < int , 1 > { } ;
2018-12-14 12:17:23 -08:00
2019-08-05 07:17:52 -07:00
template < >
struct attributes_needed < : : eolian_mono : : property_extension_method_definition_generator > : std : : integral_constant < int , 1 > { } ;
2018-12-14 12:17:23 -08:00
template < >
struct attributes_needed < : : eolian_mono : : property_wrapper_definition_generator > : std : : integral_constant < int , 1 > { } ;
2019-03-21 10:38:45 -07:00
template < >
struct attributes_needed < : : eolian_mono : : property_wrapper_definition_parameterized > : std : : integral_constant < int , 1 > { } ;
2017-11-23 16:50:16 -08:00
}
2020-01-20 14:00:44 -08:00
2017-11-23 16:50:16 -08:00
} } }
# endif