STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
Concurrency::scheduler_ptr Struct Reference

Represents a pointer to a scheduler. This class exists to allow the the specification of a shared lifetime by using shared_ptr or just a plain reference by using raw pointer. More...

#include <pplinterface.h>

Public Member Functions

 scheduler_ptr (std::shared_ptr< scheduler_interface > scheduler)
 Creates a scheduler pointer from shared_ptr to scheduler More...
 
 scheduler_ptr (_In_opt_ scheduler_interface *pScheduler)
 Creates a scheduler pointer from raw pointer to scheduler More...
 
scheduler_interface * operator-> () const
 Behave like a pointer More...
 
scheduler_interface * get () const
 Returns the raw pointer to the scheduler More...
 
 operator bool () const
 Test whether the scheduler pointer is non-null More...
 

Private Attributes

std::shared_ptr< scheduler_interface > m_sharedScheduler
 
scheduler_interface * m_scheduler
 

Detailed Description

Represents a pointer to a scheduler. This class exists to allow the the specification of a shared lifetime by using shared_ptr or just a plain reference by using raw pointer.

Constructor & Destructor Documentation

Concurrency::scheduler_ptr::scheduler_ptr ( std::shared_ptr< scheduler_interface >  scheduler)
inlineexplicit

Creates a scheduler pointer from shared_ptr to scheduler

63  : m_sharedScheduler(std::move(scheduler))
64  {
66  }
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
scheduler_interface * m_scheduler
Definition: pplinterface.h:99
std::shared_ptr< scheduler_interface > m_sharedScheduler
Definition: pplinterface.h:98
Concurrency::scheduler_ptr::scheduler_ptr ( _In_opt_ scheduler_interface *  pScheduler)
inlineexplicit

Creates a scheduler pointer from raw pointer to scheduler

71  : m_scheduler(pScheduler)
72  {
73  }
scheduler_interface * m_scheduler
Definition: pplinterface.h:99

Member Function Documentation

scheduler_interface* Concurrency::scheduler_ptr::get ( ) const
inline

Returns the raw pointer to the scheduler

87  {
88  return m_scheduler;
89  }
scheduler_interface * m_scheduler
Definition: pplinterface.h:99
Concurrency::scheduler_ptr::operator bool ( ) const
inline

Test whether the scheduler pointer is non-null

94 { return get() != nullptr; }
scheduler_interface* Concurrency::scheduler_ptr::operator-> ( ) const
inline

Behave like a pointer

79  {
80  return get();
81  }

Member Data Documentation

scheduler_interface* Concurrency::scheduler_ptr::m_scheduler
private
std::shared_ptr<scheduler_interface> Concurrency::scheduler_ptr::m_sharedScheduler
private

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