OpenAnima 0.2.0
Middleware for conversational NPCs that interact with the player, the world and each other
Loading...
Searching...
No Matches
Public Attributes | List of all members
OpenAnima::Provider::Call Struct Reference

#include <IProvider.h>

Public Attributes

DeltaSink onDelta
 
std::function< bool()> keepGoing
 
Core::ResponseFormat format
 

Detailed Description

One call to a provider: what is asked for, where the pieces go, and how to abandon it.

The three live together because a caller that paints an answer as it arrives is also the caller that wants to be able to stop it half way, and because a second callback in the argument list is a pair easy to hand over in the wrong order.

Member Data Documentation

◆ format

Core::ResponseFormat OpenAnima::Provider::Call::format

Shape the answer is asked for in. Text by default, which is what a caller that says nothing gets, and a shape a provider cannot enforce is still worth asking for: what arrives is checked against it either way.

◆ keepGoing

std::function<bool()> OpenAnima::Provider::Call::keepGoing

Asks whether the call should still be going.

Asked on the client library's own timer, so it fires even while no data arrives: without it a caller could not abandon a stream that went quiet. An empty check never abandons the call.

Returns
false to abandon the call.

◆ onDelta

DeltaSink OpenAnima::Provider::Call::onDelta

Called with every piece of the answer as it arrives, in order. An empty sink asks for the answer in one response.


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