STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Concurrency::timer< _Type > Class Template Reference

A timer messaging block is a single-target source_block capable of sending a message to its target after a specified time period has elapsed or at specific intervals. More...

#include <agents.h>

Inheritance diagram for Concurrency::timer< _Type >:
Concurrency::details::_Timer Concurrency::source_block< single_link_registry< ITarget< _Type > > > Concurrency::ISource< single_link_registry< ITarget< _Type > >::type::type >

Public Member Functions

 timer (unsigned int _Ms, _Type const &_Value, ITarget< _Type > *_PTarget=NULL, bool _Repeating=false)
 Constructs a timer messaging block that will fire a given message after a specified interval. More...
 
 ~timer ()
 Destroys a timer messaging block. More...
 
void start ()
 Starts the timer messaging block. The specified number of milliseconds after this is called, the specified value will be propagated downstream as a message. More...
 
void stop ()
 Stops the timer messaging block. More...
 
void pause ()
 Stops the timer messaging block. If it is a repeating timer messaging block, it can be restarted with a subsequent start() call. For non-repeating timers, this has the same effect as a stop call. More...
 
- Public Member Functions inherited from Concurrency::source_block< single_link_registry< ITarget< _Type > > >
 source_block ()
 Constructs a source_block object. More...
 
virtual ~source_block ()
 Destroys the source_block object. More...
 
virtual void link_target (_Inout_ ITarget< _Target_type > *_PTarget)
 Links a target block to this source_block object. More...
 
virtual void unlink_target (_Inout_ ITarget< _Target_type > *_PTarget)
 Unlinks a target block from this source_block object. More...
 
virtual void unlink_targets ()
 Unlinks all target blocks from this source_block object. More...
 
virtual message< _Target_type > * accept (runtime_object_identity _MsgId, _Inout_ ITarget< _Target_type > *_PTarget)
 Accepts a message that was offered by this source_block object, transferring ownership to the caller. More...
 
virtual bool reserve (runtime_object_identity _MsgId, _Inout_ ITarget< _Target_type > *_PTarget)
 Reserves a message previously offered by this source_block object. More...
 
virtual message< _Target_type > * consume (runtime_object_identity _MsgId, _Inout_ ITarget< _Target_type > *_PTarget)
 Consumes a message previously offered by this source_block object and successfully reserved by the target, transferring ownership to the caller. More...
 
virtual void release (runtime_object_identity _MsgId, _Inout_ ITarget< _Target_type > *_PTarget)
 Releases a previous successful message reservation. More...
 
virtual void acquire_ref (_Inout_ ITarget< _Target_type > *)
 Acquires a reference count on this source_block object, to prevent deletion. More...
 
virtual void release_ref (_Inout_ ITarget< _Target_type > *_PTarget)
 Releases a reference count on this source_block object. More...
 
- Public Member Functions inherited from Concurrency::ISource< single_link_registry< ITarget< _Type > >::type::type >
virtual ~ISource ()
 Destroys the ISource object. More...
 
virtual void link_target (_Inout_ ITarget< single_link_registry< ITarget< _Type > >::type::type > *_PTarget)=0
 When overridden in a derived class, links a target block to this ISource block. More...
 
virtual void unlink_target (_Inout_ ITarget< single_link_registry< ITarget< _Type > >::type::type > *_PTarget)=0
 When overridden in a derived class, unlinks a target block from this ISource block, if found to be previously linked. More...
 
virtual message< single_link_registry< ITarget< _Type > >::type::type > * accept (runtime_object_identity _MsgId, _Inout_ ITarget< single_link_registry< ITarget< _Type > >::type::type > *_PTarget)=0
 When overridden in a derived class, accepts a message that was offered by this ISource block, transferring ownership to the caller. More...
 
virtual bool reserve (runtime_object_identity _MsgId, _Inout_ ITarget< single_link_registry< ITarget< _Type > >::type::type > *_PTarget)=0
 When overridden in a derived class, reserves a message previously offered by this ISource block. More...
 
virtual message< single_link_registry< ITarget< _Type > >::type::type > * consume (runtime_object_identity _MsgId, _Inout_ ITarget< single_link_registry< ITarget< _Type > >::type::type > *_PTarget)=0
 When overridden in a derived class, consumes a message previously offered by this ISource block and successfully reserved by the target, transferring ownership to the caller. More...
 
virtual void release (runtime_object_identity _MsgId, _Inout_ ITarget< single_link_registry< ITarget< _Type > >::type::type > *_PTarget)=0
 When overridden in a derived class, releases a previous successful message reservation. More...
 
