This documentation is archived and is not being maintained.

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 via message-passing.

class agent;

Public Constructors



agent::agent Constructor

Overloaded. Constructs an agent.

agent::~agent Destructor

Destroys the agent.

Public Methods



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



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