codex
Loading...
Searching...
No Matches
codex Namespace Reference

Namespaces

namespace  detail
 
namespace  refl
 

Classes

struct  BaseEvent
 Base class tag to identify events. More...
 
struct  CWrapper
 Wrapper for C-style void* + function pointer pair. More...
 
struct  CWrapper< f >
 Wraps a C-style function taking void* and calls it with T* instead. More...
 
class  EventDispatcher
 A type-safe event listener/dispatcher. More...
 
struct  OnClick
 Sample button click event. More...
 
struct  OnKey
 Sample key press event. More...
 
class  Packet
 Wrapper for a raw byte buffer with methods to extract data from it. More...
 
struct  vec2
 
struct  vec3
 

Concepts

concept  Event
 Semi-arbitrary method to identify an event type.
 
concept  EventListener
 Constrains a callable to an event type.
 
concept  Readable
 Identifies whether a C++ type can be read from a buffer.
 

Typedefs

using ReadResult = bool
 Arbitrary return type which could be replaced with a more detailed type.
 

Enumerations

enum class  Type : uint8_t {
  INVALID , INT , FLOAT , INVALID ,
  INT , FLOAT
}
 Data types that can be read from a buffer. More...
 
enum class  Type : uint8_t {
  INVALID , INT , FLOAT , INVALID ,
  INT , FLOAT
}
 Data types that can be read from a buffer. More...
 

Functions

template<std::permutable I, std::sentinel_for< I > S>
void rotate_rec (I b, I n, S e)
 
template<std::permutable I, std::sentinel_for< I > S>
void rotate (I b, I n, S e)
 
vec3 f (const vec3 &v)
 
vec3 g (const vec3 &v)
 
vec2 rotate (const vec2 &v, float a)
 
vec3 operator* (const vec3 &v, float s)
 
vec3 operator* (float s, const vec3 &v)
 
vec3 operator+ (const vec3 &v0, const vec3 &v1)
 
vec3 operator- (const vec3 &v0, const vec3 &v1)
 
vec3 rotate (const vec3 &v, float sin, float cos, const vec3 &n)
 Rotates v around an arbitrary axis .
 
vec3 rotate_y (const vec3 &v, float sin, float cos)
 Rotates v around the y axis.
 
vec2 rotate (const vec2 &v, float sin, float cos)
 
bool set_benchmark_sizes_from_env (const char *env)
 Calls QTest::newRow for each size/tag pair in the environment variable.
 
template<std::random_access_iterator I, std::sentinel_for< I > S>
lower_bound (I b, S e, const auto &x)
 
template<std::random_access_iterator I, std::sentinel_for< I > S>
bool bsearch (I b, S e, const auto &x)
 
void copy_mutable_lambda (const auto &...ts, std::vector< std::byte > *v)
 memcpyes each ts value into v (using a lambda expression).
 
void copy_function_object (const auto &...ts, std::vector< std::byte > *v)
 memcpyes each ts value into v (using a function object).
 
template<std::input_iterator I, std::sentinel_for< I > S>
constexpr bool is_range (I b, S e)
 
template<std::input_iterator I, std::sentinel_for< I > S>
constexpr I min_element (I b, S e)
 
template<std::permutable I, std::sentinel_for< I > S>
constexpr void selection_sort (I b, S e)
 
std::tuple< int, std::errc > exec (std::span< const char *const > args, std::string *out)
 Executes a command and reads its stdout.
 
std::string_view remove_prefix_tern (std::string_view s, std::string_view p)
 
std::string_view remove_prefix_mul (std::string_view s, std::string_view p)
 
std::string_view remove_prefix_c (std::string_view s, std::string_view p)
 
std::string_view remove_prefix_c_strncmp (std::string_view s, std::string_view p)
 
template<std::permutable I, std::sentinel_for< I > S>
requires std::bidirectional_iterator<I>
void insertion_sort (I b, S e)
 
template<std::input_iterator I, std::sentinel_for< I > S>
void check_range (I b, S e)
 
template<std::forward_iterator I, std::sentinel_for< I > S>
min_element (I b, S e)
 
template<std::permutable I, std::sentinel_for< I > S>
void selection_sort (I b, S e)
 

Variables

constexpr auto BENCHMARK_SIZES_ENV = "CODEX_BENCHMARK_SIZES"
 Environment variable used to override the input sizes in benchmarks.
 
template<typename T >
constexpr Type type_to_enum = Type::INVALID
 Mapping from Type to C++ types.
 
template<>
constexpr Type type_to_enum< int > = Type::INT
 
template<>
constexpr Type type_to_enum< float > = Type::FLOAT
 

Typedef Documentation

◆ ReadResult

typedef bool codex::ReadResult = bool

Arbitrary return type which could be replaced with a more detailed type.

Enumeration Type Documentation

◆ Type [1/2]

enum class codex::Type : uint8_t
strong

Data types that can be read from a buffer.

Enumerator
INVALID 
INT 
FLOAT 
INVALID 
INT 
FLOAT 

◆ Type [2/2]

enum class codex::Type : uint8_t
strong

Data types that can be read from a buffer.

Enumerator
INVALID 
INT 
FLOAT 
INVALID 
INT 
FLOAT 

Function Documentation

◆ bsearch()

