Radium Engine  1.5.20
Loading...
Searching...
No Matches
Ra::Core::FunctionTask Class Reference

#include <Core/Tasks/Task.hpp>

+ Inheritance diagram for Ra::Core::FunctionTask:
+ Collaboration diagram for Ra::Core::FunctionTask:

Public Member Functions

 FunctionTask (const std::function< void(void)> &f, const std::string &name)
 Create a function task.
 
virtual std::string getName () const override
 Return the provided task name.
 
virtual void process () override
 Call the function.
 
- Public Member Functions inherited from Ra::Core::Task
virtual ~Task ()
 Destructor.
 

Protected Attributes

std::function< void(void)> m_f
 
std::string m_name
 The function to call.
 

Detailed Description

A wrapper for a task around a std::function, which must be of type void(void) The process() method will simply call the provided function. Use std::bind to bind the arguments to the function object when creating the task.

Definition at line 29 of file Task.hpp.

Constructor & Destructor Documentation

◆ FunctionTask()

Ra::Core::FunctionTask::FunctionTask ( const std::function< void(void)> & f,
const std::string & name )
inline

Create a function task.

Definition at line 33 of file Task.hpp.

Member Function Documentation

◆ getName()

virtual std::string Ra::Core::FunctionTask::getName ( ) const
inlineoverridevirtual

Return the provided task name.

Implements Ra::Core::Task.

Definition at line 37 of file Task.hpp.

◆ process()

virtual void Ra::Core::FunctionTask::process ( )
inlineoverridevirtual

Call the function.

Implements Ra::Core::Task.

Definition at line 40 of file Task.hpp.

Member Data Documentation

◆ m_f

std::function<void( void )> Ra::Core::FunctionTask::m_f
protected

Definition at line 43 of file Task.hpp.

◆ m_name

std::string Ra::Core::FunctionTask::m_name
protected

The function to call.

Definition at line 44 of file Task.hpp.


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