virtual void acquire_ref (_Inout_ ITarget< single_link_registry< ITarget< _Type > >::type::type > *_PTarget)=0
 When overridden in a derived class, acquires a reference count on this ISource block, to prevent deletion. More...
 
virtual void release_ref (_Inout_ ITarget< single_link_registry< ITarget< _Type > >::type::type > *_PTarget)=0
 When overridden in a derived class, releases a reference count on this ISource block. More...
 

Protected Member Functions

virtual message< _Type > * accept_message (runtime_object_identity _MsgId)
 Accepts a message that was offered by this timer messaging block, transferring ownership to the caller. More...
 
virtual bool reserve_message (runtime_object_identity _MsgId)
 Reserves a message previously offered by this timer messaging block. More...
 
virtual message< _Type > * consume_message (runtime_object_identity _MsgId)
 Consumes a message previously offered by the timer and reserved by the target, transferring ownership to the caller. More...
 
virtual void release_message (runtime_object_identity _MsgId)
 Releases a previous message reservation. More...
 
virtual void resume_propagation ()
 Resumes propagation after a reservation has been released. More...
 
virtual void link_target_notification (_Inout_ ITarget< _Type > *_PTarget)
 A callback that notifies that a new target has been linked to this timer messaging block. More...
 
virtual void propagate_to_any_targets (_Inout_opt_ message< _Type > *)
 Tries to offer the message produced by the timer block to all of the linked targets. More...
 
- Protected Member Functions inherited from Concurrency::details::_Timer
_CONCRTIMP _Timer (unsigned int _Ms, bool _FRepeating)
 
virtual _CONCRTIMP ~_Timer ()
 
_CONCRTIMP void _Start ()
 
_CONCRTIMP void _Stop ()
 
- Protected Member Functions inherited from Concurrency::source_block< single_link_registry< ITarget< _Type > > >
virtual void link_target_notification (_Inout_ ITarget< _Target_type > *)
 A callback that notifies that a new target has been linked to this source_block object. More...
 
virtual void unlink_target_notification (_Inout_ ITarget< _Target_type > *_PTarget)
 A callback that notifies that a target has been unlinked from this source_block object. More...
 
virtual void process_input_messages (_Inout_ message< _Target_type > *_PMessage)
 Process input messages. This is only useful for propagator blocks, which derive from source_block More...
 
virtual void propagate_output_messages ()
 Propagate messages to targets. More...
 
virtual void propagate_to_any_targets (_Inout_opt_ message< _Target_type > *_PMessage)
 When overridden in a derived class, propagates the given message to any or all of the linked targets. This is the main propagation routine for message blocks. More...
 
void initialize_source (_Inout_opt_ Scheduler *_PScheduler=NULL, _Inout_opt_ ScheduleGroup *_PScheduleGroup=NULL)
 Initializes the message_propagator within this source_block. More...
 
void enable_batched_processing ()
 Enables batched processing for this block. More...
 
virtual void sync_send (_Inout_opt_ message< _Target_type > *_Msg)
 Synchronously queues up messages and starts a propagation task, if this has not been done already. More...
 
virtual void async_send (_Inout_opt_ message< _Target_type > *_Msg)
 Asynchronously queues up messages and starts a propagation task, if this has not been done already More...
 
void wait_for_outstanding_async_sends ()
 Waits for all asynchronous propagations to complete. This propagator-specific spin wait is used in destructors of message blocks to make sure that all asynchronous propagations have time to finish before destroying the block. More...
 
void remove_targets ()
 Removes all target links for this source block. This should be called from the destructor. More...
 
- Protected Member Functions inherited from Concurrency::ISource< single_link_registry< ITarget< _Type > >::type::type >
void _Invoke_link_source (ITarget< single_link_registry< ITarget< _Type > >::type::type > *_PLinkFrom)
 Links this source to a target. More...
 
void _Invoke_unlink_source (ITarget< single_link_registry< ITarget< _Type > >::type::type > *_PUnlinkFrom)
 Unlinks this source from a target. More...
 

Private Types

enum  State { Initialized, Started, Paused, Stopped }
 Tracks the state machine of the timer. More...
 
typedef single_link_registry< ITarget< _Type > > _TargetLinkRegistry
 

Private Member Functions

message< _Type > * _NewMessage () const
 Allocates a new message. More...
 
virtual void _Fire ()
 Called when the timer fires. More...
 
