Bites
A small library of miscellaneous C++ codes.
 All Classes Namespaces Functions Friends Pages
Public Member Functions | List of all members
bites::Thread Class Referenceabstract

#include <Thread.hpp>

Public Member Functions

 ~Thread ()
 
void start ()
 
void join ()
 

Detailed Description

Allows creating thread "objects" similarly to Python's Thread (or Process) class. For example, in Python you'd create your class this way:

from threading import Thread
class Foo(Thread):
def __init__(self):
super(Foo, self).__init__()
def run(self):
print('Hello!')
bar = Foo()
bar.start()
bar.join()

Using Thread class, the analogous C++ definition is:

#include <iostream>
#include <bites.hpp>
class Foo : public bites::Thread {
private:
void run() { std::cout << "Hello!" << std::endl; }
};
int main (int argc, char** argv) {
bar Foo;
bar.start();
bar.join();
}

Constructor & Destructor Documentation

bites::Thread::~Thread ( )
inline

Deallocate memory for internal thread object.

Member Function Documentation

void bites::Thread::start ( )
inline

Allocate (and start) internal thread object.

void bites::Thread::join ( )
inline

Join internal thread.


The documentation for this class was generated from the following file: