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

An abstraction of a physical location on hardware. More...

#include <concrt.h>

Public Types

enum  _Type { _System, _NumaNode, _SchedulingNode, _ExecutionResource }
 Describes the type of the given location. More...
 

Public Member Functions

 location ()
 Constructs a location object. More...
 
 location (const location &_Src)
 Constructs a location object. More...
 
locationoperator= (const location &_Rhs)
 Assigns the contents of a different location object to this one. More...
 
 ~location ()
 Destroys a location object. More...
 
bool operator== (const location &_Rhs) const
 Determines whether two location objects represent the same location. More...
 
bool operator!= (const location &_Rhs) const
 Determines whether two location objects represent different location. More...
 
 location (_Type _LocationType, unsigned int _Id, unsigned int _BindingId=0, _Inout_opt_ void *_PBinding=NULL)
 Constructs a specific location. More...
 
bool _FastVPIntersects (const location &_Rhs) const
 Determines whether two locations have an intersection. This is a fast intersection which avoids certain checks by knowing that the this pointer is a virtual processor location for a validly bound virtual processor. More...
 
bool _FastNodeIntersects (const location &_Rhs) const
 Determines whether two locations have an intersection. This is a fast intersection which avoids certain checks by knowing that the this pointer is a node for a validly bound node. More...
 
void _Assign (const location &_Rhs)
 Assigns _Rhs to this location. More...
 
bool _Is_system () const
 Internal routine that tells whether a location represents the "system location". This indicates no specific placement. More...
 
template<typename T >
T * _As () const
 Returns the internal binding as a specified object. More...
 
unsigned int _GetId () const
 Returns the ID which this location object represents. More...
 
_Type _GetType () const
 Returns the type which this location object represents. More...
 
unsigned int _GetBindingId () const
 Gets the binding ID for this location. More...
 

Static Public Member Functions

static _CRTIMP location __cdecl current ()
 Returns a location object representing the most specific place the calling thread is executing. More...
 
static _CRTIMP location __cdecl _Current_node ()
 Returns a location representing the scheduling node that the calling thread is executing. More...
 

Private Attributes

unsigned int _M_type: 28
 
unsigned int _M_reserved: 4
 
unsigned int _M_bindingId
 
union {
   unsigned int   _M_id
 
   void *   _M_ptr
 
}; 
 
void_M_pBinding
 

Detailed Description

An abstraction of a physical location on hardware.

Member Enumeration Documentation

Describes the type of the given location.

Enumerator
_System 

Indicates that the location represents the "system location". This has no specific affinity.

_NumaNode 

Indicates that the location represents a particular NUMA node.

_SchedulingNode 

Indicates that the location represents a particular scheduling node.

_ExecutionResource 

Indicates that the location represents a paritcular execution resource.

2017  {
2021  _System, // _M_id is meaningless
2022 
2026  _NumaNode, // _M_id is the Windows NUMA node number
2027 
2031  _SchedulingNode, // _M_id is the unique identifier for the scheduling node
2032 
2036  _ExecutionResource, // _M_id is the unique identifier for the execution resource
2037  };
Indicates that the location represents a particular NUMA node.
Definition: concrt.h:2026
Indicates that the location represents a particular scheduling node.
Definition: concrt.h:2031
Indicates that the location represents a paritcular execution resource.
Definition: concrt.h:2036
Indicates that the location represents the "system location". This has no specific affinity...
Definition: concrt.h:2021

Constructor & Destructor Documentation

Concurrency::location::location ( )
inline

Constructs a location object.

A default constructed location represents the system as a whole.

1913  :
1914  _M_type(_System),
1915  _M_reserved(0),
1916  _M_pBinding(NULL),
1917  _M_ptr(NULL)
1918  {
1919  }
#define NULL
Definition: crtdbg.h:30
unsigned int _M_reserved
Definition: concrt.h:2138
void * _M_pBinding
Definition: concrt.h:2155
unsigned int _M_type
Definition: concrt.h:2135
void * _M_ptr
Definition: concrt.h:2150
Indicates that the location represents the "system location". This has no specific affinity...
Definition: concrt.h:2021
Concurrency::location::location ( const location _Src)
inline

Constructs a location object.

1926  {
1927  _Assign(_Src);
1928  }
void _Assign(const location &_Rhs)
Assigns _Rhs to this location.
Definition: concrt.h:2075
_In_ size_t _In_z_ const unsigned char * _Src
Definition: mbstring.h:95
Concurrency::location::~location ( )
inline

Destroys a location object.

1973  {
1974  }
Concurrency::location::location ( _Type  _LocationType,
unsigned int  _Id,
unsigned int  _BindingId = 0,
_Inout_opt_ void _PBinding = NULL 
)

