Platform::Agile Class

Represents an object that has a MashalingBehavior=Standard as an agile object, which greatly reduces the chances for runtime threading exceptions. The Agile<T> enables the non-agile object to call, or be called from, the same or a different thread. For more information, see Threading and Marshaling (C++/CX).

template <typename T>
    class Agile
;

T

The typename for the non-agile class.

Most of the classes in the Windows Runtime are agile. An agile object can call, or be called by, an in-proc or out-of-proc object in the same or a different thread. If an object is not agile, wrap the non-agile object in a Agile<T> object, which is agile. Then the Agile<T> object can be marshaled, and the underlying non-agile object can be used.

The Agile<T> class is a native, standard C++ class and requires agile.h. It represents the non-agile object and the Agile object's context. The context specifies an agile object's threading model and marshaling behavior. The operating system uses the context to determine how to marshal an object.

Name

Description

Agile::Agile Constructor

Initializes a new instance of the Agile class.

Agile::~Agile Destructor

Destroys the current instance of the Agile class.

Name

Description

Agile::Get

Returns a handle to the object that is represented by the current Agile object.

Agile::GetAddressOf

Reinitializes the current Agile object, and then returns the address of a handle to an object of type T.

Agile::GetAddressOfForInOut

Returns the address of a handle to the object represented by the current Agile object.

Agile::Release

Discards the current Agile object's underlying object and context.

Name

Description

Agile::operator->

Retrieves a handle to the object represented by the current Agile object.

Agile::operator=

Assigns the specified value to the current Agile object.

Object

   Agile

Minimum supported client: Windows 8

Minimum supported server: Windows Server 2012

Namespace: Platform

Header: agile.h

Other Resources

Platform Namespace
Show:
© 2014 Microsoft