void _Initialize (const _Type &_Value, _Inout_ ITarget< _Type > *_PTarget, bool _Repeating, _Inout_opt_ Scheduler *_PScheduler=NULL, _Inout_opt_ ScheduleGroup *_PScheduleGroup=NULL)
 Common initialization. More...
 
void _Delete_stored_messages ()
 Deletes all messages currently stored in this message block. Should be called by the destructor to ensure any messages propagated in are cleaned up. More...
 
timer const & operator= (timer const &)
 
 timer (timer const &)
 

Private Attributes

message< _Type > * _M_pMessage
 
State _M_state
 
_Type _M_value
 
bool _M_fRepeating
 
bool _M_fReferencedScheduler
 
Scheduler * _M_pScheduler
 

Additional Inherited Members

- Public Types inherited from Concurrency::source_block< single_link_registry< ITarget< _Type > > >
typedef single_link_registry< ITarget< _Type > >::type::type _Target_type
 The payload type of messages handled by this source_block. More...
 
typedef single_link_registry< ITarget< _Type > >::iterator target_iterator
 The iterator to walk the connected targets. More...
 
- Public Types inherited from Concurrency::ISource< single_link_registry< ITarget< _Type > >::type::type >
typedef single_link_registry< ITarget< _Type > >::type::type source_type
 A type alias for _Type . More...
 
- Protected Attributes inherited from Concurrency::source_block< single_link_registry< ITarget< _Type > > >
ITarget< _Target_type > * _M_pReservedFor
 Connected target that is holding a reservation More...
 
runtime_object_identity _M_reservedId
 Reserved message ID More...
 
single_link_registry< ITarget< _Type > > _M_connectedTargets
 Connected targets More...
 
_MessageProcessorType _M_messageProcessor
 Processor used for asynchronous message handling More...
 

Detailed Description

template<class _Type>
class Concurrency::timer< _Type >

A timer messaging block is a single-target source_block capable of sending a message to its target after a specified time period has elapsed or at specific intervals.

Template Parameters
_TypeThe payload type of the output messages of this block.

For more information, see Asynchronous Message Blocks.

Member Typedef Documentation

template<class _Type >
typedef single_link_registry<ITarget<_Type> > Concurrency::timer< _Type >::_TargetLinkRegistry
private

Member Enumeration Documentation

template<class _Type >
enum Concurrency::timer::State
private

Tracks the state machine of the timer.

Enumerator
Initialized 

The timer has been initialized, but not yet started.

Started 

The timer has been started.

Paused 

The timer has started and been paused.

Stopped 

The timer has been stopped.

8122  {
8126 
8127  Initialized,
8131 
8132  Started,
8136 
8137  Paused,
8141 
8142  Stopped
8143  };
The timer has been initialized, but not yet started.
Definition: agents.h:8127
The timer has started and been paused.
Definition: agents.h:8137
The timer has been started.
Definition: agents.h:8132
The timer has been stopped.
Definition: agents.h:8142

Constructor & Destructor Documentation

template<class _Type >
Concurrency::timer< _Type >::timer ( unsigned int  _Ms,
_Type const &  _Value,
ITarget< _Type > *  _PTarget = NULL,
bool  _Repeating = false 
)
inline

Constructs a timer messaging block that will fire a given message after a specified interval.

Parameters
_MsThe number of milliseconds that must elapse after the call to start for the specified message to be propagated downstream.
_ValueThe value which will be propagated downstream when the timer elapses.
_PTargetThe target to which the timer will propagate its message.
_RepeatingIf true, indicates that the timer will fire periodically every _Ms milliseconds.

The runtime uses the default scheduler if you do not specify the _Scheduler or _ScheduleGroup parameters.

See also
Scheduler Class, ScheduleGroup Class
8170  :
8171  _Timer(_Ms, _Repeating)
8172  {
8173  _Initialize(_Value, _PTarget, _Repeating);
8174  }
void _Initialize(const _Type &_Value, _Inout_ ITarget< _Type > *_PTarget, bool _Repeating, _Inout_opt_ Scheduler *_PScheduler=NULL, _Inout_opt_ ScheduleGroup *_PScheduleGroup=NULL)
Common initialization.
Definition: agents.h:8510
_CONCRTIMP _Timer(unsigned int _Ms, bool _FRepeating)
_In_ int _Value
Definition: setjmp.h:173
template<class _Type >
Concurrency::timer< _Type >::~timer ( )
inline

Destroys a timer messaging block.

