OSVR-Core
Classes | Namespaces | Macros | Typedefs | Functions
SizedInt.h File Reference

Header providing an integer type by size. More...

#include <cstdint>
#include <cstddef>

Go to the source code of this file.

Classes

struct  osvr::util::detail::sized_int< bytes, isSigned >
 Case for non-exact sizes, incrementing by one byte if we haven't skipped right over the error case already. More...
 
struct  osvr::util::detail::sized_int< ERROR_SPECIALIZATION_SIZE, isSigned >
 Case to catch those who exceed the max size. More...
 
struct  osvr::util::detail::sized_int< bytes, isSigned >
 Case for non-exact sizes, incrementing by one byte if we haven't skipped right over the error case already. More...
 

Namespaces

 osvr
 The main namespace for all C++ elements of the framework, internal and external.
 
 osvr::util
 The Util library: Functionality not necessarily coupled to any particular core library, serving more as a common base layer behind all systems.
 

Macros

#define OSVR_INT_TRAITS(BITS)
 Set up specializations for the standard int types. More...
 

Typedefs

template<std::size_t minBytes, bool isSigned = false>
using osvr::util::sized_int_t = typename detail::sized_int< minBytes, isSigned >::type
 Alias providing an integer type (signed or unsigned, your choice) containing at least as many bytes as you requested. More...
 

Functions

 osvr::util::detail::OSVR_INT_TRAITS (8)
 
 osvr::util::detail::OSVR_INT_TRAITS (16)
 
 osvr::util::detail::OSVR_INT_TRAITS (32)
 
 osvr::util::detail::OSVR_INT_TRAITS (64)
 

Detailed Description

Header providing an integer type by size.

Date
2016
Author
Sensics, Inc. http://sensics.com/osvr

Macro Definition Documentation

§ OSVR_INT_TRAITS

#define OSVR_INT_TRAITS (   BITS)
Value:
template <> struct sized_int<sizeof(std::int##BITS##_t), true> { \
using type = std::int##BITS##_t; \
}; \
template <> struct sized_int<sizeof(std::uint##BITS##_t), false> { \
using type = std::uint##BITS##_t; \
}
Definition: TypeSafeIdHash.h:44

Set up specializations for the standard int types.