A context is a node within a tree that represents deadlines and key/value pairs.
#include <context.hpp>
◆ Context()
Azure::Core::Context::Context |
( |
| ) |
|
|
inline |
◆ Cancel()
void Azure::Core::Context::Cancel |
( |
| ) |
|
|
inline |
◆ GetDeadline()
- Returns
- The deadline associated with the context;
Azure::DateTime::max()
if no deadline is specified.
◆ IsCancelled()
bool Azure::Core::Context::IsCancelled |
( |
| ) |
const |
|
inline |
- Returns
true
if this context is cancelled; otherwise, false
.
◆ operator=()
- Parameters
-
other | Another instance to copy. |
- Returns
- A reference to this
Context
.
◆ ThrowIfCancelled()
void Azure::Core::Context::ThrowIfCancelled |
( |
| ) |
const |
|
inline |
◆ TryGetValue()
template<class T >
bool Azure::Core::Context::TryGetValue |
( |
Key const & |
key, |
|
|
T & |
outputValue |
|
) |
| const |
|
inline |
- Template Parameters
-
T | The type of the value to be retrieved. |
- Parameters
-
key | A key associated with a context to find. |
outputValue | A reference to the value corresponding to the key to be set, if found within the context tree. |
- Returns
true
if key
is found, with outputValue
set to the value associated with the key found; otherwise, false
.
- Note
- The
outputValue
is left unmodified if the key
is not found.
◆ WithDeadline()
Context Azure::Core::Context::WithDeadline |
( |
DateTime const & |
deadline | ) |
const |
|
inline |
- Parameters
-
deadline | A point in time after which a context expires. |
- Returns
- A child context with deadline.
◆ WithValue()
template<class T >
Context Azure::Core::Context::WithValue |
( |
Key const & |
key, |
|
|
T && |
value |
|
) |
| const |
|
inline |
- Template Parameters
-
T | The type of the value to be stored with the key. |
- Parameters
-
key | A key to associate with this context. |
value | A value to associate with this context. |
- Returns
- A child context with no deadline and the
key
and value
associated with it.
◆ ApplicationContext
Context Context::ApplicationContext |
|
static |
The documentation for this class was generated from the following files: