mf
Media Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Namespaces | Macros | Typedefs | Functions
common.h File Reference
#include <cstddef>
#include <cassert>
#include <exception>
#include <stdexcept>
#include <ostream>
#include "ndarray/ndspan.h"
#include "debug.h"
#include "exceptions.h"

Go to the source code of this file.

Classes

class  mf::time_span
 One-dimensional time span. More...
 

Namespaces

 mf
 

Macros

#define MF_ASSERT_MSG(condition, msg)
 
#define MF_ASSERT(condition)   MF_ASSERT_MSG(condition, "`" #condition "`")
 
#define MF_EXPECTS_MSG(condition, msg)   MF_ASSERT_MSG(condition, "precondition: " msg)
 
#define MF_EXPECTS(condition)   MF_EXPECTS_MSG(condition, "`" #condition "`")
 
#define MF_ENSURES_MSG(condition, msg)   MF_ASSERT_MSG(condition, "postcondition: " msg)
 
#define MF_ENSURES(condition)   MF_EXPECTS_MSG(condition, "`" #condition "`")
 

Typedefs

using mf::real = float
 Real number type. More...
 
using mf::time_unit = std::ptrdiff_t
 Discrete time unit type. More...
 
using mf::byte = std::uint8_t
 Single byte type. More...
 

Functions

std::ostream & mf::operator<< (std::ostream &str, const time_span &span)
 

Macro Definition Documentation

#define MF_ASSERT (   condition)    MF_ASSERT_MSG(condition, "`" #condition "`")
#define MF_ASSERT_MSG (   condition,
  msg 
)
Value:
if(!(condition)) { \
MF_DEBUG_BACKTRACE("assertion failed: " msg); \
std::abort(); \
}
#define MF_DEBUG_BACKTRACE(caption)
Definition: debug.h:25
#define MF_ENSURES (   condition)    MF_EXPECTS_MSG(condition, "`" #condition "`")
#define MF_ENSURES_MSG (   condition,
  msg 
)    MF_ASSERT_MSG(condition, "postcondition: " msg)
#define MF_EXPECTS (   condition)    MF_EXPECTS_MSG(condition, "`" #condition "`")
#define MF_EXPECTS_MSG (   condition,
  msg 
)    MF_ASSERT_MSG(condition, "precondition: " msg)