mn::queue::work_queue_item Class Referenceabstract

#include <mn_workqueue_item.hpp>

Public Member Functions

 work_queue_item (bool deleteAffter=false)
 
virtual ~work_queue_item ()
 
bool can_delete ()
 
virtual bool on_work ()=0
 

Private Attributes

const bool m_bCanDelete
 

Detailed Description

This is an abstract base class. To use this, you need to subclass it. All of your work_queue_item should be derived from this class. Then implement the virtual on_work function.

Constructor & Destructor Documentation

◆ work_queue_item()

mn::queue::work_queue_item::work_queue_item ( bool  deleteAffter = false)
inline

Our constructor.

Parameters
deleteAffterIf you pass in a true, you are requesing the work_queue_t itself to delete this work_queue_item after it has run it.
Note
Only set deleteAffter = true if: 1) You dynamically allocated it (i.e. used "new") 2) After you call on_work() you promise never to touch this object again.

◆ ~work_queue_item()

virtual mn::queue::work_queue_item::~work_queue_item ( )
inlinevirtual

Our destructor.

Member Function Documentation

◆ can_delete()

bool mn::queue::work_queue_item::can_delete ( )
inline

Allows a client to decide if this work_queue_item is marked for automatic deletion.

◆ on_work()

virtual bool mn::queue::work_queue_item::on_work ( )
pure virtual

Implementation of your actual work_queue_item function. You must override this function.

Member Data Documentation

◆ m_bCanDelete

const bool mn::queue::work_queue_item::m_bCanDelete
private

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