1
Fork 0

Moves some stuff around

This commit is contained in:
Joshua Moerman 2014-03-04 15:32:21 +01:00
parent f1116a8bb7
commit 30f2101edd
10 changed files with 19 additions and 20 deletions

View file

@ -1,8 +1,7 @@
#pragma once
#include <boost/container/flat_set.hpp>
#include <cassert>
#include <utility>
#include <vector>
// Using boost flat set was faster than std::set.

View file

@ -1,5 +0,0 @@
#pragma once
#include <string>
std::string colored_block(int color);

View file

@ -4,6 +4,8 @@
#include <boost/serialization/utility.hpp>
#include <boost/serialization/serialization.hpp>
#include <vector>
#include <utility>
#include <string>
struct BasicRulesBase {
unsigned int min_size;
@ -65,3 +67,7 @@ private:
// consider make_nvp for readable json
}
};
struct DynamicGrid;
AnalyzedGrid<DynamicGrid> grid_from_file(std::string file_path);
void grid_to_file(AnalyzedGrid<DynamicGrid> const & grid, std::string file_path);

View file

@ -2,6 +2,7 @@
#include "data.hpp"
#include "clusters.hpp"
#include <vector>
template <typename Grid>

View file

@ -1,6 +1,7 @@
#pragma once
#include <array>
#include <string>
// Simple static vector (much faster)
// Also slightly faster than boost::container::static_vector
@ -17,3 +18,6 @@ struct small_vector{
auto begin() const { return &arr[0]; }
auto end() const { return &arr[elements]; }
};
// Generates color codes for the terminal
std::string colored_block(int color);

View file

@ -1,16 +1,11 @@
#pragma once
#include "data.hpp"
#include "dynamic_grid.hpp"
#include "solver.hpp"
#include "rules.hpp"
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <fstream>
inline auto grid_from_file(std::string file_path){
AnalyzedGrid<DynamicGrid> grid_from_file(std::string file_path){
std::ifstream file(file_path);
boost::archive::text_iarchive ar(file);
@ -19,10 +14,9 @@ inline auto grid_from_file(std::string file_path){
return ret;
}
inline auto grid_to_file(AnalyzedGrid<DynamicGrid> const & grid, std::string file_path){
void grid_to_file(const AnalyzedGrid<DynamicGrid>& grid, std::string file_path){
std::ofstream file(file_path);
boost::archive::text_oarchive ar(file);
ar << grid;
}

View file

@ -1,5 +1,5 @@
#include "dynamic_grid.hpp"
#include "colored_output.hpp"
#include "utilities.hpp"
#include <functional>
#include <iostream>

View file

@ -1,4 +1,4 @@
#include "colored_output.hpp"
#include "utilities.hpp"
static const bool disable_colors = false;

View file

@ -1,8 +1,7 @@
#include "dynamic_grid.hpp"
#include "clusters.hpp"
#include "solver.hpp"
#include "rules.hpp"
#include "analyzed_grid.hpp"
#include "data.hpp"
#include <boost/program_options.hpp>

View file

@ -1,6 +1,7 @@
#include "dynamic_grid.hpp"
#include "analyzed_grid.hpp"
#include "clusters.hpp"
#include "rules.hpp"
#include "data.hpp"
#include <boost/program_options.hpp>