NetDEM v1.0
Loading...
Searching...
No Matches
shape_factory.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "shape.hpp"
4#include <nlohmann/json.hpp>
5
6namespace netdem {
7
16public:
20 static std::unordered_map<std::string, Shape::Type> shape_map;
21
32 static Shape *NewShape(std::string const &shape_name,
33 nlohmann::json const &js);
34};
35
36} // namespace netdem
A class for creating Shape objects using a factory pattern.
Definition shape_factory.hpp:15
static Shape * NewShape(std::string const &shape_name, nlohmann::json const &js)
Create a new Shape object by name.
Definition shape_factory.cpp:38
static std::unordered_map< std::string, Shape::Type > shape_map
A map of valid Shape names and types.
Definition shape_factory.hpp:20
This class represents different types of shapes and performs various calculations on them.
Definition shape.hpp:15
Definition bond_entry.hpp:7