OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::basic_handle< Tag, Handle, invalid > Class Template Reference

Non-owning wrapper for C-API opaque handle types. More...

#include <eagine/handle.hpp>

Public Types

using tag_type = Tag
 Alias for the tag type.
 
using handle_type = Handle
 Alias for the underlying handle type.
 

Public Member Functions

constexpr basic_handle () noexcept=default
 Default constructor. More...
 
constexpr basic_handle (basic_handle &&tmp) noexcept
 Move constructor.
 
auto operator= (basic_handle &&tmp) noexcept -> auto &
 Move assignment operator.
 
constexpr basic_handle (const basic_handle &) noexcept=default
 Copy constructor.
 
auto operator= (const basic_handle &) noexcept -> basic_handle &=default
 Copy assignment operator.
 
constexpr basic_handle (Handle name) noexcept
 Construction from the underlying handle type.
 
constexpr auto is_valid () const noexcept -> bool
 Indicates if this instance contains a valid handle.
 
constexpr operator bool () const noexcept
 Indicates if this instance contains a valid handle. More...
 
constexpr operator Handle () const noexcept
 Explicit conversion to the underlying handle type.
 

Detailed Description

template<typename Tag, typename Handle, Handle invalid = ~Handle(0)>
class eagine::basic_handle< Tag, Handle, invalid >

Non-owning wrapper for C-API opaque handle types.

Template Parameters
Tagtype distinguisihing various handler with the same underlying type.
Handlethe underlying handle type.
invalidthe invalid value for this particular handle type.
See also
basic_owned_handle
Examples
oalplus/005_hello_world.cpp.

Constructor & Destructor Documentation

◆ basic_handle()

template<typename Tag , typename Handle , Handle invalid = ~Handle(0)>
constexpr eagine::basic_handle< Tag, Handle, invalid >::basic_handle ( )
constexprdefaultnoexcept

Default constructor.

Postcondition
!is_valid()

Member Function Documentation

◆ operator bool()

template<typename Tag , typename Handle , Handle invalid = ~Handle(0)>
constexpr eagine::basic_handle< Tag, Handle, invalid >::operator bool ( ) const
inlineexplicitconstexprnoexcept

Indicates if this instance contains a valid handle.

See also
is_valid

The documentation for this class was generated from the following file:

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).