Go to the documentation of this file. 1 #ifndef OALPLUS_ALUT_API_API_HPP
9 #define OALPLUS_ALUT_API_API_HPP
11 #include "../al_api/object_name.hpp"
19 #define OALPAFP(FUNC) decltype(c_api::FUNC), &c_api::FUNC
25 template <
typename ApiTraits>
29 using api_traits = ApiTraits;
35 struct derived_func : derived_c_api_function<c_api, api_traits, nothing_t> {
36 using base = derived_c_api_function<c_api, api_traits, nothing_t>;
39 template <
typename Res>
40 constexpr
auto _check(Res&& res)
const noexcept {
41 res.error_code(this->api().
GetError());
42 return std::forward<Res>(res);
46 template <
typename W, W c_api::*F,
typename Signature =
typename W::signature>
49 template <
typename W, W
c_api::*F,
typename RVC,
typename... Params>
50 class func<W, F, RVC(Params...)>
51 :
public wrapped_c_api_function<c_api, api_traits, nothing_t, W, F> {
52 using base = wrapped_c_api_function<c_api, api_traits, nothing_t, W, F>;
55 template <
typename Res>
56 constexpr
auto _check(Res&& res)
const noexcept {
57 res.error_code(this->api().
GetError());
58 return std::forward<Res>(res);
62 template <
typename... Args>
63 constexpr
auto _chkcall(Args&&... args)
const noexcept {
64 return this->_check(this->_call(std::forward<Args>(args)...));
72 constexpr
auto operator()(Params... params)
const noexcept {
73 return this->_chkcall(_conv(params)...)
79 func<OALPAFP(
Init)> init;
83 create_buffer_hello_world;
86 struct : func<OALPAFP(
Exit)> {
87 using base = func<OALPAFP(
Exit)>;
89 using base::operator();
91 auto raii() noexcept {
103 #endif // OALPLUS_ALUT_API_API_HPP
alut_api_function< bool_type(int *, char **), nullptr > Init
Definition: c_api.hpp:104
alut_api_function< enum_type(), nullptr > GetError
Definition: c_api.hpp:92
alut_api_function< bool_type(), nullptr > Exit
Definition: c_api.hpp:141
static auto finally(Func func) -> func_on_scope_exit< Func >
Function constructing on-scope-exit actions.
Definition: scope_exit.hpp:144
al_types::enum_type enum_type
Enum type.
Definition: config.hpp:40
Class wrapping the C-functions from the ALUT API.
Definition: c_api.hpp:31
alut_api_function< name_type(), nullptr > CreateBufferHelloWorld
Definition: c_api.hpp:130
Owning wrapper for C-API opaque handle types.
Definition: handle.hpp:98
Template type used mostly for function type-tag dispatching.
Definition: type_identity.hpp:19
al_types::char_type char_type
String character type.
Definition: config.hpp:37
AL-related code is placed in this namespace.
Definition: oalplus.hpp:11
Class wrapping the functions from the ALUT API.
Definition: api.hpp:26