template<std::random_access_iterator I, std::sentinel_for< I > S>
bool codex::bsearch ( I b,
S e,
const auto & x )
Here is the call graph for this function:

◆ check_range()

template<std::input_iterator I, std::sentinel_for< I > S>
void codex::check_range ( I b,
S e )
Here is the caller graph for this function:

◆ copy_function_object()

void codex::copy_function_object ( const auto &... ts,
std::vector< std::byte > * v )

memcpyes each ts value into v (using a function object).

Here is the caller graph for this function:

◆ copy_mutable_lambda()

void codex::copy_mutable_lambda ( const auto &... ts,
std::vector< std::byte > * v )

memcpyes each ts value into v (using a lambda expression).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exec()

std::tuple< int, std::errc > codex::exec ( std::span< const char *const > ,
std::string *  )

Executes a command and reads its stdout.

Here is the caller graph for this function:

◆ f()

vec3 codex::f ( const vec3 & v)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ g()

vec3 codex::g ( const vec3 & v)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ insertion_sort()

template<std::permutable I, std::sentinel_for< I > S>
requires std::bidirectional_iterator<I>
void codex::insertion_sort ( I b,
S e )
Here is the caller graph for this function:

◆ is_range()

template<std::input_iterator I, std::sentinel_for< I > S>
bool codex::is_range ( I b,
S e )
constexpr
Here is the caller graph for this function:

◆ lower_bound()

template<std::random_access_iterator I, std::sentinel_for< I > S>
I codex::lower_bound ( I b,
S e,
const auto & x )
Here is the caller graph for this function:

◆ min_element() [1/2]

template<std::input_iterator I, std::sentinel_for< I > S>
I codex::min_element ( I b,
S e )
constexpr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ min_element() [2/2]

template<std::forward_iterator I, std::sentinel_for< I > S>
I codex::min_element ( I b,
S e )
Here is the call graph for this function:

◆ operator*() [1/2]

vec3 codex::operator* ( const vec3 & v,
float s )
inline

◆ operator*() [2/2]

vec3 codex::operator* ( float s,
const vec3 & v )
inline

◆ operator+()

vec3 codex::operator+ ( const vec3 & v0,
const vec3 & v1 )
inline

◆ operator-()

vec3 codex::operator- ( const vec3 & v0,
const vec3 & v1 )
inline

◆ remove_prefix_c()

std::string_view codex::remove_prefix_c ( std::string_view s,
std::string_view p )
inline
Here is the call graph for this function:

◆ remove_prefix_c_strncmp()

std::string_view codex::remove_prefix_c_strncmp ( std::string_view s,
std::string_view p )
inline
Here is the call graph for this function:

◆ remove_prefix_mul()

std::string_view codex::remove_prefix_mul ( std::string_view s,
std::string_view p )
inline
Here is the call graph for this function:

◆ remove_prefix_tern()

std::string_view codex::remove_prefix_tern ( std::string_view s,
std::string_view p )
inline
Here is the call graph for this function:

◆ rotate() [1/4]

vec2 codex::rotate ( const vec2 & v,
float a )

◆ rotate() [2/4]

vec2 codex::rotate ( const vec2 & v,
float sin,
float cos )
inline

◆ rotate() [3/4]

vec3 codex::rotate ( const vec3 & v,
float sin,
float cos,
const vec3 & n )
inline

Rotates v around an arbitrary axis .

Here is the call graph for this function:

◆ rotate() [4/4]

template<std::permutable I, std::sentinel_for< I > S>
void codex::rotate ( I b,
I n,
S e )
Here is the caller graph for this function:

◆ rotate_rec()

template<std::permutable I, std::sentinel_for< I > S>
void codex::rotate_rec ( I b,
I n,
S e )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ rotate_y()

vec3 codex::rotate_y ( const vec3 & v,
float sin,
float cos )
inline

Rotates v around the y axis.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selection_sort() [1/2]

template<std::permutable I, std::sentinel_for< I > S>
void codex::selection_sort ( I b,
S e )
constexpr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ selection_sort() [2/2]

template<std::permutable I, std::sentinel_for< I > S>
void codex::selection_sort ( I b,
S e )
Here is the call graph for this function:

◆ set_benchmark_sizes_from_env()

bool codex::set_benchmark_sizes_from_env ( const char * env)

Calls QTest::newRow for each size/tag pair in the environment variable.

See BENCHMARK_SIZES_ENV for a description of the format. This function must be called from a QTest test data function that has already declared it has a single std::size_t column.

Returns
true if variable contains a valid value and rows were added.
Here is the caller graph for this function:

Variable Documentation

◆ BENCHMARK_SIZES_ENV

auto codex::BENCHMARK_SIZES_ENV = "CODEX_BENCHMARK_SIZES"
constexpr

Environment variable used to override the input sizes in benchmarks.

This variable should contain a comma-separated list of sizes followed by tags, e.g.: 1,tag1,2,tag2,3,tag3.

◆ type_to_enum

template<typename T >
Type codex::type_to_enum = Type::INVALID
constexpr

Mapping from Type to C++ types.

◆ type_to_enum< float >

template<>
Type codex::type_to_enum< float > = Type::FLOAT
constexpr

◆ type_to_enum< int >

template<>
Type codex::type_to_enum< int > = Type::INT
constexpr