Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

agent Class

A class intended to be used as a base class for all independent agents. It is used to hide state from other agents and interact using message-passing.

class agent;

Name

Description

agent::agent Constructor

Overloaded. Constructs an agent.

agent::~agent Destructor

Destroys the agent.

Name

Description

agent::cancel Method

Moves an agent from either the agent_created or agent_runnable states to the agent_canceled state.

agent::start Method

Moves an agent from the agent_created state to the agent_runnable state, and schedules it for execution.

agent::status Method

A synchronous source of status information from the agent.

agent::status_port Method

An asynchronous source of status information from the agent.

agent::wait Method

Waits for an agent to complete its task.

agent::wait_for_all Method

Waits for all of the specified agents to complete their tasks.

agent::wait_for_one Method

Waits for any one of the specified agents to complete its task.

Name

Description

agent::done Method

Moves an agent into the agent_done state, indicating that the agent has completed.

agent::run Method

Represents the main task of an agent. run should be overridden in a derived class, and specifies what the agent should do after it has been started.

For more information, see Asynchronous Agents.

Header: agents.h

Namespace: concurrency

Show:
© 2014 Microsoft