The Robot Application Programming Interface Delegate Project
|
AgentEventCollector handles the collection and distribution of rapid events for a particular agent. More...
Public Member Functions | |
AgentEventCollector (Agent agent) | |
void | addEventListener (MessageType type, IRapidEventListener listener) throws RapidEventCollectorException |
Add a new message listener. | |
void | addEventListener (MessageType[] types, IRapidEventListener listener) throws RapidEventCollectorException |
void | removeEventListener (MessageType type, IRapidEventListener listener) |
remove listener for given MessageType | |
void | removeEventListener (MessageType[] types, IRapidEventListener listener) |
void | removeEventListener (IRapidEventListener listener) |
remove listener for all MessageTypes | |
boolean | hasReaderFor (MessageType type) |
void | messageReceived (final Agent agent, final MessageType msgType, final IRapidMessage msg) |
Callback when a message in the factory is received. | |
Protected Member Functions | |
DataReaderAdapter | createReaderFor (MessageType type) throws RapidEventCollectorException |
Create a DataReader and register with dds. | |
Protected Attributes | |
final Agent | m_agent |
final Map< MessageType, RapidEventListenerList > | m_typeToListenersMap |
final Map< MessageType, RapidDataReaderAdapter > | m_typeToReaderMap |
final ExecutorService | m_threadPool |
AgentEventCollector | ( | Agent | agent | ) |
agent |
void addEventListener | ( | MessageType | type, |
IRapidEventListener | listener | ||
) | throws RapidEventCollectorException |
If this collector does not already have a Reader listening for telemetry, one will be created and registered. If a Reader does already exist, the listener will immediately receive the last MessageType event that was read.
type | |
listener |
RapidEventCollectorException |
void addEventListener | ( | MessageType[] | types, |
IRapidEventListener | listener | ||
) | throws RapidEventCollectorException |
DataReaderAdapter createReaderFor | ( | MessageType | type | ) | throws RapidEventCollectorException [protected] |
type |
RapidEventCollectorException |
boolean hasReaderFor | ( | MessageType | type | ) |
void messageReceived | ( | final Agent | agent, |
final MessageType | msgType, | ||
final IRapidMessage | msg | ||
) |
This means that there was a message received in the DDS Pipe
void removeEventListener | ( | MessageType[] | types, |
IRapidEventListener | listener | ||
) |
void removeEventListener | ( | MessageType | type, |
IRapidEventListener | listener | ||
) |
type | |
listener |
void removeEventListener | ( | IRapidEventListener | listener | ) |
listener |
final ExecutorService m_threadPool [protected] |
final Map<MessageType,RapidEventListenerList> m_typeToListenersMap [protected] |
Collections.synchronizedMap(new HashMap<MessageType,RapidEventListenerList>())
final Map<MessageType,RapidDataReaderAdapter> m_typeToReaderMap [protected] |
Collections.synchronizedMap(new HashMap<MessageType,RapidDataReaderAdapter>())