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 |
---|---|
Overloaded. Constructs an agent. |
|
Destroys the agent. |
Public Methods
Name |
Description |
---|---|
Moves an agent from either the agent_created or agent_runnable states to the agent_canceled state. |
|
Moves an agent from the agent_created state to the agent_runnable state, and schedules it for execution. |
|
A synchronous source of status information from the agent. |
|
An asynchronous source of status information from the agent. |
|
Waits for an agent to complete its task. |
|
Waits for all of the specified agents to complete their tasks. |
|
Waits for any one of the specified agents to complete its task. |
Protected Methods
Name |
Description |
---|---|
Moves an agent into the agent_done state, indicating that the agent has completed. |
|
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