KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KINNG_REQUEST_SERVER Class Reference

#include <kinng.h>

Public Member Functions

 KINNG_REQUEST_SERVER (const std::string &aSocketUrl)
 
 ~KINNG_REQUEST_SERVER ()
 
bool Start ()
 
void Stop ()
 
bool Running () const
 
void SetCallback (std::function< void(std::string *)> aFunc)
 
void Reply (const std::string &aReply)
 
const std::string & SocketPath () const
 

Private Member Functions

void listenThread ()
 

Private Attributes

std::thread m_thread
 
std::atomic< bool > m_shutdown
 
std::string m_socketUrl
 
std::function< void(std::string *)> m_callback
 
std::string m_pendingReply
 
std::condition_variable m_replyReady
 
std::mutex m_mutex
 

Detailed Description

Definition at line 31 of file kinng.h.

Constructor & Destructor Documentation

◆ KINNG_REQUEST_SERVER()

KINNG_REQUEST_SERVER::KINNG_REQUEST_SERVER ( const std::string &  aSocketUrl)

Definition at line 34 of file kinng.cpp.

References Start().

◆ ~KINNG_REQUEST_SERVER()

KINNG_REQUEST_SERVER::~KINNG_REQUEST_SERVER ( )

Definition at line 42 of file kinng.cpp.

References Stop().

Member Function Documentation

◆ listenThread()

void KINNG_REQUEST_SERVER::listenThread ( )
private

Definition at line 85 of file kinng.cpp.

References m_callback, m_mutex, m_pendingReply, m_replyReady, m_shutdown, m_socketUrl, and TraceNng.

Referenced by Start().

◆ Reply()

void KINNG_REQUEST_SERVER::Reply ( const std::string &  aReply)

Definition at line 77 of file kinng.cpp.

References m_mutex, m_pendingReply, and m_replyReady.

◆ Running()

bool KINNG_REQUEST_SERVER::Running ( ) const

Definition at line 48 of file kinng.cpp.

References m_thread.

◆ SetCallback()

void KINNG_REQUEST_SERVER::SetCallback ( std::function< void(std::string *)>  aFunc)
inline

Definition at line 44 of file kinng.h.

References m_callback.

◆ SocketPath()

const std::string & KINNG_REQUEST_SERVER::SocketPath ( ) const
inline

Definition at line 48 of file kinng.h.

References m_socketUrl.

◆ Start()

bool KINNG_REQUEST_SERVER::Start ( )

Definition at line 54 of file kinng.cpp.

References listenThread(), m_shutdown, and m_thread.

Referenced by KINNG_REQUEST_SERVER().

◆ Stop()

void KINNG_REQUEST_SERVER::Stop ( )

Definition at line 62 of file kinng.cpp.

References m_mutex, m_replyReady, m_shutdown, and m_thread.

Referenced by ~KINNG_REQUEST_SERVER().

Member Data Documentation

◆ m_callback

std::function<void(std::string*)> KINNG_REQUEST_SERVER::m_callback
private

Definition at line 59 of file kinng.h.

Referenced by listenThread(), and SetCallback().

◆ m_mutex

std::mutex KINNG_REQUEST_SERVER::m_mutex
private

Definition at line 65 of file kinng.h.

Referenced by listenThread(), Reply(), and Stop().

◆ m_pendingReply

std::string KINNG_REQUEST_SERVER::m_pendingReply
private

Definition at line 61 of file kinng.h.

Referenced by listenThread(), and Reply().

◆ m_replyReady

std::condition_variable KINNG_REQUEST_SERVER::m_replyReady
private

Definition at line 63 of file kinng.h.

Referenced by listenThread(), Reply(), and Stop().

◆ m_shutdown

std::atomic<bool> KINNG_REQUEST_SERVER::m_shutdown
private

Definition at line 55 of file kinng.h.

Referenced by listenThread(), Start(), and Stop().

◆ m_socketUrl

std::string KINNG_REQUEST_SERVER::m_socketUrl
private

Definition at line 57 of file kinng.h.

Referenced by listenThread(), and SocketPath().

◆ m_thread

std::thread KINNG_REQUEST_SERVER::m_thread
private

Definition at line 53 of file kinng.h.

Referenced by Running(), Start(), and Stop().


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