mn_def.hpp File Reference
#include "mn_config.hpp"
#include <stddef.h>
#include <stdint.h>
#include <time.h>
#include <sys/time.h>
#include "mn_copyable.hpp"
#include "mn_void.hpp"

Go to the source code of this file.

Classes

class  mn::null_type
 

Namespaces

 mn
 
 mn::math
 

Macros

#define MNTHREAD_STATIC_CAST_BYTE(BYTE)   static_cast<unsigned char>(BYTE)
 
#define offsetof(TYPE, MEMBER)   __builtin_offsetof (TYPE, MEMBER)
 
#define BitsInType(t)   (sizeof(t) * CHAR_BIT)
 Returns the number of bits in the given type. More...
 
#define BitMask(t, n)   (t(~t(0)) >> (BitsInType(t) - (n)))
 Returns the mask of type t with the lowest n bits set. More...
 

Typedefs

using mn::max_align_t = uintptr_t
 
using mn::nullptr_t = decltype(nullptr)
 
using mn::addrof_null_t = nullptr_t
 
using mn::size_t = MN_THREAD_CONFIG_SIZE_TYPE
 
using mn::ptrdiff_t = long
 
using mn::uptrdiff_t = unsigned long
 
using mn::intmax_t = signed long
 
using mn::uintmax_t = unsigned long
 

Enumerations

enum class  mn::byte : unsigned char
 

Functions

template<typename IntegerType >
byte & mn::operator<<= (byte &b, IntegerType shift) noexcept
 
template<typename IntegerType >
byte & mn::operator>>= (byte &b, IntegerType shift) noexcept
 
template<typename IntegerType >
constexpr byte mn::operator<< (byte &b, IntegerType shift) noexcept
 
template<typename IntegerType >
constexpr byte mn::operator>> (byte &b, IntegerType shift) noexcept
 
constexpr bool mn::operator== (const byte l, const byte r) noexcept
 
constexpr bool mn::operator!= (const byte l, const byte r) noexcept
 
constexpr bool mn::operator< (const byte l, const byte r) noexcept
 
constexpr bool mn::operator<= (const byte l, const byte r) noexcept
 
constexpr bool mn::operator> (const byte l, const byte r) noexcept
 
constexpr bool mn::operator>= (const byte l, const byte r) noexcept
 
byte mn::operator|= (byte &lhr, const byte rhr) noexcept
 
byte mn::operator&= (byte &lhr, const byte rhr) noexcept
 
byte mn::operator^= (byte &lhr, const byte rhr) noexcept
 
constexpr byte mn::operator| (const byte &lhr, const byte &rhr) noexcept
 
constexpr byte mn::operator^ (const byte &lhr, const byte &rhr) noexcept
 
constexpr byte mn::operator& (const byte &lhr, const byte &rhr) noexcept
 
constexpr byte mn::operator~ (byte b) noexcept
 

Variables

const size_t mn::default_alignment = alignof(void*)
 
constexpr size_t mn::max_alignment = alignof(max_align_t)
 
constexpr double mn::math::pi = 3.14159265358979
 
constexpr double mn::math::pi_reciprocal = 0.31830988618379
 
constexpr double mn::math::pi_squared = 9.86960440108936
 
constexpr double mn::math::e = 2.71828182845905
 
constexpr double mn::math::e_reciprocal = 0.36787944117144
 
constexpr double mn::math::e_squared = 7.38905609893065
 
constexpr double mn::math::root2 = 1.41421356237310
 
constexpr double mn::math::root2_reciprocal = 0.70710678118655
 
constexpr double mn::math::euler = 0.57721566490153
 
constexpr double mn::math::golden_ratio = 1.61803398874989
 

Detailed Description

This file is part of the Mini Thread Library (https://github.com/RoseLeBlood/MiniThread ).

Author
Copyright (c) 2021 Amber-Sophia Schroeck
License
The Mini Thread Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 3, or (at your option) any later version.

The Mini Thread Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Mini Thread Library; if not, see https://www.gnu.org/licenses/.


Class Documentation

◆ mn::null_type

class mn::null_type

Macro Definition Documentation

◆ BitMask

#define BitMask (   t,
 
)    (t(~t(0)) >> (BitsInType(t) - (n)))

Returns the mask of type t with the lowest n bits set.

◆ BitsInType

#define BitsInType (   t)    (sizeof(t) * CHAR_BIT)

Returns the number of bits in the given type.

◆ MNTHREAD_STATIC_CAST_BYTE

#define MNTHREAD_STATIC_CAST_BYTE (   BYTE)    static_cast<unsigned char>(BYTE)

◆ offsetof

#define offsetof (   TYPE,
  MEMBER 
)    __builtin_offsetof (TYPE, MEMBER)