votca
2024.2-dev
Loading...
Searching...
No Matches
tools
include
votca
tools
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
27
namespace
votca
{
28
namespace
tools {
29
38
class
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
votca::tools::Name
Name object.
Definition
name.h:38
votca::tools::Name::setName
void setName(const std::string &name)
Definition
name.h:46
votca::tools::Name::Name
Name()=default
votca::tools::Name::getName
const std::string & getName() const
Definition
name.h:50
votca::tools::Name::Name
Name(const std::string name)
Definition
name.h:45
votca::tools::Name::name_
std::string name_
Definition
name.h:40
votca::tools::Name::name_set_
bool name_set_
Definition
name.h:41
votca
base class for all analysis tools
Definition
basebead.h:33
Generated by
1.12.0