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

The basic message envelope containing the data payload being passed between messaging blocks. More...

#include <agents.h>

Inheritance diagram for Concurrency::message< _Type >:
Concurrency::details::_Runtime_object Concurrency::details::_AllocBase

Public Types

typedef _Type type
 A type alias for _Type . More...
 

Public Member Functions

 message (_Type const &_P)
 Constructs a message object. More...
 
 message (_Type const &_P, runtime_object_identity _Id)
 Constructs a message object. More...
 
 message (message const &_Msg)
 Constructs a message object. More...
 
 message (_In_ message const *_Msg)
 Constructs a message object. More...
 
virtual ~message ()
 Destroys the message object. More...
 
runtime_object_identity msg_id () const
 Returns the ID of the message object. More...
 
long add_ref ()
 Adds to the reference count for the message object. Used for message blocks that need reference counting to determine message lifetimes. More...
 
long remove_ref ()
 Subtracts from the reference count for the message object. Used for message blocks that need reference counting to determine message lifetimes. More...
 
- Public Member Functions inherited from Concurrency::details::_Runtime_object
_CRTIMP2 _Runtime_object ()
 
_CRTIMP2 _Runtime_object (::Concurrency::runtime_object_identity _Id)
 
virtual ::Concurrency::runtime_object_identity _GetId () const
 
- Public Member Functions inherited from Concurrency::details::_AllocBase
voidoperator new (size_t _Size)
 
void operator delete (void *_Ptr) throw ()
 
voidoperator new (size_t _Size, const std::nothrow_t &) throw ()
 
void operator delete (void *_Ptr, const std::nothrow_t &) throw ()
 
voidoperator new[] (size_t _Size)
 
void operator delete[] (void *_Ptr) throw ()
 
voidoperator new[] (size_t _Size, const std::nothrow_t &_No_throw) throw ()
 
void operator delete[] (void *_Ptr, const std::nothrow_t &_No_throw) throw ()
 
voidoperator new (size_t, void *_Location) throw ()
 
void operator delete (void *, void *) throw ()
 
void *__cdecl operator new[] (size_t, void *_Location) throw ()
 
void __cdecl operator delete[] (void *, void *) throw ()
 

Public Attributes

_Type const payload
 The payload of the message object. More...
 

Private Member Functions

message< _Type > const & operator= (message< _Type > const &)
 

Private Attributes

message_M_pNext
 
volatile long _M_refCount
 

Friends

class ::Concurrency::details::_Queue< message< _Type > >
 

Additional Inherited Members

- Protected Attributes inherited from Concurrency::details::_Runtime_object
::Concurrency::runtime_object_identity _M_id
 

Detailed Description

template<class _Type>
class Concurrency::message< _Type >

The basic message envelope containing the data payload being passed between messaging blocks.

Template Parameters
_TypeThe data type of the payload within the message.

For more information, see Asynchronous Message Blocks.

Member Typedef Documentation

template<class _Type>
typedef _Type Concurrency::message< _Type >::type

A type alias for _Type .

Constructor & Destructor Documentation

template<class _Type>
Concurrency::message< _Type >::message ( _Type const &  _P)
inline

Constructs a message object.

Parameters
_PThe payload of this message.

The constructor that takes a pointer to a message object as an argument throws an invalid_argument exception if the parameter _Msg is NULL.

1792 : payload(_P), _M_pNext(NULL), _M_refCount(0) { }
#define NULL
Definition: crtdbg.h:30
volatile long _M_refCount
Definition: agents.h:1912
_Type const payload
The payload of the message object.
Definition: agents.h:1869
message * _M_pNext
Definition: agents.h:1906
template<class _Type>
Concurrency::message< _Type >::message ( _Type const &  _P,
runtime_object_identity  _Id 
)
inline

Constructs a message object.

Parameters
_PThe payload of this message.
_IdThe unique ID of this message.

The constructor that takes a pointer to a message object as an argument throws an invalid_argument exception if the parameter _Msg is NULL.

1811  {
1812  }
#define NULL
Definition: crtdbg.h:30
volatile long _M_refCount
Definition: agents.h:1912
_Type const payload
The payload of the message object.
Definition: agents.h:1869
message * _M_pNext
Definition: agents.h:1906
template<class _Type>
Concurrency::message< _Type >::message ( message< _Type > const &  _Msg)
inline

Constructs a message object.

Parameters
_MsgA reference or pointer to a message object.

The constructor that takes a pointer to a message object as an argument throws an invalid_argument exception if the parameter _Msg is NULL.

1826 : payload(_Msg.payload), _M_pNext(NULL), _M_refCount(0) { }
#define NULL
Definition: crtdbg.h:30
volatile long _M_refCount
Definition: agents.h:1912
_Type const payload
The payload of the message object.
Definition: agents.h:1869
message * _M_pNext
Definition: agents.h:1906
template<class _Type>
Concurrency::message< _Type >::message ( _In_ message< _Type > const *  _Msg)
inline

Constructs a message object.

Parameters
_MsgA reference or pointer to a message object.

This method throws an invalid_argument exception if the parameter _Msg is NULL.

1839  : payload((_Msg == NULL) ? NULL : _Msg->payload), _M_pNext(NULL), _M_refCount(0)
1840  {
1841  if (_Msg == NULL)
1842  {
1843  throw std::invalid_argument("_Msg");
1844  }
1845  }
#define NULL
Definition: crtdbg.h:30
volatile long _M_refCount
Definition: agents.h:1912
_Type const payload
The payload of the message object.
Definition: agents.h:1869
message * _M_pNext
Definition: agents.h:1906
template<class _Type>
virtual Concurrency::message< _Type >::~message ( )
inlinevirtual

Destroys the message object.

1851 { }

Member Function Documentation

template<class _Type>
long Concurrency::message< _Type >::add_ref ( )
inline

Adds to the reference count for the message object. Used for message blocks that need reference counting to determine message lifetimes.

Returns
The new value of the reference count.
1880  {
1882  }
volatile long _M_refCount
Definition: agents.h:1912
long __cdecl _InterlockedIncrement(long volatile *)
template<class _Type>
runtime_object_identity Concurrency::message< _Type >::msg_id ( ) const
inline

Returns the ID of the message object.

Returns
The runtime_object_identity of the message object.
1861  {
1862  return _M_id;
1863  }
::Concurrency::runtime_object_identity _M_id
Definition: agents.h:100
template<class _Type>
message<_Type> const& Concurrency::message< _Type >::operator= ( message< _Type > const &  )
private
template<class _Type>
long Concurrency::message< _Type >::remove_ref ( )
inline

Subtracts from the reference count for the message object. Used for message blocks that need reference counting to determine message lifetimes.

Returns
The new value of the reference count.
1893  {
1895  }
volatile long _M_refCount
Definition: agents.h:1912
long __cdecl _InterlockedDecrement(long volatile *)

Friends And Related Function Documentation

template<class _Type>
friend class ::Concurrency::details::_Queue< message< _Type > >
friend

Member Data Documentation

template<class _Type>
message* Concurrency::message< _Type >::_M_pNext
private
template<class _Type>
volatile long Concurrency::message< _Type >::_M_refCount
private
template<class _Type>
_Type const Concurrency::message< _Type >::payload

The payload of the message object.


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