24 #include <co/object.h>
29 namespace detail {
class Barrier; }
66 const uint128_t& masterNodeID,
67 const uint32_t height = 0 );
93 CO_API
void setHeight(
const uint32_t height );
113 CO_API
bool enter(
const uint32_t timeout = LB_TIMEOUT_INDEFINITE );
119 void attach(
const uint128_t&
id,
const uint32_t instanceID )
override;
129 detail::Barrier*
const _impl;
131 void _cleanup(
const uint64_t time );
132 void _sendNotify(
const uint128_t& version,
NodePtr node );
135 bool _cmdEnter(
ICommand& command );
136 bool _cmdEnterReply(
ICommand& command );
138 LB_TS_VAR( _thread );
142 #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.
Object-oriented network library.
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 bool enter(const uint32_t timeout=LB_TIMEOUT_INDEFINITE)
Enter the barrier, blocks until the barrier has been reached.