Files
fluxengine/lib/globals.h
David Given 94fb10eb02 Behemoth change to rework everything to use Bytes rather than vectors of
uint8_t. The tests pass, but of course, nothing decodes any more.
2019-03-05 00:10:20 +01:00

43 lines
692 B
C++

#ifndef GLOBALS_H
#define GLOBALS_H
#include <stddef.h>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <cassert>
typedef int nanoseconds_t;
class Bytes;
extern double getCurrentTime();
extern void hexdump(std::ostream& stream, const Bytes& bytes);
class Error
{
public:
~Error()
{
std::cerr << "Error: " << _stream.str() << std::endl;
exit(1);
}
template <typename T>
Error& operator<<(T&& t)
{
_stream << t;
return *this;
}
private:
std::stringstream _stream;
};
#endif