Utility class to cache node address and address size.
Constructor and description |
---|
NodeAddressCache
(Agent agent, boolean lazy) Creates a node address cache. |
Type Params | Return Type | Name and description |
---|---|---|
|
Integer |
getAddress() Gets node address. |
|
Integer |
getAddressSize() Gets node address size. |
|
Integer |
getCachedAddress() Gets node address from cache. |
|
boolean |
update(Message msg) Updates node address based on ParamChangeNtf. |
|
protected void |
update() |
Creates a node address cache. If the getAddress() method is called from a non-agent thread, make sure that lazy is disabled, as lazy fetch cannot be done from a non-agent thread.
agent
- ownerlazy
- true to delay fetch until needed, false to pre-fetchGets node address.
Gets node address size.
Gets node address from cache.
Updates node address based on ParamChangeNtf. This method must be called from the UnetAgent.processMessage method of the agent to update node address or size if changed.
msg
- message passed to processMessage()Copyright 2013-21, Acoustic Research Laboratory, National University of Singapore, and Subnero Pte Ltd