mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
39 lines
655 B
C++
39 lines
655 B
C++
#ifndef GLOBALS_H
|
|
#define GLOBALS_H
|
|
|
|
#include <functional>
|
|
#include <iostream>
|
|
#include <map>
|
|
#include <memory>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <cassert>
|
|
|
|
typedef int nanoseconds_t;
|
|
|
|
extern double getCurrentTime();
|
|
extern void hexdump(std::ostream& stream, const std::vector<uint8_t>& buffer);
|
|
|
|
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
|