AGX Dynamics 2.42.1.1
Loading...
Searching...
No Matches
agxData::Channel Class Reference

A channel is a directional data transfer connection between two buffers. More...

#include <Channel.h>

Public Member Functions

 Channel ()
 Default constructor.
 
 Channel (Buffer *target, Buffer *source)
 Constructor.
 
 ~Channel ()
 Destructor.
 
void connect (Buffer *target, Buffer *source)
 
void flip ()
 Flip the direction of the channel.
 
BuffergetSourceBuffer ()
 
BuffergetTargetBuffer ()
 
void postTransfer ()
 Perform local data copying and transformations if needed.
 
agx::SyncTag * transfer (size_t targetOffset, size_t sourceOffset, size_t numElements, bool blocking)
 Transmit data on the channel.
 

Detailed Description

A channel is a directional data transfer connection between two buffers.

The buffers must have the same attribute type (eg. Vec3 -> Vec3), but does not need to be the same attribute instance (eg. it is possible to set up a channel of particle forces -> rigid body forces). If the type format differs, data transformation is automatically done via a temporary buffer.

Definition at line 32 of file Channel.h.

Constructor & Destructor Documentation

◆ Channel() [1/2]

agxData::Channel::Channel ( )

Default constructor.

◆ Channel() [2/2]

agxData::Channel::Channel ( Buffer target,
Buffer source 
)

Constructor.

Parameters
targetThe target buffer.
sourceThe source buffer.

◆ ~Channel()

agxData::Channel::~Channel ( )

Destructor.

Member Function Documentation

◆ connect()

void agxData::Channel::connect ( Buffer target,
Buffer source 
)

◆ flip()

void agxData::Channel::flip ( )

Flip the direction of the channel.

◆ getSourceBuffer()

Buffer * agxData::Channel::getSourceBuffer ( )
Returns
The source buffer.

Definition at line 98 of file Channel.h.

◆ getTargetBuffer()

Buffer * agxData::Channel::getTargetBuffer ( )
Returns
The target buffer.

Definition at line 97 of file Channel.h.

◆ postTransfer()

void agxData::Channel::postTransfer ( )

Perform local data copying and transformations if needed.

Must be called after transfer. TODO Use automated callbacks in transfer tag instead

◆ transfer()

agx::SyncTag * agxData::Channel::transfer ( size_t  targetOffset,
size_t  sourceOffset,
size_t  numElements,
bool  blocking 
)

Transmit data on the channel.

If the target buffer is not large enough, it is automatically resized.

Parameters
targetOffsetThe offset in the target buffer (num elements).
sourceOffsetThe offset in the source buffer (num elements).
numElementsThe number of elements to transfer.
blockingSet true for blocking transfer.
Returns
A transfer tag used to check the status of asynchronous transfers.

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