8248  {
8249  //
8250  // Make sure there are no more outstanding timer fires. Note that this does not mean that the LWT that was queued is finished, it only
8251  // means that no more timers will fire after the return from _Stop. We still *MUST* wait on any outstanding LWTs.
8252  //
8253  if (_M_state == Started)
8254  _Stop();
8255 
8256  // Remove all the targets. This will wait for any outstanding LWTs
8257  this->remove_targets();
8258 
8259  //
8260  // No more asynchronous operations can happen as of this point.
8261  //
8262 
8263  // Clean up any messages left in this message block
8265 
8267  {
8269  }
8270  }
State _M_state
Definition: agents.h:8465
Definition: concrt.h:376
_CONCRTIMP unsigned int _Release()
void _Delete_stored_messages()
Deletes all messages currently stored in this message block. Should be called by the destructor to en...
Definition: agents.h:8545
The timer has been started.
Definition: agents.h:8132
bool _M_fReferencedScheduler
Definition: agents.h:8474
Scheduler * _M_pScheduler
Definition: agents.h:8477
void remove_targets()
Removes all target links for this source block. This should be called from the destructor.
Definition: agents.h:5454
template<class _Type >
Concurrency::timer< _Type >::timer ( timer< _Type > const &  )
private

Member Function Documentation

template<class _Type >
void Concurrency::timer< _Type >::_Delete_stored_messages ( )
inlineprivate

Deletes all messages currently stored in this message block. Should be called by the destructor to ensure any messages propagated in are cleaned up.

8546  {
8547  // Input messages for this message block are in the base-class input buffer
8548  // All messages in that buffer are guaranteed to have moved to the output
8549  // buffer because the destructor first waits for all async sends to finish
8550  // before reaching this point
8551 
8552  // Delete the message remaining in the output queue
8553  if (_M_pMessage != NULL)
8554  {
8555  delete _M_pMessage;
8556  }
8557  }
#define NULL
Definition: vcruntime.h:236
message< _Type > * _M_pMessage
Definition: agents.h:8462
template<class _Type >
virtual void Concurrency::timer< _Type >::_Fire ( )
inlineprivatevirtual

Called when the timer fires.

Implements Concurrency::details::_Timer.

8493  {
8494  this->async_send(NULL);
8495  }
#define NULL
Definition: vcruntime.h:236
virtual void async_send(_Inout_opt_ message< _Target_type > *_Msg)
Asynchronously queues up messages and starts a propagation task, if this has not been done already ...
Definition: agents.h:5434
template<class _Type >
void Concurrency::timer< _Type >::_Initialize ( const _Type &  _Value,
_Inout_ ITarget< _Type > *  _PTarget,
bool  _Repeating,
_Inout_opt_ Scheduler *  _PScheduler = NULL,
_Inout_opt_ ScheduleGroup *  _PScheduleGroup = NULL 
)
inlineprivate

Common initialization.

Parameters
_ValueThe value which will be propagated downstream when the timer elapses.
_PTargetThe target to which the timer will propagate its message.
_RepeatingIf true, indicates that the timer will fire periodically every _Ms milliseconds.
8511  {
8512  _M_pMessage = NULL;
8513  _M_value = _Value;
8514  _M_fRepeating = _Repeating;
8516  _M_fReferencedScheduler = false;
8517 
8518  //
8519  // If we are going to utilize the current scheduler for timer firing, we need to capture it now. Otherwise,
8520  // the timer threads fired from Windows (what _Fire executes within) will wind up with a default scheduler
8521  // attached -- probably not the semantic we want.
8522  //
8523  if (_PScheduleGroup == NULL && _PScheduler == NULL)
8524  {
8526  _PScheduler = _sched._GetScheduler();
8527  _sched._Reference();
8528  _M_fReferencedScheduler = true;
8529  }
8530 
8531  _M_pScheduler = _PScheduler;
8532  this->initialize_source(_PScheduler, _PScheduleGroup);
8533 
8534  if (_PTarget != NULL)
8535  {
8536  link_target(_PTarget);
8537  }
8538  }
#define NULL
Definition: vcruntime.h:236
State _M_state
Definition: agents.h:8465
Definition: concrt.h:376
The timer has been initialized, but not yet started.
Definition: agents.h:8127
bool _M_fRepeating
Definition: agents.h:8471
virtual void link_target(_Inout_ ITarget< _Target_type > *_PTarget)
Links a target block to this source_block object.
Definition: agents.h:4932
bool _M_fReferencedScheduler
Definition: agents.h:8474
void initialize_source(_Inout_opt_ Scheduler *_PScheduler=NULL, _Inout_opt_ ScheduleGroup *_PScheduleGroup=NULL)
Initializes the message_propagator within this source_block.
Definition: agents.h:5382
_Type _M_value
Definition: agents.h:8468
Scheduler * _M_pScheduler
Definition: agents.h:8477
_CONCRTIMP unsigned int _Reference()
_CONCRTIMP::Concurrency::Scheduler * _GetScheduler()
Definition: concrt.h:382
_In_ int _Value
Definition: setjmp.h:173
message< _Type > * _M_pMessage
Definition: agents.h:8462
static _CONCRTIMP _Scheduler __cdecl _Get()
template<class _Type >
message<_Type>* Concurrency::timer< _Type >::_NewMessage ( ) const
inlineprivate

