|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object MsgQueue
public class MsgQueue
MsgQueue is a channel for messages sent by robotic agents across a network. Each message is of type IMsg. There will be one message queue for each directed edge in a proximity graph or two for each undirected edge. See Lynch for details. Copying of message queues from graph induced by proximity graph at one point in statespace to the next is handled by calling the proper graph construction functions from implementations of IProximityGraphFunction.
Nested Class Summary | |
---|---|
protected class |
MsgQueue.MsgListNode
Subclass to implement linked list of messages. |
Constructor Summary | |
---|---|
MsgQueue()
Constructor |
|
MsgQueue(MsgQueue src)
Constructor : correct. |
Method Summary | |
---|---|
IMsgChannel |
makeCopy()
clone function for IMsgChannel interface. |
IMsgChannel |
makeLazyCopy()
Clone function for IMsgChannel interface : Note the Lisp-like lazy internal copy semantics: This reflects the design intent of modelling discrete state transitions inspired by the functional paradigm, while modeling continuous-time state using the array-based programming paradigm (see http://en.wikipedia.org/wiki/Array-based_programming) |
IMsg |
readMsg()
Read a message, alter state of this queue States of queues which share data are not altered. |
IMsgChannel |
sendMsg(IMsg msg)
Add a message to the back of the queue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MsgQueue()
Constructor
public MsgQueue(MsgQueue src)
Constructor : correct.
src
- Allows this message queue to be constructed from an existing
one.Method Detail |
---|
public IMsgChannel makeCopy()
makeCopy
in interface IMsgChannel
public IMsgChannel makeLazyCopy()
Clone function for IMsgChannel interface : Note the Lisp-like lazy internal copy semantics: This reflects the design intent of modelling discrete state transitions inspired by the functional paradigm, while modeling continuous-time state using the array-based programming paradigm (see http://en.wikipedia.org/wiki/Array-based_programming)
Also note that this sets m_bCopyOnWrite for the src queue, and not for this queue. The intent is that the copied queue will be written to more frequently then the source queue, and the extra bookkeeping is only there to make the queues semantically correct.
makeLazyCopy
in interface IMsgChannel
public IMsgChannel sendMsg(IMsg msg)
Add a message to the back of the queue
If bugs occur, pay attention to nasty bookeeping required to handle "read the last item sent" events.
sendMsg
in interface IMsgChannel
msg
- is the message to be sent
public IMsg readMsg()
Read a message, alter state of this queue States of queues which share data are not altered. Garbage-collection ensures discarded head nodes are deletedif no sharing queue needs them.
readMsg
in interface IMsgChannel
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |