alpaqa 1.0.0a13
Nonconvex constrained optimization
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
BasicVTable Struct Reference

#include <alpaqa/util/type-erasure.hpp>

Detailed Description

Struct that stores the size of a polymorphic object, as well as pointers to functions to copy, move or destroy the object.

Inherit from this struct to add useful functions.

Definition at line 56 of file type-erasure.hpp.

+ Inheritance diagram for BasicVTable:
+ Collaboration diagram for BasicVTable:

Classes

struct  optional_const_function
 
struct  optional_const_function< R(Args...), VTable >
 
struct  optional_function
 
struct  optional_function< R(Args...), VTable >
 
struct  required_const_function
 
struct  required_const_function< R(Args...)>
 
struct  required_function
 
struct  required_function< R(Args...)>
 

Public Types

template<class F >
using required_function_t = typename required_function< F >::type
 A required function includes a void pointer to self, in addition to the arguments of F.
 
template<class F >
using required_const_function_t = typename required_const_function< F >::type
 A required function includes a void pointer to self, in addition to the arguments of F.
 
template<class F , class VTable = BasicVTable>
using optional_function_t = typename optional_function< F, VTable >::type
 An optional function includes a void pointer to self, the arguments of F, and an additional reference to the VTable, so that it can be implemented in terms of other functions.
 
template<class F , class VTable = BasicVTable>
using optional_const_function_t = typename optional_const_function< F, VTable >::type
 An optional function includes a void pointer to self, the arguments of F, and an additional reference to the VTable, so that it can be implemented in terms of other functions.
 

Public Member Functions

 BasicVTable ()=default
 
template<class T >
 BasicVTable (std::in_place_t, T &) noexcept
 

Public Attributes

required_const_function_t< void(void *storage)> copy = nullptr
 Copy-construct a new instance into storage.
 
required_function_t< void(void *storage)> move = nullptr
 Move-construct a new instance into storage.
 
required_function_t< void()> destroy = nullptr
 Destruct the given instance.
 
const std::type_info * type = &typeid(void)
 The original type of the stored object.
 

Class Documentation

◆ alpaqa::util::BasicVTable::optional_const_function

struct alpaqa::util::BasicVTable::optional_const_function
+ Collaboration diagram for BasicVTable::optional_const_function< class, VTable >:

◆ alpaqa::util::BasicVTable::optional_function

struct alpaqa::util::BasicVTable::optional_function
+ Collaboration diagram for BasicVTable::optional_function< class, VTable >:

◆ alpaqa::util::BasicVTable::required_const_function

struct alpaqa::util::BasicVTable::required_const_function
+ Collaboration diagram for BasicVTable::required_const_function< class >:

◆ alpaqa::util::BasicVTable::required_function

struct alpaqa::util::BasicVTable::required_function
+ Collaboration diagram for BasicVTable::required_function< class >:

Member Typedef Documentation

◆ required_function_t

A required function includes a void pointer to self, in addition to the arguments of F.

Definition at line 85 of file type-erasure.hpp.

◆ required_const_function_t

A required function includes a void pointer to self, in addition to the arguments of F.

For const-qualified member functions.

Definition at line 89 of file type-erasure.hpp.

◆ optional_function_t

template<class F , class VTable = BasicVTable>
using optional_function_t = typename optional_function<F, VTable>::type

An optional function includes a void pointer to self, the arguments of F, and an additional reference to the VTable, so that it can be implemented in terms of other functions.

Definition at line 94 of file type-erasure.hpp.

◆ optional_const_function_t

template<class F , class VTable = BasicVTable>
using optional_const_function_t = typename optional_const_function<F, VTable>::type

An optional function includes a void pointer to self, the arguments of F, and an additional reference to the VTable, so that it can be implemented in terms of other functions.

For const-qualified member functions.

Definition at line 98 of file type-erasure.hpp.

Constructor & Destructor Documentation

◆ BasicVTable() [1/2]

BasicVTable ( )
default

◆ BasicVTable() [2/2]

template<class T >
BasicVTable ( std::in_place_t  ,
T  
)
inlinenoexcept

Definition at line 113 of file type-erasure.hpp.

Member Data Documentation

◆ copy

Copy-construct a new instance into storage.

Definition at line 102 of file type-erasure.hpp.

◆ move

required_function_t<void(void *storage)> move = nullptr

Move-construct a new instance into storage.

Definition at line 104 of file type-erasure.hpp.

◆ destroy

Destruct the given instance.

Definition at line 106 of file type-erasure.hpp.

◆ type

const std::type_info* type = &typeid(void)

The original type of the stored object.

Definition at line 108 of file type-erasure.hpp.


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