A networked, versioned barrier. More...
#include <barrier.h>


Public Member Functions | |
| Barrier (NodePtr master, const uint32_t height=0) | |
| Construct a new barrier. | |
| Barrier () | |
| Construct a new barrier, to be mapped to the master version. | |
| virtual | ~Barrier () |
| Destruct the barrier. | |
Data Access | |
| void | setHeight (const uint32_t height) |
| Set the number of participants in the barrier. | |
| void | increase () |
| Add one participant to the barrier. | |
| uint32_t | getHeight () const |
Operations | |
| void | enter () |
| Enter the barrier, blocks until the barrier has been reached. | |
Protected Member Functions | |
| virtual void | attachToSession (const uint32_t id, const uint32_t instanceID, Session *session) |
| Called when object is attached to session. | |
| virtual ChangeType | getChangeType () const |
| virtual void | getInstanceData (DataOStream &os) |
| Serialize the instance information about this managed object. | |
| virtual void | applyInstanceData (DataIStream &is) |
| Deserialize the instance data. | |
| virtual void | pack (DataOStream &os) |
| Serialize the modifications since the last call to commit(). | |
| virtual void | unpack (DataIStream &is) |
| Deserialize a change. | |
A networked, versioned barrier.
Definition at line 34 of file barrier.h.
| eq::net::Barrier::Barrier | ( | NodePtr | master, | |
| const uint32_t | height = 0 | |||
| ) |
Construct a new barrier.
The master node will maintain the barrier state. It has to be reachable from all other nodes participating in the barrier.
This instance should be registered as the master version of the barrier with the session. Note the node of the object master, i.e., this instance, and the barrier master node might be different.
Definition at line 35 of file barrier.cpp.
References EQINFO, and eq::base::UUID::ZERO.
| eq::net::Barrier::Barrier | ( | ) |
Construct a new barrier, to be mapped to the master version.
Definition at line 44 of file barrier.cpp.
References EQINFO.
| eq::net::Barrier::~Barrier | ( | ) | [virtual] |
Destruct the barrier.
Definition at line 49 of file barrier.cpp.
| void eq::net::Barrier::setHeight | ( | const uint32_t | height | ) | [inline] |
Set the number of participants in the barrier.
Definition at line 63 of file barrier.h.
Referenced by eq::server::Node::getBarrier().

| void eq::net::Barrier::increase | ( | ) | [inline] |
Add one participant to the barrier.
Definition at line 66 of file barrier.h.
Referenced by eq::server::Window::joinNVSwapBarrier(), and eq::server::Window::joinSwapBarrier().

| uint32_t eq::net::Barrier::getHeight | ( | ) | const [inline] |
Definition at line 69 of file barrier.h.
Referenced by eq::server::Compound::update().

| void eq::net::Barrier::enter | ( | ) |
Enter the barrier, blocks until the barrier has been reached.
The implementation assumes that the master node instance also enters the barrier.
Definition at line 92 of file barrier.cpp.
References EQLOG, eq::base::Monitor< T >::get(), eq::net::Object::getID(), eq::net::Session::getLocalNode(), eq::net::Object::getSession(), eq::net::Object::getVersion(), eq::base::RefPtr< T >::isValid(), eq::net::Object::send(), eq::base::Monitor< T >::waitEQ(), and eq::base::UUID::ZERO.

| void eq::net::Barrier::attachToSession | ( | const uint32_t | id, | |
| const uint32_t | instanceID, | |||
| Session * | session | |||
| ) | [protected, virtual] |
Called when object is attached to session.
For internal use only.
Reimplemented from eq::net::Object.
Definition at line 77 of file barrier.cpp.
References eq::net::Session::getCommandThreadQueue(), and eq::net::Dispatcher::registerCommand().

| virtual ChangeType eq::net::Barrier::getChangeType | ( | ) | const [inline, protected, virtual] |
Reimplemented from eq::net::Object.
Definition at line 87 of file barrier.h.
References eq::net::Object::DELTA.
| void eq::net::Barrier::getInstanceData | ( | DataOStream & | os | ) | [protected, virtual] |
Serialize the instance information about this managed object.
The default implementation uses the data provided by setInstanceData.
| os | The output stream. |
Implements eq::net::Object.
Definition at line 56 of file barrier.cpp.
| void eq::net::Barrier::applyInstanceData | ( | DataIStream & | is | ) | [protected, virtual] |
Deserialize the instance data.
This method is called during object mapping to populate slave instances with the master object's data. The default implementation writes the data into the memory declared by setInstanceData.
| is | the input stream. |
Implements eq::net::Object.
Definition at line 61 of file barrier.cpp.
| void eq::net::Barrier::pack | ( | DataOStream & | os | ) | [protected, virtual] |
Serialize the modifications since the last call to commit().
No new version will be created if no data is written to the ostream. The default implementation uses the data provided by setDeltaData or setInstanceData.
| os | the output stream. |
Reimplemented from eq::net::Object.
Definition at line 66 of file barrier.cpp.
| void eq::net::Barrier::unpack | ( | DataIStream & | is | ) | [protected, virtual] |
Deserialize a change.
The default implementation writes the data into the memory declared by setDeltaData or setInstanceData.
| is | the input data stream. |
Reimplemented from eq::net::Object.
Definition at line 71 of file barrier.cpp.
0.9.1 by
1.6.1