Specs
Beautiful C++ Test Framework
Loading...
Searching...
No Matches
GlobalSpecCodeBlocks.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <functional>
4
#include <vector>
5
6
namespace
SpecsCpp
{
7
8
class
GlobalSpecCodeBlocks
{
9
std::vector<std::function<void()>> _codeBlocks;
10
11
public
:
12
static
GlobalSpecCodeBlocks
&
instance
() {
13
static
GlobalSpecCodeBlocks
instance
;
14
return
instance
;
15
}
16
17
void
register_code_block
(std::function<
void
()> codeBlock) {
18
_codeBlocks.push_back(std::move(codeBlock));
19
}
20
21
void
run_code_blocks
() {
22
for
(
auto
& codeBlock : _codeBlocks) codeBlock();
23
}
24
};
25
}
SpecsCpp::GlobalSpecCodeBlocks
Definition
GlobalSpecCodeBlocks.h:8
SpecsCpp::GlobalSpecCodeBlocks::instance
static GlobalSpecCodeBlocks & instance()
Definition
GlobalSpecCodeBlocks.h:12
SpecsCpp::GlobalSpecCodeBlocks::register_code_block
void register_code_block(std::function< void()> codeBlock)
Definition
GlobalSpecCodeBlocks.h:17
SpecsCpp::GlobalSpecCodeBlocks::run_code_blocks
void run_code_blocks()
Definition
GlobalSpecCodeBlocks.h:21
SpecsCpp
Definition
API.h:3
Specs.Globals
include
Specs
GlobalSpecCodeBlocks.h
<3 Mrowr Purr