MCPcopy Create free account
hub / github.com/PCGEx/PCGExtendedToolkit / WriteBuffers

Method WriteBuffers

Source/PCGExtendedToolkit/Private/Data/PCGExData.cpp:146–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144 }
145
146 void FFacade::WriteBuffers(const TSharedPtr<PCGExMT::FTaskManager>& AsyncManager, PCGExMT::FCompletionCallback&& Callback)
147 {
148 if (!ValidateOutputsBeforeWriting())
149 {
150 Flush();
151 return;
152 }
153
154 PCGEX_ASYNC_GROUP_CHKD_VOID(AsyncManager, WriteBuffersWithCallback);
155 WriteBuffersWithCallback->OnCompleteCallback =
156 [PCGEX_ASYNC_THIS_CAPTURE, Callback]()
157 {
158 PCGEX_ASYNC_THIS
159 This->Flush();
160 Callback();
161 };
162
163 if (const int32 WritableCount = WriteBuffersAsCallbacks(WriteBuffersWithCallback); WritableCount <= 0)
164 {
165 // -1 is fail so no callback
166 if (WritableCount == 0) { Callback(); }
167 return;
168 }
169
170 WriteBuffersWithCallback->StartSimpleCallbacks();
171 }
172
173 bool FFacade::ValidateOutputsBeforeWriting() const
174 {

Callers 1

CompileMethod · 0.80

Calls 2

FlushFunction · 0.85
StartSimpleCallbacksMethod · 0.80

Tested by

no test coverage detected