#include "StorageImpl.hpp"
-#include "surf_private.h"
+#include "surf_private.hpp"
+#include <algorithm>
#include <boost/algorithm/string.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/split.hpp>
std::unordered_map<std::string, StorageImpl*>* StorageImpl::storages =
new std::unordered_map<std::string, StorageImpl*>();
-StorageImpl* StorageImpl::byName(const char* name)
+StorageImpl* StorageImpl::byName(std::string name)
{
if (storages->find(name) == storages->end())
return nullptr;
StorageImpl::StorageImpl(Model* model, std::string name, lmm_system_t maxminSystem, double bread, double bwrite,
std::string type_id, std::string content_name, sg_size_t size, std::string attach)
- : Resource(model, name.c_str(), lmm_constraint_new(maxminSystem, this, MAX(bread, bwrite)))
+ : Resource(model, name.c_str(), lmm_constraint_new(maxminSystem, this, std::max(bread, bwrite)))
, piface_(this)
, typeId_(type_id)
, size_(size)
std::map<std::string, sg_size_t>* parse_content = new std::map<std::string, sg_size_t>();
- std::ifstream* fs = surf_ifsopen(filename.c_str());
+ std::ifstream* fs = surf_ifsopen(filename);
std::string line;
std::vector<std::string> tokens;