2013-05-21 18:02:42 +01:00
|
|
|
#ifndef LATAN_GLOBAL_HPP_
|
|
|
|
#define LATAN_GLOBAL_HPP_
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <latan/Eigen/Dense>
|
|
|
|
|
|
|
|
#define LATAN_BEGIN_CPPDECL namespace Latan {
|
|
|
|
#define LATAN_END_CPPDECL }
|
|
|
|
|
|
|
|
// attribute to switch off unused warnings with gcc
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#define __dumb __attribute__((unused))
|
|
|
|
#else
|
|
|
|
#define __dumb
|
|
|
|
#endif
|
|
|
|
|
|
|
|
LATAN_BEGIN_CPPDECL
|
|
|
|
|
|
|
|
// Environment
|
|
|
|
namespace Env
|
|
|
|
{
|
2014-01-22 15:57:47 +00:00
|
|
|
extern const std::string fullName;
|
|
|
|
extern const std::string name;
|
|
|
|
extern const std::string version;
|
2013-05-21 18:02:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// string conversions
|
|
|
|
template <typename T>
|
2014-01-22 16:58:26 +00:00
|
|
|
T strTo(std::string str)
|
2013-05-21 18:02:42 +01:00
|
|
|
{
|
|
|
|
T buf;
|
|
|
|
std::istringstream stream(str);
|
|
|
|
|
|
|
|
stream >> buf;
|
|
|
|
|
|
|
|
return buf;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename T>
|
2014-01-22 16:58:26 +00:00
|
|
|
std::string strFrom(T x)
|
2013-05-21 18:02:42 +01:00
|
|
|
{
|
|
|
|
std::ostringstream stream;
|
|
|
|
|
|
|
|
stream << x;
|
|
|
|
|
|
|
|
return stream.str();
|
|
|
|
}
|
|
|
|
|
|
|
|
LATAN_END_CPPDECL
|
|
|
|
|
|
|
|
#include <latan/Exceptions.hpp>
|
|
|
|
|
|
|
|
#endif
|