Allocates a new message.

8484  {
8485  return new message<_Type>(_M_value);
8486  }
_Type _M_value
Definition: agents.h:8468
template<class _Type >
virtual message<_Type>* Concurrency::timer< _Type >::accept_message ( runtime_object_identity  _MsgId)
inlineprotectedvirtual

Accepts a message that was offered by this timer messaging block, transferring ownership to the caller.

Parameters
_MsgIdThe runtime_object_identity of the offered message object.
Returns
A pointer to the message object that the caller now has ownership of.

Implements Concurrency::source_block< single_link_registry< ITarget< _Type > > >.

8338  {
8339  if (_M_pMessage == NULL || _MsgId != _M_pMessage->msg_id())
8340  {
8341  return NULL;
8342  }
8343 
8344  message<_Type> *_PMessage = _M_pMessage;
8345  _M_pMessage = NULL;
8346 
8347  return _PMessage;
8348  }
#define NULL
Definition: vcruntime.h:236
message< _Type > * _M_pMessage
Definition: agents.h:8462
template<class _Type >
virtual message<_Type>* Concurrency::timer< _Type >::consume_message ( runtime_object_identity  _MsgId)
inlineprotectedvirtual

Consumes a message previously offered by the timer and reserved by the target, transferring ownership to the caller.

Parameters
_MsgIdThe runtime_object_identity of the message object being consumed.
Returns
A pointer to the message object that the caller now has ownership of.

Similar to accept, but is always preceded by a call to reserve.

Implements Concurrency::source_block< single_link_registry< ITarget< _Type > > >.

8393  {
8394  return accept_message(_MsgId);
8395  }
virtual message< _Type > * accept_message(runtime_object_identity _MsgId)
Accepts a message that was offered by this timer messaging block, transferring ownership to the calle...
Definition: agents.h:8337
template<class _Type >
virtual void Concurrency::timer< _Type >::link_target_notification ( _Inout_ ITarget< _Type > *  _PTarget)
inlineprotectedvirtual

A callback that notifies that a new target has been linked to this timer messaging block.

Parameters
_PTargetA pointer to the newly linked target.
8433  {
8434  // If there is a timer message sitting around, it must be propagated to the target now.
8435 
8436  if (_M_pMessage != NULL)
8437  {
8438  _PTarget->propagate(_M_pMessage, this);
8439  }
8440  }
#define NULL
Definition: vcruntime.h:236
message< _Type > * _M_pMessage
Definition: agents.h:8462
template<class _Type >
timer const& Concurrency::timer< _Type >::operator= ( timer< _Type > const &  )
private
template<class _Type >
void Concurrency::timer< _Type >::pause ( )
inline

Stops the timer messaging block. If it is a repeating timer messaging block, it can be restarted with a subsequent start() call. For non-repeating timers, this has the same effect as a stop call.

8304  {
8305  //
8306  // Non repeating timers cannot pause. They go to a final stopped state on pause.
8307  //
8308  if (!_M_fRepeating)
8309  {
8310  stop();
8311  }
8312  else
8313  {
8314  // Pause only a started timer.
8315 
8316  if (_M_state == Started)
8317  {
8318  _Stop();
8319  _M_state = Paused;
8320  }
8321  }
8322  }
void stop()
Stops the timer messaging block.
Definition: agents.h:8290
State _M_state
Definition: agents.h:8465
The timer has started and been paused.
Definition: agents.h:8137
The timer has been started.
Definition: agents.h:8132
bool _M_fRepeating
Definition: agents.h:8471
template<class _Type >
virtual void Concurrency::timer< _Type >::propagate_to_any_targets ( _Inout_opt_ message< _Type > *  )
inlineprotectedvirtual

Tries to offer the message produced by the timer block to all of the linked targets.

