Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

EntryPoint Class Reference

#include <EntryPoint.h>

Inheritance diagram for EntryPoint:

List of all members.


Detailed Description

manages a thread lock to serialize behavior computation and mark whether state is being read or written

Definition at line 10 of file EntryPoint.h.


Public Member Functions

 EntryPoint (WorldStatePool &wspool)
 constructor, need to specify the WorldStatePool (presumably it's in a shared memory region...)
virtual void useResource (Data &d)
 an EmptyData implies a WorldStateRead should be passed on to the pool, requesting a write requires a WorldStateWrite to be passed
virtual void releaseResource (Data &d)
 an EmptyData implies a WorldStateRead should be passed on to the pool, requesting a write requires a WorldStateWrite to be passed
ThreadNS::LockgetLock ()
 this can be useful when planning to write, get the threadlock to do some initial setup before grabbing an entry from the pool

Public Attributes

WorldStateRead defaultRead
 this instance will be used if an empty Data is passed to useResource (only safe to do because we get lock first, so two threads won't be using the same data at the same time)

Protected Attributes

WorldStatePoolpool
 pool which manages which WorldStates are being updated while old copies can still be read
ThreadNS::Lock lock
 only one behavior runs at a time

Classes

class  WorldStateRead
 pass this to MarkScope when using an EntryPoint over a section which will read state More...
class  WorldStateWrite
 pass this to MarkScope when using an EntryPoint over a section which will update state More...

Constructor & Destructor Documentation

EntryPoint ( WorldStatePool wspool  )  [inline, explicit]

constructor, need to specify the WorldStatePool (presumably it's in a shared memory region...)

Definition at line 28 of file EntryPoint.h.


Member Function Documentation

virtual void useResource ( Data d  )  [inline, virtual]

an EmptyData implies a WorldStateRead should be passed on to the pool, requesting a write requires a WorldStateWrite to be passed

Implements Resource.

Definition at line 31 of file EntryPoint.h.

virtual void releaseResource ( Data d  )  [inline, virtual]

an EmptyData implies a WorldStateRead should be passed on to the pool, requesting a write requires a WorldStateWrite to be passed

Implements Resource.

Definition at line 36 of file EntryPoint.h.

ThreadNS::Lock& getLock (  )  [inline]

this can be useful when planning to write, get the threadlock to do some initial setup before grabbing an entry from the pool

Definition at line 56 of file EntryPoint.h.


Member Data Documentation

this instance will be used if an empty Data is passed to useResource (only safe to do because we get lock first, so two threads won't be using the same data at the same time)

Definition at line 18 of file EntryPoint.h.

Referenced by releaseResource(), and useResource().

WorldStatePool& pool [protected]

pool which manages which WorldStates are being updated while old copies can still be read

Definition at line 59 of file EntryPoint.h.

Referenced by releaseResource(), and useResource().

ThreadNS::Lock lock [protected]

only one behavior runs at a time

Definition at line 60 of file EntryPoint.h.

Referenced by getLock(), releaseResource(), and useResource().


The documentation for this class was generated from the following file:

Tekkotsu Hardware Abstraction Layer 4.0
Generated Thu Nov 22 01:01:20 2007 by Doxygen 1.5.4