template<typename
Interface, typename Transform = identity_member>
class fc::api< Interface, Transform >
Definition at line 67 of file api.hpp.
template<typename
Interface , typename Transform >
It is slightly unclean tight coupling to have this method in the api class. It breaks encapsulation by requiring an api class method to have a pointer to an api_connection. The reason this is necessary is we have a goal of being able to call register_api() on an api<T> through its base class api_base. But register_api() must know the template parameters!
The only reasonable way to achieve the goal is to implement register_api() as a method in api<T> (which obviously knows the template parameter T), then make the implementation accessible through the base class (by making it a pure virtual method in the base class which is overridden by the subclass's implementation).
It is slightly unclean tight coupling to have this method in the api class. It breaks encapsulation by requiring an api class method to have a pointer to an binary_api_connection. The reason this is necessary is we have a goal of being able to call register_api() on an api<T> through its base class api_base. But register_api() must know the template parameters!
The only reasonable way to achieve the goal is to implement register_api() as a method in api<T> (which obviously knows the template parameter T), then make the implementation accessible through the base class (by making it a pure virtual method in the base class which is overridden by the subclass's implementation).
Implements fc::api_base.
Definition at line 459 of file api_connection.hpp.
460 {
461 return conn.register_api( *this );
462 }