Equalizer
1.4.1
|
Base data transport class for segments. More...
#include <segment.h>
Public Member Functions | |
Data Access | |
const C * | getCanvas () const |
C * | getCanvas () |
const Viewport & | getViewport () const |
EQFABRIC_INL void | setViewport (const Viewport &vp) |
void | setChannel (CH *channel) |
CH * | getChannel () |
Return the output channel of this segment. | |
const CH * | getChannel () const |
Return the output channel of this segment. | |
virtual EQFABRIC_INL void | setWall (const Wall &wall) |
Set the frustum using a wall description. | |
virtual EQFABRIC_INL void | setProjection (const Projection &) |
Set the frustum using a projection description. | |
virtual EQFABRIC_INL void | unsetFrustum () |
Set the last specified frustum to TYPE_NONE. | |
uint32_t | getEyes () const |
EQFABRIC_INL void | setEyes (const uint32_t eyes) |
void | enableEye (const uint32_t eyes) |
EQFABRIC_INL void | setSwapBarrier (SwapBarrierPtr barrier) |
SwapBarrierConstPtr | getSwapBarrier () const |
SwapBarrierPtr | getSwapBarrier () |
Operations | |
EQFABRIC_INL VisitorResult | accept (Visitor &visitor) |
Traverse this segment using a segment visitor. | |
EQFABRIC_INL VisitorResult | accept (Visitor &visitor) const |
Const-version of accept(). | |
void | notifyFrustumChanged () |
virtual void | backup () |
virtual void | restore () |
virtual uint128_t | commit (const uint32_t incarnation=CO_COMMIT_NEXT) |
Commit a new version of this object. | |
Public Types | |
typedef LeafVisitor< S > | Visitor |
The segment visitor type. | |
Protected Member Functions | |
EQFABRIC_INL | Segment (C *canvas) |
virtual EQFABRIC_INL void | serialize (co::DataOStream &os, const uint64_t dirtyBits) |
Worker for pack() and getInstanceData(). | |
virtual EQFABRIC_INL void | deserialize (co::DataIStream &is, const uint64_t dirtyBits) |
Worker for unpack() and applyInstanceData(). | |
virtual void | setDirty (const uint64_t bits) |
Add dirty flags to mark data for distribution. | |
virtual uint64_t | getRedistributableBits () const |
Protected Types | |
enum | DirtyBits { DIRTY_VIEWPORT = Object::DIRTY_CUSTOM << 0, DIRTY_FRUSTUM = Object::DIRTY_CUSTOM << 1, DIRTY_CHANNEL = Object::DIRTY_CUSTOM << 2, DIRTY_EYES = Object::DIRTY_CUSTOM << 3, DIRTY_SEGMENT_BITS } |
The changed parts of the object since the last pack(). More... |
Base data transport class for segments.
Definition at line 34 of file fabric/segment.h.
typedef LeafVisitor< S > eq::fabric::Segment< C, S, CH >::Visitor |
enum eq::fabric::Segment::DirtyBits [protected] |
The changed parts of the object since the last pack().
Subclasses should define their own bits, starting at DIRTY_CUSTOM.
Reimplemented from eq::fabric::Object.
Definition at line 172 of file fabric/segment.h.
EQFABRIC_INL VisitorResult eq::fabric::Segment< C, S, CH >::accept | ( | Visitor & | visitor | ) |
Traverse this segment using a segment visitor.
visitor | the visitor. |
EQFABRIC_INL VisitorResult eq::fabric::Segment< C, S, CH >::accept | ( | Visitor & | visitor | ) | const |
Const-version of accept().
virtual uint128_t eq::fabric::Segment< C, S, CH >::commit | ( | const uint32_t | incarnation = CO_COMMIT_NEXT | ) | [virtual] |
Commit a new version of this object.
Objects using the change type STATIC can not be committed.
Master instances will increment new versions continously, starting at VERSION_FIRST. If the object has not changed, no new version will be generated, that is, the current version is returned. The high value of the returned version will always be 0.
Slave objects can be commited, but have certain caveats for serialization. Please refer to the Programming Guide for more details. Slave object commits will return a random version on a successful commit, or VERSION_NONE if the object has not changed since the last commit. The high value of a successful commit will never be 0.
The incarnation count is meaningful for buffered master objects. The commit implementation will keep all instance data committed with an incarnation count newer than current_incarnation - getAutoObsolete()
. By default, each call to commit creates a new incarnation, retaining the data from last getAutoObsolete() commit calls. When the application wishes to auto obsolete by another metric than commit calls, it has to consistently provide an incarnation counter. Buffers with a higher incarnation count than the current are discarded. A typical use case is to tie the auto obsoletion to an application-specific frame loop. Decreasing the incarnation counter will lead to undefined results.
incarnation | the commit incarnation for auto obsoletion. |
Reimplemented from eq::fabric::Object.
virtual EQFABRIC_INL void eq::fabric::Segment< C, S, CH >::deserialize | ( | co::DataIStream & | , |
const uint64_t | |||
) | [protected, virtual] |
Worker for unpack() and applyInstanceData().
This function is called with the dirty bits send by the master instance. The dirty bits are received beforehand, and do not need to be deserialized by the overriding method.
Reimplemented from eq::fabric::Object.
const C* eq::fabric::Segment< C, S, CH >::getCanvas | ( | ) | const [inline] |
C* eq::fabric::Segment< C, S, CH >::getCanvas | ( | ) | [inline] |
CH* eq::fabric::Segment< C, S, CH >::getChannel | ( | ) | [inline] |
Return the output channel of this segment.
Definition at line 76 of file fabric/segment.h.
const CH* eq::fabric::Segment< C, S, CH >::getChannel | ( | ) | const [inline] |
Return the output channel of this segment.
Definition at line 79 of file fabric/segment.h.
uint32_t eq::fabric::Segment< C, S, CH >::getEyes | ( | ) | const [inline] |
Definition at line 91 of file fabric/segment.h.
const Viewport& eq::fabric::Segment< C, S, CH >::getViewport | ( | ) | const [inline] |
virtual EQFABRIC_INL void eq::fabric::Segment< C, S, CH >::serialize | ( | co::DataOStream & | , |
const uint64_t | |||
) | [protected, virtual] |
Worker for pack() and getInstanceData().
Override this and deserialize() if you want to distribute subclassed data.
This method is called with DIRTY_ALL from getInstanceData() and with the actual dirty bits from pack(), which also resets the dirty state afterwards. The dirty bits are transmitted beforehand, and do not need to be transmitted by the overriding method.
Reimplemented from eq::fabric::Object.
virtual void eq::fabric::Segment< C, S, CH >::setDirty | ( | const uint64_t | bits | ) | [protected, virtual] |
virtual EQFABRIC_INL void eq::fabric::Segment< C, S, CH >::setProjection | ( | const Projection & | projection | ) | [virtual] |
virtual EQFABRIC_INL void eq::fabric::Segment< C, S, CH >::setWall | ( | const Wall & | wall | ) | [virtual] |
virtual EQFABRIC_INL void eq::fabric::Segment< C, S, CH >::unsetFrustum | ( | ) | [virtual] |