include/meltpooldg/utilities/scoped_name.hpp Source File

Developer Documentation: include/meltpooldg/utilities/scoped_name.hpp Source File
Developer Documentation
scoped_name.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/base/exceptions.h>
4
5#include <boost/algorithm/string/join.hpp>
6
7#include <string>
8#include <vector>
9
10
11namespace MeltPoolDG
12{
14 {
15 public:
16 ScopedName(const std::string &name)
17 : name(name)
18 {
19 path.push_back(name);
20 }
21
23 {
24 AssertThrow(path.back() == name, dealii::ExcInternalError());
25 path.pop_back();
26 }
27
28 operator std::string() const
29 {
30 return boost::algorithm::join(path, "::");
31 }
32
33 private:
34 const std::string name;
35 inline static std::vector<std::string> path;
36 };
37} // namespace MeltPoolDG
Definition scoped_name.hpp:14
~ScopedName()
Definition scoped_name.hpp:22
static std::vector< std::string > path
Definition scoped_name.hpp:35
const std::string name
Definition scoped_name.hpp:34
ScopedName(const std::string &name)
Definition scoped_name.hpp:16
Interface for a general preconditioner.
Definition boundary_condition_functions.hpp:17