Constructs a specific location.

Member Function Documentation

template<typename T >
T* Concurrency::location::_As ( ) const
inline

Returns the internal binding as a specified object.

2101  {
2102  return reinterpret_cast<T *>(_M_pBinding);
2103  }
void * _M_pBinding
Definition: concrt.h:2155
void Concurrency::location::_Assign ( const location _Rhs)
inline

Assigns _Rhs to this location.

2076  {
2077  _M_type = _Rhs._M_type;
2078  _M_reserved = _Rhs._M_reserved;
2079 
2080  _M_ptr = _Rhs._M_ptr;
2081 
2082  _M_bindingId = _Rhs._M_bindingId;
2083  _M_pBinding = _Rhs._M_pBinding;
2084  }
unsigned int _M_reserved
Definition: concrt.h:2138
void * _M_pBinding
Definition: concrt.h:2155
unsigned int _M_type
Definition: concrt.h:2135
void * _M_ptr
Definition: concrt.h:2150
unsigned int _M_bindingId
Definition: concrt.h:2141
static _CRTIMP location __cdecl Concurrency::location::_Current_node ( )
static

Returns a location representing the scheduling node that the calling thread is executing.

bool Concurrency::location::_FastNodeIntersects ( const location _Rhs) const

Determines whether two locations have an intersection. This is a fast intersection which avoids certain checks by knowing that the this pointer is a node for a validly bound node.

Parameters
_RhsThe location to intersect with this.
Returns
An indication as to whether the two locations intersect.
bool Concurrency::location::_FastVPIntersects ( const location _Rhs) const

Determines whether two locations have an intersection. This is a fast intersection which avoids certain checks by knowing that the this pointer is a virtual processor location for a validly bound virtual processor.

Parameters
_RhsThe location to intersect with this.
Returns
An indication as to whether the two locations intersect.
unsigned int Concurrency::location::_GetBindingId ( ) const
inline

Gets the binding ID for this location.

2128  {
2129  return _M_bindingId;
2130  }
unsigned int _M_bindingId
Definition: concrt.h:2141
unsigned int Concurrency::location::_GetId ( ) const
inline

Returns the ID which this location object represents.

2110  {
2111  return _M_id;
2112  }
unsigned int _M_id
Definition: concrt.h:2147
_Type Concurrency::location::_GetType ( ) const
inline

Returns the type which this location object represents.

2119  {
2120  return (_Type)_M_type;
2121  }
unsigned int _M_type
Definition: concrt.h:2135
_Type
Describes the type of the given location.
Definition: concrt.h:2016
bool Concurrency::location::_Is_system ( ) const
inline

Internal routine that tells whether a location represents the "system location". This indicates no specific placement.

2091  {
2092  return (_Type)_M_type == _System;
2093  }
unsigned int _M_type
Definition: concrt.h:2135
_Type
Describes the type of the given location.
Definition: concrt.h:2016
Indicates that the location represents the "system location". This has no specific affinity...
Definition: concrt.h:2021
static _CRTIMP location __cdecl Concurrency::location::current ( )
static

Returns a location object representing the most specific place the calling thread is executing.

Returns
A location representing the most specific place the calling thread is executing.
bool Concurrency::location::operator!= ( const location _Rhs) const
inline

Determines whether two location objects represent different location.

Returns
true if the two locations are different, false otherwise.
1996  {
1997  return !operator==(_Rhs);
1998  }
bool operator==(const location &_Rhs) const
Determines whether two location objects represent the same location.
Definition: concrt.h:1983
location& Concurrency::location::operator= ( const location _Rhs)
inline

Assigns the contents of a different location object to this one.

Parameters
_RhsThe source location object.
1963  {
1964  _Assign(_Rhs);
1965  return *this;
1966  }
void _Assign(const location &_Rhs)
Assigns _Rhs to this location.
Definition: concrt.h:2075
bool Concurrency::location::operator== ( const location _Rhs) const
inline

Determines whether two location objects represent the same location.

Returns
true if the two locations are identical, and false otherwise.
1984  {
1985  return (_M_type == _Rhs._M_type && _M_ptr == _Rhs._M_ptr);
1986  }
unsigned int _M_type
Definition: concrt.h:2135
void * _M_ptr
Definition: concrt.h:2150

Member Data Documentation

union { ... }
unsigned int Concurrency::location::_M_bindingId
private
unsigned int Concurrency::location::_M_id
void* Concurrency::location::_M_pBinding
private
void* Concurrency::location::_M_ptr
unsigned int Concurrency::location::_M_reserved
private
unsigned int Concurrency::location::_M_type
private

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