Go to the documentation of this file.
9 #ifndef EAGINE_ALL_ARE_SAME_HPP
10 #define EAGINE_ALL_ARE_SAME_HPP
12 #include <type_traits>
17 template <
typename T,
typename... P>
18 using all_are_same = std::conjunction<std::true_type, std::is_same<T, P>...>;
20 template <
typename T,
typename... P>
21 using all_are_same_t =
typename all_are_same<T, P...>::type;
23 template <
typename T,
typename... P>
24 constexpr
bool all_are_same_v = all_are_same<T, P...>::value;
27 template <
typename T,
typename... P>
28 using all_are_derived_from =
29 std::conjunction<std::true_type, std::is_base_of<T, P>...>;
31 template <
typename T,
typename... P>
32 using all_are_derived_from_t =
typename all_are_derived_from<T, P...>::type;
34 template <
typename T,
typename... P>
35 constexpr
bool all_are_derived_from_v = all_are_derived_from<T, P...>::value;
38 template <
typename T,
typename... P>
39 using all_are_convertible_to =
40 std::conjunction<std::true_type, std::is_convertible<P, T>...>;
42 template <
typename T,
typename... P>
43 using all_are_convertible_to_t =
typename all_are_convertible_to<T, P...>::type;
45 template <
typename T,
typename... P>
46 constexpr
bool all_are_convertible_to_v =
47 all_are_convertible_to<T, P...>::value;
51 #endif // EAGINE_ALL_ARE_SAME_HPP
@ string_type
string value type.
blob_manipulator::filter_function blob_filter_function
Alias for blob message type filter callable reference.
Definition: endpoint.hpp:47
const main_ctx_object_parent_info & main_ctx_parent
Alias for main_ctx_object_parent_info parameter type.
Definition: main_ctx_fwd.hpp:24
auto to_unit_spherical(vector< T, 3, V > v) noexcept -> unit_spherical_coordinate< T, V >
Converts cartesian vector to unit spherical coordinate.
Definition: coordinates.hpp:65
std::ptrdiff_t span_size_t
Signed span size type used by eagine.
Definition: types.hpp:36
Class for a single-instance object providing useful information ans services.
Definition: main_ctx.hpp:45
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
static auto translate(std::shared_ptr< generator > gen, std::array< float, 3 > d) noexcept
Constructs instances of translated_gen modifier.
Definition: translated.hpp:41
static constexpr auto as_bytes(basic_span< T, P, S > spn) noexcept -> basic_block< std::is_const_v< T >>
Converts a span into a basic_block.
Definition: block.hpp:39
@ host_id
The host identifier has appeared or changed.
void announce_subscriptions() const
Sends messages to the bus saying which messages this can handle.
Definition: subscriber.hpp:438
static auto unit_torus(vertex_attrib_bits attr_bits, valid_if_greater_than< int, 4 > rings, valid_if_greater_than< int, 3 > sections, valid_if_ge0_lt1< float > radius_ratio)
Constructs instances of unit_torus_gen.
Definition: torus.hpp:110
#define EAGINE_ID(NAME)
Macro for constructing instances of eagine::identifier.
Definition: identifier.hpp:353
prog_var_location< EAGINE_ID_V(Uniform)> uniform_location
Alias for shader program uniform location wrapper.
Definition: prog_var_loc.hpp:115
gl_object_name< renderbuffer_tag > renderbuffer_name
Alias for GL renderbuffer object handle.
Definition: object_name.hpp:138
auto distance() const noexcept
Returns the distance between the current and the previous revisions.
Definition: value_with_history.hpp:210
static constexpr auto span_size(T v) noexcept
Converts argument to span size type.
Definition: types.hpp:59
static auto is_sorted(basic_span< T, P, S > spn) -> bool
Tests if the elements in a span are sorted.
Definition: span_algo.hpp:668
bitfield< verification_bit > verification_bits
Alias for a bus message verification bitfield.
Definition: verification.hpp:47
opt_c_api_constant< mp_list< buffer_clear_bit, buffer_blit_bit >, bitfield_type_i > depth_buffer_bit
Definition: constants.hpp:6149
EGL-related code is placed in this namespace.
Definition: eglplus.hpp:11
#define EAGINE_MSG_MAP(CLASS_ID, METHOD_ID, CLASS, METHOD)
Constructs an instance of static message handler map.
Definition: handler_map.hpp:72
Common code is placed in this namespace.
Definition: eagine.hpp:21
auto value() const noexcept
Returns the current revision of the value.
Definition: value_with_history.hpp:165
tvec< gl_types::float_type, 4 > vec4
Alias for a 4D vector type.
Definition: vector.hpp:36
#define EAGINE_MSG_ID(API, NAME)
Macro for instantiating objects of static_message_id.
Definition: message_id.hpp:148
@ byte_type
Byte/BLOB value type.
static auto either_or(valid_if< T, P > vi, F f) noexcept(noexcept(valid_if< T, P >(std::declval< valid_if< T, P > && >())) &&noexcept(F(std::declval< F && >()))) -> valid_if_or_fallback< T, P, F >
Constructor function for valid_if_or_fallback.
Definition: decl.hpp:290
static auto make_index(basic_span< T, P, S > spn, basic_span< I, PI, SI > idx, Compare compare) -> bool
Makes the index of a span according to compare, into another span.
Definition: span_algo.hpp:641
static constexpr auto cover(T *addr, S size) noexcept -> span_if_mutable< T >
Creates a span starting at the specified pointer and specified length.
Definition: span.hpp:465
static constexpr auto extract(api_result_value< Result, api_result_validity::never > &) noexcept -> Result &
Overload of extract for api_result_value.
Definition: c_api_wrap.hpp:270
basic_block< true > const_block
Alias for const byte memory span.
Definition: block.hpp:32
convertible_matrix_constructor< rotation_x< matrix< T, 4, 4, true, V > >> matrix_rotation_x
Alias for constructor of rotation along x-axis transformation matrix.
Definition: matrix_rotation.hpp:124
@ local_interprocess
Inter-process connection for local communication.
@ info
Informational log entries.
opt_c_api_constant< mp_list< string_query >, enum_type_i > shading_language_version
Definition: constants.hpp:6093
auto log_trace(string_view format) noexcept
Create a log message entry for tracing, with specified format.
Definition: logger.hpp:347
Class holding information about the topology of a generated shape.
Definition: topology.hpp:157
auto log_chart_sample(identifier series, float value) noexcept -> named_logging_object &
Stores a new value in the specified chart data series.
Definition: logger.hpp:372
auto update() const noexcept -> bool
Updates the internal endpoint state (should be called repeatedly).
Definition: subscriber.hpp:51
static constexpr auto view(T *addr, S size) noexcept -> const_span< T >
Creates a view starting at the specified pointer and specified length.
Definition: span.hpp:458
static constexpr auto head(basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S >
Returns the first l elements from the front of a span.
Definition: span_algo.hpp:99
auto find(string_view what) const noexcept -> program_arg
Finds and returns the argument with the specified value.
Definition: program_args.hpp:1175
@ in_process
In-process connection (cannot be used for inter-process communication).
auto from_filesystem_path(string_view root_path, main_ctx_parent, std::shared_ptr< file_compound_factory >={}) -> compound
Creates a compound representing a filesystem subtree.
main_ctx_object(identifier obj_id, main_ctx_parent parent) noexcept
Initialization from object id and parent.
Definition: main_ctx_object.hpp:77
Installs handlers for interrupt signals and flips switch on receipt.
Definition: signal_switch.hpp:23
static auto unit_sphere(vertex_attrib_bits attr_bits, valid_if_greater_than< int, 2 > rings, valid_if_greater_than< int, 3 > sections)
Constructs instances of unit_sphere_gen.
Definition: sphere.hpp:89
auto delta() const noexcept
Returns the difference between the current and the previous revision.
Definition: value_with_history.hpp:195
auto bus() noexcept -> endpoint &
Returns a reference to the associated endpoint.
Definition: actor.hpp:45
std::uint32_t host_id_t
Unique host identifier type.
Definition: identifier_t.hpp:25
Definition: 005_path_nv_text.cpp:19
constexpr static const indeterminate_t indeterminate
Constant representing unspecified tribool value.
Definition: tribool.hpp:24
static auto find(basic_span< T1, P1, S1 > where, basic_span< T2, P2, S2 > what) -> basic_span< T1, P1, S1 >
Finds the position of the last occurrence of what in a span.
Definition: span_algo.hpp:374
@ position
Vertex position.
@ remote_interprocess
Inter-process connection for remote communucation.
static constexpr auto nearest_line_sphere_intersection(const line< T, V > &ray, const sphere< T, V > &sph) noexcept -> optionally_valid< vector< T, 3, V >>
Finds nearest line-sphere intersection point.
Definition: intersection.hpp:148
static auto shuffle(basic_span< T, P, S > spn, RandGen rg) -> basic_span< T, P, S >
Shuffles the elements of a span.
Definition: span_algo.hpp:596
static auto unit_cube(vertex_attrib_bits attr_bits)
Constructs instances of unit_cube_gen.
Definition: cube.hpp:92
Basic class storing paths made of string elements.
Definition: string_path.hpp:27
deserialization_error_code
Deserialization error code bits enumeration.
Definition: result.hpp:53
gl_object_name< texture_tag > texture_name
Alias for GL texture object handle.
Definition: object_name.hpp:153
auto log_stat(string_view format) noexcept
Create a log message entry for statistic, with specified format.
Definition: logger.hpp:335
convertible_matrix_constructor< perspective< matrix< T, 4, 4, true, V > >> matrix_perspective
Alias for constructor of perspective projection matrix.
Definition: matrix_perspective.hpp:177
auto log_info(string_view format) noexcept
Create a log message entry for information, with specified format.
Definition: logger.hpp:329
serialization_error_code
Serialization error code bits enumeration.
Definition: result.hpp:24
static constexpr auto unit() noexcept -> U
Returns the unit.
Definition: tagged_quantity.hpp:74
Non-owning wrapper for C-API opaque handle types.
Definition: handle.hpp:26
auto deserialize(T &value, Backend &backend) -> std::enable_if_t< std::is_base_of_v< deserializer_backend, Backend >, deserialization_errors >
Deserializes a value with the specified serialization backend.
Definition: read.hpp:475
Class for read-only values with history.
Definition: value_with_history.hpp:141
static auto reverse(basic_span< T, P, S > spn) -> basic_span< T, P, S >
Reverses the elements in a span.
Definition: span_algo.hpp:561
opt_c_api_constant< mp_list< integer_query >, enum_type_i > minor_version
Definition: constants.hpp:5111
Tri-state boolean value.
Definition: tribool.hpp:61
convertible_matrix_constructor< translation< matrix< T, 4, 4, true, V > >> matrix_translation
Alias for constructor of uniform translation transformation matrix.
Definition: matrix_translation.hpp:95
gl_object_name< framebuffer_tag > framebuffer_name
Alias for GL framebuffer object handle.
Definition: object_name.hpp:118
static constexpr auto seconds_(T value) noexcept -> seconds_t< T >
Creates a tagged quantity storing value in seconds.
Definition: quantities.hpp:33
opt_c_api_constant< mp_list< integer_query >, enum_type_i > major_version
Definition: constants.hpp:5100
Weak tri-state boolean value.
Definition: tribool.hpp:31
Reallocatable owning byte buffer.
Definition: buffer.hpp:22
basic_alc_api< alc_api_traits > alc_api
Alias for the default instantation of basic_alc_api.
Definition: alc_api_fwd.hpp:20
basic_address< false > address
Type alias for non-const memory address values.
Definition: address.hpp:203
static auto format(std::string &&fmt_str) noexcept -> format_string_and_list< 0 >
Function taking a format string, returning an object for variable specification.
Definition: str_format.hpp:118
static constexpr auto radians_(T value) noexcept -> radians_t< T >
Creates a tagged quantity storing value in radians.
Definition: quantities.hpp:50
opt_c_api_constant< mp_list< string_query >, enum_type_i > version
Definition: constants.hpp:6082
static constexpr auto std_size(T v) noexcept
Converts argument to std size type.
Definition: types.hpp:52
Value typically wrapping function call result and success indicator.
Definition: extract.hpp:128
Class for encoding byte blocks into hexdump-like format.
Definition: hexdump.hpp:29
#define EAGINE_TAG(NAME)
Macro for defining selector values corresponding to identifier NAME.
Definition: identifier.hpp:375
std::uint32_t message_sequence_t
Alias for message sequence number type.
Definition: types.hpp:22
@ maybe
Result is conditionally valid.
static constexpr auto skip(basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S >
Skips a specified count of elements from the front of a span.
Definition: span_algo.hpp:60
prog_var_location< EAGINE_ID_V(VertexAttr)> vertex_attrib_location
Alias for program vertex attribute location wrapper.
Definition: prog_var_loc.hpp:104
auto serialize(T &value, Backend &backend) -> std::enable_if_t< std::is_base_of_v< serializer_backend, Backend >, serialization_errors >
Serializes a value with the specified serialization backend.
Definition: write.hpp:480
unsigned char byte
Byte type alias.
Definition: types.hpp:24
static constexpr auto turns_(T value) noexcept
Creates a tagged quantity in full turn units.
Definition: quantities.hpp:82
static auto finally(Func func) -> func_on_scope_exit< Func >
Function constructing on-scope-exit actions.
Definition: scope_exit.hpp:144
Callable class that interleaves calls to a function with a separator function.
Definition: interleaved_call.hpp:20
static constexpr auto ratio(T a, T b) noexcept -> optionally_valid< T >
Returns a divided by b if b is not zero.
Definition: functions.hpp:75
bitfield< deserialization_error_code > deserialization_errors
Alias for deserialization error bitfield.
Definition: result.hpp:106
basic_line< T, 3, V > line
Alias for lines in 3D space.
Definition: primitives.hpp:52
convertible_matrix_constructor< rotation_z< matrix< T, 4, 4, true, V > >> matrix_rotation_z
Alias for constructor of rotation along z-axis transformation matrix.
Definition: matrix_rotation.hpp:152
static auto generate(basic_span< T, P, S > spn, Generator gen) -> basic_span< T, P, S >
Fills a span with elements generated by a generator callable.
Definition: span_algo.hpp:584
static auto unit_icosahedron(vertex_attrib_bits attr_bits)
Constructs instances of unit_icosahedron_gen.
Definition: icosahedron.hpp:71
auto old_value() const noexcept
Returns the previous revision of the value.
Definition: value_with_history.hpp:172
basic_egl_api< egl_api_traits > egl_api
Alias for the default instantation of basic_egl_api.
Definition: egl_api_fwd.hpp:20
auto deltas() const noexcept
Returns the differences between the adjacent revisions.
Definition: value_with_history.hpp:200
static constexpr auto maximum(T a, T b) noexcept
Returns the maximum value of a and b.
Definition: functions.hpp:61
Class wrapping the main function arguments, providing a convenient API.
Definition: program_args.hpp:1082
basic_alut_api< alut_api_traits > alut_api
Alias for the default instantation of basic_alut_api.
Definition: alut_api_fwd.hpp:20
void object_description(string_view display_name, string_view description) noexcept
Sets the human-readable name and description of this object.
Definition: logger.hpp:303
@ message
Message protocol.
static constexpr auto running_on_valgrind() noexcept -> tribool
Indicates if the current process runs on top of valgrind.
Definition: valgrind.hpp:30
opt_c_api_constant< mp_list< string_query >, enum_type_i > renderer
Definition: constants.hpp:6071
vertex_attrib_kind
Shape vertex attribute kind enumeration.
Definition: vertex_attrib.hpp:25
basic_al_api< al_api_traits > al_api
Alias for the default instantation of basic_al_api.
Definition: al_api_fwd.hpp:20
static auto get_attrib_bits(const vertex_attrib_variants< N > &vaals) noexcept -> vertex_attrib_bits
Extracts vertex attribute kind bits from and vertex attribute variants array.
Definition: vertex_attrib.hpp:245
static auto zero(basic_span< T, P, S > spn) -> std::enable_if_t< std::is_integral_v< T >||std::is_floating_point_v< T >, basic_span< T, P, S >>
Fills a span with zero value of type T.
Definition: span_algo.hpp:548
auto process_all() -> span_size_t
Handles (and removes) all poending received messages.
Definition: subscriber.hpp:430
static constexpr auto right_angles_(T value) noexcept
Creates a tagged quantity in units of right angle.
Definition: quantities.hpp:61
auto from_json_text(string_view, main_ctx_parent) -> compound
Creates a compound from a JSON text string view.
constexpr auto value() const noexcept -> T
Returns the value.
Definition: tagged_quantity.hpp:69
tvec< gl_types::float_type, 3 > vec3
Alias for a 3D vector type.
Definition: vector.hpp:32
auto operator=(static_subscriber &&)=delete
Not move assignable.
Combined wrapper for the GL API operations and constants.
Definition: basic_gl_api.hpp:27
std::uint64_t identifier_t
The underlying integer type for eagine::identifier.
Definition: identifier_t.hpp:19
static constexpr auto degrees_(T value) noexcept -> degrees_t< T >
Creates a tagged quantity storing value in degrees.
Definition: quantities.hpp:183
@ normal
Normal compression level.
Template type used mostly for function type-tag dispatching.
Definition: type_identity.hpp:19
#define EAGINE_LONG_ID(NAME)
Macro for constructing instances of eagine::long_identifier.
Definition: identifier.hpp:393
AL-related code is placed in this namespace.
Definition: oalplus.hpp:11
integer_range(B, E) -> integer_range< std::common_type_t< B, E >>
Deduction guide for integer_range.
auto byte_to_identifier(byte b) noexcept -> identifier
Creates an identifier representing a byte value as a hex string.
convertible_matrix_constructor< rotation_y< matrix< T, 4, 4, true, V > >> matrix_rotation_y
Alias for constructor of rotation along y-axis transformation matrix.
Definition: matrix_rotation.hpp:138
opt_c_api_constant< mp_list< string_query >, enum_type_i > vendor
Definition: constants.hpp:6060
auto bus() noexcept -> auto &
Returns a reference to the associated endpoint.
Definition: subscriber.hpp:38
static auto get_environment_variable(string_view variable_name) noexcept -> optionally_valid< string_view >
Returns the value in the specified environment variable.
Definition: environment.hpp:21
#define EAGINE_TAG_TYPE(NAME)
Macro for defining selector types corresponding to identifier NAME.
Definition: identifier.hpp:367
opt_c_api_constant< mp_list< buffer_clear_bit, buffer_blit_bit >, bitfield_type_i > color_buffer_bit
Definition: constants.hpp:6138
Class for mutable variables with history.
Definition: value_with_history.hpp:291
static auto embed(identifier res_id, string_view src_path) noexcept -> embedded_resource
Triggers the embedding of data from a file on the specified path.
Definition: embed.hpp:105
auto operations() noexcept -> basic_gl_operations< ApiTraits > &
Returns a reference to the wrapped operations.
Definition: basic_gl_api.hpp:52
auto from_yaml_text(string_view, main_ctx_parent) -> compound
Creates a compound from a YAML text string view.
identifier app_id
The application root logger identifier.
Definition: main_ctx.hpp:30
static void apply(byte_getter get_byte, char_putter put_char)
Uses get_byte to read input bytes, encodes them and calls put_char.
@ router
Message bus router.
@ message_id
The message type id has been verified.
Value of type T with a specified unit or tag type U.
Definition: tagged_quantity.hpp:27
callable_ref< bool(compound &, const attribute &, const basic_string_path &)> visit_handler
Type of traverse/visit handler.
Definition: wrappers.hpp:709
bitfield< serialization_error_code > serialization_errors
Alias for serialization error bitfield.
Definition: result.hpp:100
static constexpr auto right_angle_() noexcept
Creates a tagged quantity a right angle value.
Definition: quantities.hpp:71
Structure storing customization options for main context.
Definition: main_ctx.hpp:24
basic_identifier< 10, 6, default_identifier_char_set, identifier_t > identifier
Default identifier type used throughout the project.
Definition: identifier.hpp:346
static constexpr nothing_t nothing
Constant of nothing_t type.
Definition: nothing.hpp:30