8447  {
8448  if (_M_pMessage == NULL)
8449  {
8451  for (target_iterator _Iter = this->_M_connectedTargets.begin(); *_Iter != NULL; ++_Iter)
8452  {
8453  ITarget<_Type> * _PTarget = *_Iter;
8454  _PTarget->propagate(_M_pMessage, this);
8455  }
8456  }
8457  }
single_link_registry< ITarget< _Type > >::iterator target_iterator
The iterator to walk the connected targets.
Definition: agents.h:4893
#define NULL
Definition: vcruntime.h:236
single_link_registry< ITarget< _Type > > _M_connectedTargets
Connected targets
Definition: agents.h:5484
message< _Type > * _NewMessage() const
Allocates a new message.
Definition: agents.h:8483
message< _Type > * _M_pMessage
Definition: agents.h:8462
template<class _Type >
virtual void Concurrency::timer< _Type >::release_message ( runtime_object_identity  _MsgId)
inlineprotectedvirtual

Releases a previous message reservation.

Parameters
_MsgIdThe runtime_object_identity of the message object being released.

Implements Concurrency::source_block< single_link_registry< ITarget< _Type > > >.

8405  {
8406  if (_M_pMessage == NULL || _M_pMessage->msg_id() != _MsgId)
8407  {
8408  throw message_not_found();
8409  }
8410 
8411  delete _M_pMessage;
8412  _M_pMessage = NULL;
8413  }
#define NULL
Definition: vcruntime.h:236
message< _Type > * _M_pMessage
Definition: agents.h:8462
template<class _Type >
virtual bool Concurrency::timer< _Type >::reserve_message ( runtime_object_identity  _MsgId)
inlineprotectedvirtual

Reserves a message previously offered by this timer messaging block.

Parameters
_MsgIdThe runtime_object_identity of the message object being reserved.
Returns
true if the message was successfully reserved, false otherwise.

After reserve is called, if it returns true, either consume or release must be called to either take or release ownership of the message.

Implements Concurrency::source_block< single_link_registry< ITarget< _Type > > >.

8365  {
8366  //
8367  // Semantically, every timer tick is the same value -- it doesn't matter the message ID. Because we can only
8368  // have one target as well, we do not need to track anything here.
8369  //
8370  if (_M_pMessage == NULL || _M_pMessage->msg_id() != _MsgId)
8371  {
8372  return false;
8373  }
8374 
8375  return true;
8376  }
#define NULL
Definition: vcruntime.h:236
message< _Type > * _M_pMessage
Definition: agents.h:8462
template<class _Type >
virtual void Concurrency::timer< _Type >::resume_propagation ( )
inlineprotectedvirtual

Resumes propagation after a reservation has been released.

Implements Concurrency::source_block< single_link_registry< ITarget< _Type > > >.

8420  {
8421  // Because reservation doesn't prevent propagation there is
8422  // no need to resume on consume/release.
8423  }
template<class _Type >
void Concurrency::timer< _Type >::start ( )
inline

Starts the timer messaging block. The specified number of milliseconds after this is called, the specified value will be propagated downstream as a message.

8278  {
8279  if (_M_state == Initialized || _M_state == Paused)
8280  {
8281  _M_state = Started;
8282  _Start();
8283  }
8284  }
State _M_state
Definition: agents.h:8465
_CONCRTIMP void _Start()
The timer has been initialized, but not yet started.
Definition: agents.h:8127
The timer has started and been paused.
Definition: agents.h:8137
The timer has been started.
Definition: agents.h:8132
template<class _Type >
void Concurrency::timer< _Type >::stop ( )
inline

Stops the timer messaging block.

8291  {
8292  if (_M_state == Started)
8293  _Stop();
8294 
8295  _M_state = Stopped;
8296  }
State _M_state
Definition: agents.h:8465
The timer has been started.
Definition: agents.h:8132
The timer has been stopped.
Definition: agents.h:8142

Member Data Documentation

template<class _Type >
bool Concurrency::timer< _Type >::_M_fReferencedScheduler
private
template<class _Type >
bool Concurrency::timer< _Type >::_M_fRepeating
private
template<class _Type >
message<_Type>* Concurrency::timer< _Type >::_M_pMessage
private
template<class _Type >
Scheduler* Concurrency::timer< _Type >::_M_pScheduler
private
template<class _Type >
State Concurrency::timer< _Type >::_M_state
private
template<class _Type >
_Type Concurrency::timer< _Type >::_M_value
private

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