SOMHunter Core
sh::ClientDres Class Referencefinal

Specific DRES server implementation. More...

#include <client-dres.h>

Inheritance diagram for sh::ClientDres:
Collaboration diagram for sh::ClientDres:

Public Member Functions

 ClientDres (const EvalServerSettings &settings)
 
 ~ClientDres () noexcept
 
virtual bool login () override
 
virtual bool logout () override
 
virtual bool submit (const VideoFrame &frame) override
 
virtual bool send_results_log (const nlohmann::json &log_JSON) override
 
virtual bool send_interactions_log (const nlohmann::json &log_JSON) override
 
virtual UnixTimestamp get_server_ts () override
 
virtual nlohmann::json get_current_task () override
 
- Public Member Functions inherited from sh::IServerClient
 IServerClient (const EvalServerSettings &settings)
 
virtual bool is_logged_in () const
 
virtual const std::string & get_user_token () const
 
virtual void set_do_requests (bool val)
 
virtual bool get_do_requests () const
 

Protected Attributes

const std::chrono::milliseconds _sync_period { 5000ms }
 
EvalServerSettings::ServerConfigDres _settings
 
std::thread _t_sync_worker
 
bool _synced
 
std::ptrdiff_t _diff
 
nlohmann::json _current_task
 
- Protected Attributes inherited from sh::IServerClient
EvalServerSettings _eval_server_settings
 
bool _do_requests
 
Http _http
 
std::string _username
 

Private Types

enum class  LogType {
  LOGIN , LOGOUT , SUBMIT , RESULT ,
  INTERACTION
}
 

Private Member Functions

std::string log_type_to_str (LogType t) const
 
void write_log (LogType type, UnixTimestamp ts, const std::string &URL, const nlohmann::json &req, ReqCode code, nlohmann::json &res) const
 

Additional Inherited Members

- Protected Member Functions inherited from sh::IServerClient
virtual void set_user_token (const std::string &val)
 

Detailed Description

Specific DRES server implementation.

https://github.com/dres-dev/DRES

Member Enumeration Documentation

◆ LogType

enum sh::ClientDres::LogType
strongprivate
Enumerator
LOGIN 
LOGOUT 
SUBMIT 
RESULT 
INTERACTION 

Constructor & Destructor Documentation

◆ ClientDres()

ClientDres::ClientDres ( const EvalServerSettings settings)
Here is the call graph for this function:

◆ ~ClientDres()

sh::ClientDres::~ClientDres ( )
noexcept

Member Function Documentation

◆ get_current_task()

nlohmann::json ClientDres::get_current_task ( )
overridevirtual

Implements sh::IServerClient.

◆ get_server_ts()

UnixTimestamp ClientDres::get_server_ts ( )
overridevirtual

Implements sh::IServerClient.

Here is the call graph for this function:

◆ log_type_to_str()

std::string sh::ClientDres::log_type_to_str ( LogType  t) const
inlineprivate

◆ login()

bool ClientDres::login ( )
overridevirtual

Implements sh::IServerClient.

Here is the call graph for this function:

◆ logout()

bool ClientDres::logout ( )
overridevirtual

Implements sh::IServerClient.

Here is the call graph for this function:

◆ send_interactions_log()

bool ClientDres::send_interactions_log ( const nlohmann::json &  log_JSON)
overridevirtual

Implements sh::IServerClient.

Here is the call graph for this function:

◆ send_results_log()

bool ClientDres::send_results_log ( const nlohmann::json &  log_JSON)
overridevirtual

Implements sh::IServerClient.

Here is the call graph for this function:

◆ submit()

bool sh::ClientDres::submit ( const VideoFrame frame)
overridevirtual

Implements sh::IServerClient.

Here is the call graph for this function:

◆ write_log()

void ClientDres::write_log ( LogType  type,
UnixTimestamp  ts,
const std::string &  URL,
const nlohmann::json &  req,
ReqCode  code,
nlohmann::json &  res 
) const
private
Here is the call graph for this function:

Member Data Documentation

◆ _current_task

nlohmann::json sh::ClientDres::_current_task
protected

◆ _diff

std::ptrdiff_t sh::ClientDres::_diff
protected

◆ _settings

EvalServerSettings::ServerConfigDres sh::ClientDres::_settings
protected

◆ _sync_period

const std::chrono::milliseconds sh::ClientDres::_sync_period { 5000ms }
protected

◆ _synced

bool sh::ClientDres::_synced
protected

◆ _t_sync_worker

std::thread sh::ClientDres::_t_sync_worker
protected

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