Code quality: Large clean-up of the codebase and especially of the include/ folder

This commit is contained in:
Philippe Tillet
2015-08-06 12:05:12 -07:00
parent df9f6142ef
commit db090d7942
68 changed files with 534 additions and 663 deletions

View File

@@ -0,0 +1,33 @@
#ifndef ISAAC_MODEL_TOOLS_HPP
#define ISAAC_MODEL_TOOLS_HPP
#include <vector>
#include "rapidjson/document.h"
namespace isaac
{
namespace json
{
template<class T>
std::vector<T> to_int_array(rapidjson::Value const & a)
{
size_t N = a.Size();
std::vector<T> res(N);
for(size_t i = 0 ; i < N ; ++i) res[i] = a[i].GetInt();
return res;
}
template<class T>
std::vector<T> to_float_array(rapidjson::Value const & a)
{
size_t N = a.Size();
std::vector<T> res(N);
for(size_t i = 0 ; i < N ; ++i) res[i] = a[i].GetDouble();
return res;
}
}
}
#endif