OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::WriteTask Struct Reference

One item in the IOThread write queue. More...

#include <WriteTask.hpp>

Collaboration diagram for openswmm::WriteTask:

Public Member Functions

 WriteTask ()=default
 Construct an empty/default snapshot task with sequence zero.
 
 WriteTask (SimulationSnapshot snap, int seq=0)
 Take snapshot ownership for deferred plugin delivery.
 
 WriteTask (WriteTask &&) noexcept=default
 Move snapshot ownership and copy the sequence, leaving moved-from storage valid.
 
WriteTask & operator= (WriteTask &&) noexcept=default
 Replace the snapshot/sequence by defaulted move assignment.
 
 WriteTask (const WriteTask &)=delete
 Disable copying of potentially large snapshot payloads.
 
WriteTask & operator= (const WriteTask &)=delete
 Disable copy assignment of potentially large snapshot payloads.
 

Public Attributes

SimulationSnapshot snapshot
 The snapshot to be written (deep copy of relevant SoA slices).
 
int sequence = 0
 Sequential task index (0-based). Useful for ordering assertions.
 

Detailed Description

One item in the IOThread write queue.

Moved into the queue from the simulation thread; consumed by the IO thread. Ownership of all vector data is transferred with the move, so no copies are made for typical usage.

Constructor & Destructor Documentation

◆ WriteTask() [1/4]

openswmm::WriteTask::WriteTask ( )
default

Construct an empty/default snapshot task with sequence zero.

Here is the caller graph for this function:

◆ WriteTask() [2/4]

openswmm::WriteTask::WriteTask ( SimulationSnapshot snap,
int seq = 0 )
inlineexplicit

Take snapshot ownership for deferred plugin delivery.

Parameters
snapSnapshot by value, moved into the task; callers can move large owned vector payloads instead of copying them. Referenced nonowned metadata still follows SimulationSnapshot's lifetime contract.
seqRaw ordering index copied without range/uniqueness validation.

◆ WriteTask() [3/4]

openswmm::WriteTask::WriteTask ( WriteTask && )
defaultnoexcept

Move snapshot ownership and copy the sequence, leaving moved-from storage valid.

Source
The unnamed rvalue task supplies the moved payload; no plugin IO is performed.
Here is the call graph for this function:

◆ WriteTask() [4/4]

openswmm::WriteTask::WriteTask ( const WriteTask & )
delete

Disable copying of potentially large snapshot payloads.

Here is the call graph for this function:

Member Function Documentation

◆ operator=() [1/2]

WriteTask & openswmm::WriteTask::operator= ( const WriteTask & )
delete

Disable copy assignment of potentially large snapshot payloads.

Here is the call graph for this function:

◆ operator=() [2/2]

WriteTask & openswmm::WriteTask::operator= ( WriteTask && )
defaultnoexcept

Replace the snapshot/sequence by defaulted move assignment.

Source
The unnamed rvalue task supplies the moved payload; prior owned buffers are released.
Returns
This task.
Here is the call graph for this function:

Member Data Documentation

◆ sequence

int openswmm::WriteTask::sequence = 0

Sequential task index (0-based). Useful for ordering assertions.

◆ snapshot

SimulationSnapshot openswmm::WriteTask::snapshot

The snapshot to be written (deep copy of relevant SoA slices).


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