WebCFace 2.5.2
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
PromiseData Struct Reference

PromiseとCallHandleのデータを保持するクラス More...

#include <webcface/internal/func_internal.h>

Inheritance diagram for PromiseData:
[legend]
Collaboration diagram for PromiseData:
[legend]

Public Member Functions

void callReachEvent ()
 
void callFinishEvent ()
 
 PromiseData (const Field &base, std::vector< ValAdaptor > &&args, std::size_t caller_id=0)
 
template<std::size_t v_index, typename CVal >
std::vector< CVal > & initCArgs ()
 
Promise getter ()
 
CallHandle setter ()
 
std::size_t callerId () const
 

Public Attributes

std::mutex m
 
std::condition_variable cond
 
std::function< void(Promise)> reach_event
 
std::function< void(Promise)> finish_event
 
bool reach_event_done = false
 
bool finish_event_done = false
 
bool reached = false
 
bool found = false
 
bool finished = false
 
bool is_error = false
 
ValAdaptor response
 
ValAdaptor rejection
 
std::promise< bool > started_p
 
std::promise< ValAdaptorresult_p
 
std::shared_future< bool > started_f
 
std::shared_future< ValAdaptorresult_f
 
Field base
 
std::size_t caller_id
 
const std::vector< ValAdaptorargs_
 
std::variant< int, std::vector< wcfMultiVal >, std::vector< wcfMultiValW > > c_args_
 

Detailed Description

PromiseとCallHandleのデータを保持するクラス

Constructor & Destructor Documentation

◆ PromiseData()

PromiseData ( const Field base,
std::vector< ValAdaptor > &&  args,
std::size_t  caller_id = 0 
)
inlineexplicit

startedとresultを空の状態で初期化

Member Function Documentation

◆ callerId()

std::size_t callerId ( ) const
inline

◆ callFinishEvent()

void callFinishEvent ( )

resultとresultEventが両方セットされていればコールバック発動

◆ callReachEvent()

void callReachEvent ( )

startedとstartedEventが両方セットされていればコールバック発動

◆ getter()

Promise getter ( )

◆ initCArgs()

template<std::size_t v_index, typename CVal >
std::vector< CVal > & initCArgs

c_args_ をwcfMultiValの配列またはwcfMultiValWの配列で初期化

◆ setter()

CallHandle setter ( )

Member Data Documentation

◆ args_

const std::vector<ValAdaptor> args_

◆ base

Field base

◆ c_args_

std::variant<int, std::vector<wcfMultiVal>, std::vector<wcfMultiValW> > c_args_

◆ caller_id

std::size_t caller_id

◆ cond

std::condition_variable cond

◆ finish_event

std::function<void(Promise)> finish_event

◆ finish_event_done

bool finish_event_done = false

◆ finished

bool finished = false

◆ found

bool found = false

◆ is_error

bool is_error = false

◆ m

std::mutex m

PromiseDataのメソッドはmutexをロックしないので、呼び出し側がロックすること また、eventの中ではunlockされる

◆ reach_event

std::function<void(Promise)> reach_event

◆ reach_event_done

bool reach_event_done = false

◆ reached

bool reached = false

◆ rejection

ValAdaptor rejection

◆ response

ValAdaptor response

◆ result_f

std::shared_future<ValAdaptor> result_f

◆ result_p

std::promise<ValAdaptor> result_p

◆ started_f

std::shared_future<bool> started_f

◆ started_p

std::promise<bool> started_p

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