RDFS
The Rice Comp413 2017 class' continuation on the work of the 2016 RDFS.
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | List of all members
daemon_thread::DaemonThreadFactory Class Reference

#include <DaemonFactory.h>

Public Member Functions

template<class Fn >
void template_chore_function (Fn &&ct, const int sleep_time)
 
template<class Fn , class T >
void create_daemon_thread (Fn &&ct, T &&obj, const int sleep_time)
 

Detailed Description

you need to instantiate this object by typing daemon_thread::DaemonThreadFactory var; before using the function create_daemon_thread()

Member Function Documentation

template<class Fn , class T >
void daemon_thread::DaemonThreadFactory::create_daemon_thread ( Fn &&  ct,
T &&  obj,
const int  sleep_time 
)
inline

This function will create another thread that will run asychronously ct- is a member function pointer which takes in no arguments and returns a bool whether it was successful or not obj- is the object pointer that will call the chore function ct sleep_time- the amount of time (in seconds) you want the thread to sleep before calling the chore function

an example call of this function would be: dmfac.create_daemon_thread(&ZkNnClient::TestDaemon, &zk_nn_client_obj, 10);

template<class Fn >
void daemon_thread::DaemonThreadFactory::template_chore_function ( Fn &&  ct,
const int  sleep_time 
)
inline

This is a helper function that should not be called except by create_daemon_thread ct- is a function pointer that is the chore function sleep_time- is the amount of time the thread should sleep


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