Skip to main content

ReleasePacer Class

Declaration

class simaai::neat::graph::strict_sync::ReleasePacer { ... }

Included Headers

#include <StrictSync.h>

Public Member Typedefs Index

usingOnSendResult = std::function< void(size_t, bool)>
usingOnDrop = std::function< void(size_t, int64_t)>

Public Constructors Index

ReleasePacer (const std::vector< std::shared_ptr< simaai::neat::Run >> &runs, int target_fps, size_t max_queue, OnSendResult on_send_result={}, OnDrop on_drop={})

Public Destructor Index

~ReleasePacer ()

Public Member Functions Index

boolenabled () const
int64_tinterval_ms () const
size_tmax_queue () const
boolenqueue (size_t idx, simaai::neat::Sample &&sample)
voidstop ()
Statsstats (size_t idx) const

Private Member Functions Index

voidworker_loop (size_t idx)

Private Member Attributes Index

std::vector< std::shared_ptr< simaai::neat::Run > >runs_
std::vector< std::unique_ptr< State > >states_
OnSendResulton_send_result_
OnDropon_drop_
int64_tinterval_ms_ = 0
size_tmax_queue_ = 0
std::atomic< bool >stopped_ {false}

Private Static Functions Index

static int64_tnow_ms_i64 ()

Definition at line 108 of file StrictSync.h.

Public Member Typedefs

OnDrop

using simaai::neat::graph::strict_sync::ReleasePacer::OnDrop = std::function<void(size_t , int64_t )>

Definition at line 119 of file StrictSync.h.

119 using OnDrop = std::function<void(size_t /*stream_idx*/, int64_t /*dropped_count*/)>;

OnSendResult

using simaai::neat::graph::strict_sync::ReleasePacer::OnSendResult = std::function<void(size_t , bool )>

Definition at line 118 of file StrictSync.h.

118 using OnSendResult = std::function<void(size_t /*stream_idx*/, bool /*ok*/)>;

Public Constructors

ReleasePacer()

simaai::neat::graph::strict_sync::ReleasePacer::ReleasePacer (const std::vector< std::shared_ptr< simaai::neat::Run >> & runs, int target_fps, size_t max_queue, OnSendResult on_send_result={}, OnDrop on_drop={})

Definition at line 121 of file StrictSync.h.

Public Destructor

~ReleasePacer()

simaai::neat::graph::strict_sync::ReleasePacer::~ReleasePacer ()

Definition at line 123 of file StrictSync.h.

Public Member Functions

enabled()

bool simaai::neat::graph::strict_sync::ReleasePacer::enabled ()
inline

Definition at line 125 of file StrictSync.h.

125 bool enabled() const {
126 return interval_ms_ > 0;
127 }

enqueue()

bool simaai::neat::graph::strict_sync::ReleasePacer::enqueue (size_t idx, simaai::neat::Sample && sample)

Definition at line 135 of file StrictSync.h.

interval_ms()

int64_t simaai::neat::graph::strict_sync::ReleasePacer::interval_ms ()
inline

Definition at line 128 of file StrictSync.h.

128 int64_t interval_ms() const {
129 return interval_ms_;
130 }

max_queue()

size_t simaai::neat::graph::strict_sync::ReleasePacer::max_queue ()
inline

Definition at line 131 of file StrictSync.h.

131 size_t max_queue() const {
132 return max_queue_;
133 }

stats()

Stats simaai::neat::graph::strict_sync::ReleasePacer::stats (size_t idx)

Definition at line 137 of file StrictSync.h.

stop()

void simaai::neat::graph::strict_sync::ReleasePacer::stop ()

Definition at line 136 of file StrictSync.h.

Private Member Functions

worker_loop()

void simaai::neat::graph::strict_sync::ReleasePacer::worker_loop (size_t idx)

Definition at line 156 of file StrictSync.h.

Private Member Attributes

interval_ms_

int64_t simaai::neat::graph::strict_sync::ReleasePacer::interval_ms_ = 0

Definition at line 163 of file StrictSync.h.

163 int64_t interval_ms_ = 0;

max_queue_

size_t simaai::neat::graph::strict_sync::ReleasePacer::max_queue_ = 0

Definition at line 164 of file StrictSync.h.

164 size_t max_queue_ = 0;

on_drop_

OnDrop simaai::neat::graph::strict_sync::ReleasePacer::on_drop_

Definition at line 161 of file StrictSync.h.

161 OnDrop on_drop_;

on_send_result_

OnSendResult simaai::neat::graph::strict_sync::ReleasePacer::on_send_result_

Definition at line 160 of file StrictSync.h.

160 OnSendResult on_send_result_;

runs_

std::vector<std::shared_ptr<simaai::neat::Run> > simaai::neat::graph::strict_sync::ReleasePacer::runs_

Definition at line 158 of file StrictSync.h.

158 std::vector<std::shared_ptr<simaai::neat::Run>> runs_;

states_

std::vector<std::unique_ptr<State> > simaai::neat::graph::strict_sync::ReleasePacer::states_

Definition at line 159 of file StrictSync.h.

159 std::vector<std::unique_ptr<State>> states_;

stopped_

std::atomic<bool> simaai::neat::graph::strict_sync::ReleasePacer::stopped_ {false}

Definition at line 165 of file StrictSync.h.

165 std::atomic<bool> stopped_{false};

Private Static Functions

now_ms_i64()

int64_t simaai::neat::graph::strict_sync::ReleasePacer::now_ms_i64 ()
static

Definition at line 155 of file StrictSync.h.


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


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.1.