OTest2
A C++ testing framework
include
otest2
stateregistry.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2018 Ondrej Starek
3
*
4
* This file is part of OTest2.
5
*
6
* OTest2 is free software: you can redistribute it and/or modify it under
7
* the terms of the GNU Lesser General Public License as published by
8
* the Free Software Foundation, either version 3 of the License,
9
* or (at your option) any later version.
10
*
11
* OTest2 is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14
* License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
#ifndef OTest2__INCLUDE_OTEST2_STATEREGISTRY_H_
21
#define OTest2__INCLUDE_OTEST2_STATEREGISTRY_H_
22
23
#include <string>
24
25
#include <
otest2/stateptr.h
>
26
27
namespace
OTest2
{
28
32
class
StateRegistry
{
33
private
:
34
struct
Impl;
35
Impl* pimpl;
36
37
public
:
38
/* -- avoid copying */
39
StateRegistry
(
40
const
StateRegistry
&) =
delete
;
41
StateRegistry
&
operator =
(
42
const
StateRegistry
&) =
delete
;
43
47
StateRegistry
();
48
52
~StateRegistry
();
53
60
void
registerState
(
61
const
std::string& name_,
62
StatePtr
state_);
63
70
StatePtr
getState
(
71
const
std::string& name_)
const
;
72
};
73
74
}
/* namespace OTest2 */
75
76
#endif
/* OTest2__INCLUDE_OTEST2_STATEREGISTRY_H_ */
OTest2::StateRegistry::operator=
StateRegistry & operator=(const StateRegistry &)=delete
OTest2::StateRegistry::~StateRegistry
~StateRegistry()
Dtor.
Definition:
stateregistry.cpp:63
OTest2::StateRegistry::registerState
void registerState(const std::string &name_, StatePtr state_)
Register new state.
Definition:
stateregistry.cpp:67
OTest2
Definition:
assertbean.h:25
OTest2::StateRegistry::StateRegistry
StateRegistry()
Ctor.
Definition:
stateregistry.cpp:58
OTest2::StatePtr
std::shared_ptr< State > StatePtr
Pointer to test state objects.
Definition:
stateptr.h:27
OTest2::StateRegistry::getState
StatePtr getState(const std::string &name_) const
Get state with specified name_.
Definition:
stateregistry.cpp:74
OTest2::StateRegistry
Registry of test states.
Definition:
stateregistry.h:32
stateptr.h
Generated by
1.8.17