24 #include <co/object.h>
29 namespace detail {
class Barrier; }
71 const uint128_t& masterNodeID,
72 const uint32_t height = 0 );
98 CO_API
void setHeight(
const uint32_t height );
117 CO_API
void enter(
const uint32_t timeout = LB_TIMEOUT_INDEFINITE );
123 void attach(
const uint128_t&
id,
const uint32_t instanceID )
override;
133 detail::Barrier*
const _impl;
135 void _cleanup(
const uint64_t time );
136 void _sendNotify(
const uint128_t& version,
NodePtr node );
139 bool _cmdEnter(
ICommand& command );
140 bool _cmdEnterReply(
ICommand& command );
142 LB_TS_VAR( _thread );
146 #endif // CO_BARRIER_H
lunchbox::RefPtr< LocalNode > LocalNodePtr
A reference pointer for LocalNode pointers.
A helper struct bundling an object identifier and version.
void pack(DataOStream &os) override
Serialize the modifications since the last call to commit().
void getInstanceData(DataOStream &os) override
Serialize all instance information of this distributed object.
ChangeType
Object change handling characteristics, see Programming Guide.
CO_API uint32_t getHeight() const
CO_API bool isAttached() const
CO_API void setHeight(const uint32_t height)
Set the number of participants in the barrier.
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
A std::ostream-like interface for object serialization.
CO_API void increase()
Add one participant to the barrier.
void applyInstanceData(DataIStream &is) override
Deserialize the instance data.
A class managing received commands.
void unpack(DataIStream &is) override
Deserialize a change.
CO_API Barrier(LocalNodePtr localNode, const uint128_t &masterNodeID, const uint32_t height=0)
Construct and register a new distributed barrier.
virtual CO_API ~Barrier()
Destruct the barrier.
A std::istream-like input data stream for binary data.
ChangeType getChangeType() const override
A networked, versioned barrier.
CO_API void enter(const uint32_t timeout=LB_TIMEOUT_INDEFINITE)
Enter the barrier, blocks until the barrier has been reached.