Libftpp
A modern C++ library
thread.hpp
Go to the documentation of this file.
1
#ifndef THREAD_HPP
2
#define THREAD_HPP
3
4
#include <functional>
5
#include <stdexcept>
6
#include <string>
7
#include <thread>
8
9
#include "../thread_safe_iostream/thread_safe_iostream.hpp"
10
35
class
Thread
36
{
37
private
:
38
std::function<void()> _funct;
39
std::thread _t;
40
ThreadSafeIOStream
_stream;
41
42
public
:
43
Thread
(
const
std::string& name, std::function<
void
()> funcToExecute);
44
~Thread
();
45
46
void
start
();
47
void
stop
();
48
};
49
50
#endif
ThreadSafeIOStream
Thread-Safe I/O Stream.
Definition:
thread_safe_iostream.hpp:31
Thread
Simple Thread Wrapper.
Definition:
thread.hpp:36
Thread::start
void start()
Definition:
thread.cpp:13
Thread::~Thread
~Thread()
Definition:
thread.cpp:3
Thread::Thread
Thread(const std::string &name, std::function< void()> funcToExecute)
Definition:
thread.cpp:7
Thread::stop
void stop()
Definition:
thread.cpp:23
src
thread
thread
thread.hpp
Generated by
1.9.1