votca 2024-dev
Loading...
Searching...
No Matches
name.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 The VOTCA Development Team
3 * (http://www.votca.org)
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License")
6 *
7 * You may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 */
19
20#ifndef VOTCA_TOOLS_NAME_H
21#define VOTCA_TOOLS_NAME_H
22
23// Standard includes
24#include <cassert>
25#include <string>
26
27namespace votca {
28namespace tools {
29
38class Name {
39 private:
40 std::string name_;
41 bool name_set_{false};
42
43 public:
44 Name() = default;
45 Name(const std::string name) : name_(name), name_set_(true){};
46 void setName(const std::string &name) {
47 name_ = name;
48 name_set_ = true;
49 }
50 const std::string &getName() const {
51 assert(name_set_ && "No name has been set, cannot get name.");
52 return name_;
53 }
54};
55} // namespace tools
56} // namespace votca
57
58#endif // VOTCA_TOOLS_NAME_H
Name object.
Definition name.h:38
void setName(const std::string &name)
Definition name.h:46
const std::string & getName() const
Definition name.h:50
Name(const std::string name)
Definition name.h:45
std::string name_
Definition name.h:40
base class for all analysis tools
Definition basebead.h:33