Skip to content

Commit

Permalink
universal bind_ function
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackMATov committed Sep 12, 2024
1 parent 637d989 commit a2f428b
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 22 deletions.
80 changes: 69 additions & 11 deletions develop/singles/headers/meta.hpp/meta_all.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5040,61 +5040,119 @@ namespace meta_hpp
namespace meta_hpp
{
template < array_kind Array >
array_bind<Array> array_(metadata_map metadata = {}) {
array_bind<Array> bind_(metadata_map metadata = {}) {
return array_bind<Array>{std::move(metadata)};
}

template < class_kind Class >
class_bind<Class> class_(metadata_map metadata = {}) {
class_bind<Class> bind_(metadata_map metadata = {}) {
return class_bind<Class>{std::move(metadata)};
}

template < enum_kind Enum >
enum_bind<Enum> enum_(metadata_map metadata = {}) {
enum_bind<Enum> bind_(metadata_map metadata = {}) {
return enum_bind<Enum>{std::move(metadata)};
}

template < function_kind Function >
function_bind<Function> function_(metadata_map metadata = {}) {
function_bind<Function> bind_(metadata_map metadata = {}) {
return function_bind<Function>{std::move(metadata)};
}

template < member_pointer_kind Member >
member_bind<Member> member_(metadata_map metadata = {}) {
member_bind<Member> bind_(metadata_map metadata = {}) {
return member_bind<Member>{std::move(metadata)};
}

template < method_pointer_kind Method >
method_bind<Method> method_(metadata_map metadata = {}) {
method_bind<Method> bind_(metadata_map metadata = {}) {
return method_bind<Method>{std::move(metadata)};
}

template < nullptr_kind Nullptr >
nullptr_bind<Nullptr> nullptr_(metadata_map metadata = {}) {
nullptr_bind<Nullptr> bind_(metadata_map metadata = {}) {
return nullptr_bind<Nullptr>{std::move(metadata)};
}

template < number_kind Number >
number_bind<Number> number_(metadata_map metadata = {}) {
number_bind<Number> bind_(metadata_map metadata = {}) {
return number_bind<Number>{std::move(metadata)};
}

template < pointer_kind Pointer >
pointer_bind<Pointer> pointer_(metadata_map metadata = {}) {
pointer_bind<Pointer> bind_(metadata_map metadata = {}) {
return pointer_bind<Pointer>{std::move(metadata)};
}

template < reference_kind Reference >
reference_bind<Reference> reference_(metadata_map metadata = {}) {
reference_bind<Reference> bind_(metadata_map metadata = {}) {
return reference_bind<Reference>{std::move(metadata)};
}

template < void_kind Void >
void_bind<Void> void_(metadata_map metadata = {}) {
void_bind<Void> bind_(metadata_map metadata = {}) {
return void_bind<Void>{std::move(metadata)};
}
}

namespace meta_hpp
{
template < array_kind Array >
array_bind<Array> array_(metadata_map metadata = {}) {
return bind_<Array>(std::move(metadata));
}

template < class_kind Class >
class_bind<Class> class_(metadata_map metadata = {}) {
return bind_<Class>(std::move(metadata));
}

template < enum_kind Enum >
enum_bind<Enum> enum_(metadata_map metadata = {}) {
return bind_<Enum>(std::move(metadata));
}

template < function_kind Function >
function_bind<Function> function_(metadata_map metadata = {}) {
return bind_<Function>(std::move(metadata));
}

template < member_pointer_kind Member >
member_bind<Member> member_(metadata_map metadata = {}) {
return bind_<Member>(std::move(metadata));
}

template < method_pointer_kind Method >
method_bind<Method> method_(metadata_map metadata = {}) {
return bind_<Method>(std::move(metadata));
}

template < nullptr_kind Nullptr >
nullptr_bind<Nullptr> nullptr_(metadata_map metadata = {}) {
return bind_<Nullptr>(std::move(metadata));
}

template < number_kind Number >
number_bind<Number> number_(metadata_map metadata = {}) {
return bind_<Number>(std::move(metadata));
}

template < pointer_kind Pointer >
pointer_bind<Pointer> pointer_(metadata_map metadata = {}) {
return bind_<Pointer>(std::move(metadata));
}

template < reference_kind Reference >
reference_bind<Reference> reference_(metadata_map metadata = {}) {
return bind_<Reference>(std::move(metadata));
}

template < void_kind Void >
void_bind<Void> void_(metadata_map metadata = {}) {
return bind_<Void>(std::move(metadata));
}
}

namespace meta_hpp
{
inline scope_bind local_scope_(std::string name, metadata_map metadata = {}) {
Expand Down
80 changes: 69 additions & 11 deletions headers/meta.hpp/meta_binds.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,61 +210,119 @@ namespace meta_hpp
namespace meta_hpp
{
template < array_kind Array >
array_bind<Array> array_(metadata_map metadata = {}) {
array_bind<Array> bind_(metadata_map metadata = {}) {
return array_bind<Array>{std::move(metadata)};
}

template < class_kind Class >
class_bind<Class> class_(metadata_map metadata = {}) {
class_bind<Class> bind_(metadata_map metadata = {}) {
return class_bind<Class>{std::move(metadata)};
}

template < enum_kind Enum >
enum_bind<Enum> enum_(metadata_map metadata = {}) {
enum_bind<Enum> bind_(metadata_map metadata = {}) {
return enum_bind<Enum>{std::move(metadata)};
}

template < function_kind Function >
function_bind<Function> function_(metadata_map metadata = {}) {
function_bind<Function> bind_(metadata_map metadata = {}) {
return function_bind<Function>{std::move(metadata)};
}

template < member_pointer_kind Member >
member_bind<Member> member_(metadata_map metadata = {}) {
member_bind<Member> bind_(metadata_map metadata = {}) {
return member_bind<Member>{std::move(metadata)};
}

template < method_pointer_kind Method >
method_bind<Method> method_(metadata_map metadata = {}) {
method_bind<Method> bind_(metadata_map metadata = {}) {
return method_bind<Method>{std::move(metadata)};
}

template < nullptr_kind Nullptr >
nullptr_bind<Nullptr> nullptr_(metadata_map metadata = {}) {
nullptr_bind<Nullptr> bind_(metadata_map metadata = {}) {
return nullptr_bind<Nullptr>{std::move(metadata)};
}

template < number_kind Number >
number_bind<Number> number_(metadata_map metadata = {}) {
number_bind<Number> bind_(metadata_map metadata = {}) {
return number_bind<Number>{std::move(metadata)};
}

template < pointer_kind Pointer >
pointer_bind<Pointer> pointer_(metadata_map metadata = {}) {
pointer_bind<Pointer> bind_(metadata_map metadata = {}) {
return pointer_bind<Pointer>{std::move(metadata)};
}

template < reference_kind Reference >
reference_bind<Reference> reference_(metadata_map metadata = {}) {
reference_bind<Reference> bind_(metadata_map metadata = {}) {
return reference_bind<Reference>{std::move(metadata)};
}

template < void_kind Void >
void_bind<Void> void_(metadata_map metadata = {}) {
void_bind<Void> bind_(metadata_map metadata = {}) {
return void_bind<Void>{std::move(metadata)};
}
}

namespace meta_hpp
{
template < array_kind Array >
array_bind<Array> array_(metadata_map metadata = {}) {
return bind_<Array>(std::move(metadata));
}

template < class_kind Class >
class_bind<Class> class_(metadata_map metadata = {}) {
return bind_<Class>(std::move(metadata));
}

template < enum_kind Enum >
enum_bind<Enum> enum_(metadata_map metadata = {}) {
return bind_<Enum>(std::move(metadata));
}

template < function_kind Function >
function_bind<Function> function_(metadata_map metadata = {}) {
return bind_<Function>(std::move(metadata));
}

template < member_pointer_kind Member >
member_bind<Member> member_(metadata_map metadata = {}) {
return bind_<Member>(std::move(metadata));
}

template < method_pointer_kind Method >
method_bind<Method> method_(metadata_map metadata = {}) {
return bind_<Method>(std::move(metadata));
}

template < nullptr_kind Nullptr >
nullptr_bind<Nullptr> nullptr_(metadata_map metadata = {}) {
return bind_<Nullptr>(std::move(metadata));
}

template < number_kind Number >
number_bind<Number> number_(metadata_map metadata = {}) {
return bind_<Number>(std::move(metadata));
}

template < pointer_kind Pointer >
pointer_bind<Pointer> pointer_(metadata_map metadata = {}) {
return bind_<Pointer>(std::move(metadata));
}

template < reference_kind Reference >
reference_bind<Reference> reference_(metadata_map metadata = {}) {
return bind_<Reference>(std::move(metadata));
}

template < void_kind Void >
void_bind<Void> void_(metadata_map metadata = {}) {
return bind_<Void>(std::move(metadata));
}
}

namespace meta_hpp
{
inline scope_bind local_scope_(std::string name, metadata_map metadata = {}) {
Expand Down
1 change: 1 addition & 0 deletions manuals/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

| | |
| --------------------------------------------- | ------------- |
| [bind_](./api/binds.md#bind_) | bind_ |
| [array_](./api/binds.md#array_) | array_ |
| [class_](./api/binds.md#class_) | class_ |
| [enum_](./api/binds.md#enum_) | enum_ |
Expand Down
8 changes: 8 additions & 0 deletions manuals/api/binds.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [arguments\_bind](#arguments_bind)
- [metadata\_bind](#metadata_bind)
- [Functions](#functions)
- [bind\_](#bind_)
- [array\_](#array_)
- [class\_](#class_)
- [enum\_](#enum_)
Expand Down Expand Up @@ -242,6 +243,13 @@ public:

## Functions

### bind_

```cpp
template < typename T >
auto bind_(metadata_map metadata = {});
```
### array_
```cpp
Expand Down

0 comments on commit a2f428b

Please sign in to comment.