共用方式為


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;

Members

Public Constructors

Name

Description

agent::agent Constructor

Overloaded. Constructs an agent.

agent::~agent Destructor

Destroys the agent.

Public Methods

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.

Protected Methods

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.

Remarks

For more information, see Asynchronous Agents.

Inheritance Hierarchy

agent

Requirements

Header: agents.h

Namespace: concurrency

See Also

Reference

concurrency Namespace