-
SIPLASPLAS_ASSERT - When
NDEBUG
is not defined, this macro is defined to instance a cpp::AssertExpression object. Else it instances a cpp::DummyAssertExpression object which does nothing. -
SIPLASPLAS_ASSERT_BE - The assertion success if \p a is bigger or equal to \p b. Fails otherwise. The comparison is done by means of
operator>=(a, b)
. -
SIPLASPLAS_ASSERT_BT - The assertion success if \p a is bigger than \p b. Fails otherwise. The comparison is done by means of
operator>(a, b)
. -
SIPLASPLAS_ASSERT_COMP_IMPL - This macro builds a detailed assertion expression for expressions that compare two values using an specific comparison operator. The resulting diagnostic message is of the form:
-
SIPLASPLAS_ASSERT_EQ - The assertion success if \p a and \p b are equal. Fails otherwise. Equality is tested using
operator==(a, b)
. -
SIPLASPLAS_ASSERT_FALSE - The assertion success if the expression evaluates to false. Fails otherwise.
-
SIPLASPLAS_ASSERT_LE - The assertion success if \p a is less or equal to \p b. Fails otherwise. Comparison is done by means of
operator<=(a, b)
. -
SIPLASPLAS_ASSERT_LT - The assertion success if \p a is less than \p b. Fails otherwise. Comparison is done by means of
operator<(a, b)
. -
SIPLASPLAS_ASSERT_NE - The assertion success if \p a and \p b are not equal. Fails otherwise. Inequality is tested using
operator!=(a, b)
. -
SIPLASPLAS_ASSERT_TRUE - The assertion success if the expression evaluates to true. Fails otherwise.
-
cpp
-
AssertException - An AssertException is thrown whenever a siplasplas assertion fails (See AssertExpression). AssertException::what() returns a detailed message about the assertion failure.
-
AssertExpression - Siplasplas implements assertions as instances of AssertExpression class. An assert expression object takes the result (true or false) of the assertion, its source location (file, line) and a detailed message. The assertion is evaluated during the destruction of the assertion object. If the assertion failed (i.e. the value of the result was false) the AssertExpression destructor throws an AssertException exception.
-
DummyAssertExpression - When siplasplas assertions are disabled DummyAssertExpression objects are instanced instead, and the expression does nothing.
-
DynamicLibrary - DynamicLibrary is a RAII abstraction over a OS-specific shared library handle. The library handle is refcounted and automatically released when there are no more DynamicLibrary instances referencing it. Symbols can be loaded from the library using getSymbol() function.
-
Exception<Ex, Base> - Declares a siplasplas exception type.
-
Hash<T> - This template provides the features of cpp::hash() as a functor template, suitable for unordered containers.
-
Identity - The identity function takes a value of any type and returns it as is. The function performs no mutation of the value. Given an expression
x
decltype(x) == decltype(Identity()(x))
and the yield value is the same. This function is useful to delay the evaluation of an expression to the second template processing phase (The on instantiation phase). See cpp::staticIf or cpp::compiles. -
RawHash<T> - This template provides the features of cpp::raw_hash() as a functor template, suitable for unordered containers.
-
Throw<Exception, Args…>(const std::string &,Args &&…) - Throws an exception. See cpp::exception().
-
UniversalReference<T, IsLvalueReference, IsConst> - This template and its specialization provides a common interface to store references to lvalue and rvalues. UniversalReference has different spacializations for each value category supported (reference to lvalue, const reference to lvalue, rvalue). Instances of this types should be created through cpp::universalReference() function, which instances the appropiate template given the input value category.
-
UniversalReference< T, false, false > - See cpp::UniversalReference main template documentation for details
-
UniversalReference< T, true, false > - See cpp::UniversalReference main template documentation for details
-
construct<T, Args…>(T *,Args &&…) - This function performs an in-place construction of an object of type T in the given address. Arguments are passed as-is to the object constructor. The behavior is undefined if
alignment(pointer) != alignof(T)
. -
construct<T, Args…>(void *,Args &&…) - This function performs an in-place construction of an object of type T in the given address. Arguments are passed as-is to the object constructor. The behavior is undefined if
alignment(pointer) != alignof(T)
. -
exceptionSkippingFrames<Exception, Args…>(std::size_t,const std::string &,Args &&…) - This function creates an exception object of the given type using a custom parameterized error message (See
fmt::format()
). Exceptions instanced throught this function are reported automatically (See cpp::logError() and cpp::logException()). -
hash<T, U, Args…>(const T &,const U &,const Args &…) - This function is a generalization of unary cpp::hash() that accepts two or more input values. The resulting hash code is computed as the hash combination (See cpp::hash_combine()) of the first value and the hash combination of the rest:
-
hash_combine<T>(std::size_t,const T &) - Literally copied from this stack overflow thread which in turn got it from
boost::hash_combine()
. -
lexical_cast<T>(const T &) - This function invokes
operator<<(std::ostream&, const T&)
to get an string representation of a given value. -
lexical_cast<T>(const std::string &) - This function invokes
operator>>(std::istream&, T&)
to assign a T value from an string representation of it. -
logException<Ex, Message>(const Message &,std::size_t) - This function logs an error report (See cpp::logError()) about a thrown exception. The error report is of the form:
-
logException<Ex>(const Ex &,std::size_t) - This function logs a detailed error report from an exception object. See cpp::logError(). The error report is of the form:
-
raw_hash<T>(const T &) - This function ignores the
std::hash
specialization of the value type and implements a bytewise hash value instead. Bytewise hash is computed as a hash combination of each byte of the value storage, in the range[addressof(value), addressof(value) + sizeof(T))
. The value is copyed to an intermediary aligned storage to perform the byte traversal. -
staticIf<Condition, ThenBody, Args…>(const ThenBody &,Args &&…) - An static conditional allows to conditionally evaluate some code depending on the value of a compile time property. The body of the conditional is implemented by user provided functions.
-
universalReference<T>(T &&) - This function checks the value category of the given value and instances the apropiate cpp::UniversalReference specialization. Note the returned type depends on the value category. For an alternative with common a type, see cpp::typeerasure::AnyArg
-
-
cpp::detail
-
AlignedMallocAlingOffset - This type limits the maximum alignment requirement that can be passed to aligned_malloc() stores the distance to the start of the allocated block so it can be deallocated in aligned_free(). To use as little extra memory as possible, a 8 bit unsigned integer is used by default, which means up to 256 byte alignment boundary is supported by default. Users can change that limit by defining
SIPLASPLAS_UTILITY_ALIGNEDMALLOC_ALIGNOFFSET_BITS
to the with in bits of the unsigned integer used for offset storage (8, 16, 32, and 64 are supported) -
If<Condition> - Implements the then branch of an static conditional.
-
aligned_malloc(std::size_t,std::size_t,std::size_t) - This function allocates a memory block starting at a specific alignment boundary. Users can also set some extra bytes for bookeeping data before the returned block. To deallocate blocks allocated with aligned_malloc(), use aligned_free(), never std::free()
-
aligned_malloc_block(void *,std::size_t) - aligned_malloc() allocates an oversized block in order to acomplish the alignment requirements While aligned_malloc() returns the expected aligned block, this function can be used to get the complete allocated block.
-
readTaggedPointer<R, Args…>(R (*)(Args…)) - Assuming the pointer is a tagged pointer, this function reads the data tagged in the 16 more significative bits of the pointer. Compilation fails if this function is used in non 64 bit architectures.
-
readTaggedPointer<T>(T *) - Assuming the pointer is a tagged pointer, this function reads the data tagged in the 16 more significative bits of the pointer. Compilation fails if this function is used in non 64 bit architectures.
-
tagPointer<R, U, Args…>(R (*)(Args…),U) - This function uses the tagged pointer technique to store data in a 64 bit virtual memory address. Passing data of more than 16 bits wide has undefined behavior. Compilation fails if this function is used in non 64 bit architectures. Note accessing a tagged pointer directly may cause a segmentation fault. See cpp::untagPointer().
-
tagPointer<T, U>(T *,U) - This function uses the tagged pointer technique to store data in a 64 bit virtual memory address. Passing data of more than 16 bits wide has undefined behavior. Compilation fails if this function is used in non 64 bit architectures. Note accessing a tagged pointer directly may cause a segmentation fault. See cpp::untagPointer().
-
untagPointer<R, Args…>(R (*)(Args…)) - Assuming the pointer is a tagged pointer, this function removes the tagged data and returns the memory address ready to be referenced. Compilation fails if this function is used in non 64 bit architectures.
-
untagPointer<T>(T *) - Assuming the pointer is a tagged pointer, this function removes the tagged data and returns the memory address ready to be referenced. Compilation fails if this function is used in non 64 bit architectures.
-
-
cpp::utility
-
errorLogger() - This function returns a logger pointing to an isolated siplasplas errors log file. All exceptions and assertion failures are logged throught this logger.
-
logError<Message, Args…>(const Message &,Args &&…) - Effectively calls
logErrorSkippingFrames(1, message, args...)
. -
logErrorSkippingFrames<Message, Args…>(std::size_t,const Message &,Args &&…) - This function logs a detailed error report with a stack trace ending at the caller function. Also supports skipping the last \p framesToSkip stack frames from the trace in case the trace is invoked from an API with multiple implementation layers. The generated report follows the format:
-