OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::RunContext< ServerThread, Stats > Class Template Reference

#include <runcontext.hpp>

Inheritance diagram for openvpn::RunContext< ServerThread, Stats >:
[legend]
Collaboration diagram for openvpn::RunContext< ServerThread, Stats >:
[legend]

Classes

class  ThreadContext
 

Public Types

typedef RCPtr< RunContextPtr
 
- Public Types inherited from openvpn::RC< thread_safe_refcount >
typedef RCPtr< RCPtr
 

Public Member Functions

 RunContext ()
 
openvpn_io::io_context * io_context_ptr ()
 
void set_async_stop (Stop *async_stop)
 
void set_log_reopen (LogSetup::Ptr lr)
 
void set_thread (const unsigned int unit, std::thread *thread)
 
void set_server (const unsigned int unit, ServerThread *serv)
 
void clear_server (const unsigned int unit)
 
std::vector< typename ServerThread::Ptrget_servers ()
 
void enable_log_history ()
 
void disable_log_history () override
 
std::vector< RunContextLogEntryadd_log_observer (const unsigned int unit) override
 
void set_prefix (const std::string &pre)
 
void run ()
 
void join ()
 
template<typename SVC >
void process_exception (const std::string &thread_name, const unsigned int unit, const bool io_context_run_called, openvpn_io::io_context &io_context, SVC &svc, PThreadBarrier &event_loop_bar, const std::exception &e)
 
void log (const std::string &str) override
 
void cancel () override
 
const Log::Context::Wrapperlog_wrapper ()
 
void set_stats_obj (const typename Stats::Ptr &stats_arg)
 
Stopasync_stop () override
 
- Public Member Functions inherited from openvpn::RC< thread_safe_refcount >
 RC () noexcept=default
 
 RC (const RC &)=delete
 
virtual ~RC ()=default
 
RCoperator= (const RC &)=delete
 
olong use_count () const noexcept
 Delegates call to RCImpl and returns the result.
 

Protected Member Functions

virtual void signal (const openvpn_io::error_code &error, int signum)
 

Protected Attributes

volatile bool halt = false
 

Private Member Functions

void add_thread ()
 
void remove_thread ()
 
void signal_rearm ()
 
void schedule_debug_exit ()
 

Private Attributes

openvpn_io::io_context io_context {1}
 
Stats::Ptr stats
 
ASIOSignals::Ptr signals
 
AsioTimer exit_timer
 
std::string prefix
 
std::vector< std::thread * > threadlist
 
std::recursive_mutex mutex
 
std::vector< ServerThread * > servlist
 
int thread_count = 0
 
Stopasync_stop_ = nullptr
 
std::vector< unsigned int > log_observers
 
std::unique_ptr< std::vector< RunContextLogEntry > > log_history
 
Log::Context log_context
 
Log::Context::Wrapper log_wrap
 
LogSetup::Ptr log_reopen
 

Additional Inherited Members

- Static Public Member Functions inherited from openvpn::RC< thread_safe_refcount >
static constexpr bool is_thread_safe ()
 Delegates call to RCImpl and returns the result.
 

Detailed Description

template<typename ServerThread, typename Stats>
class openvpn::RunContext< ServerThread, Stats >

Definition at line 91 of file runcontext.hpp.

Member Typedef Documentation

◆ Ptr

template<typename ServerThread , typename Stats >
typedef RCPtr<RunContext> openvpn::RunContext< ServerThread, Stats >::Ptr

Definition at line 94 of file runcontext.hpp.

Constructor & Destructor Documentation

◆ RunContext()

template<typename ServerThread , typename Stats >
openvpn::RunContext< ServerThread, Stats >::RunContext ( )
inline

Definition at line 114 of file runcontext.hpp.

Member Function Documentation

◆ add_log_observer()

template<typename ServerThread , typename Stats >
std::vector< RunContextLogEntry > openvpn::RunContext< ServerThread, Stats >::add_log_observer ( const unsigned int  unit)
inlineoverridevirtual

Implements openvpn::RunContextBase.

Definition at line 199 of file runcontext.hpp.

◆ add_thread()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::add_thread ( )
inlineprivate

Definition at line 349 of file runcontext.hpp.

Here is the caller graph for this function:

◆ async_stop()

template<typename ServerThread , typename Stats >
Stop * openvpn::RunContext< ServerThread, Stats >::async_stop ( )
inlineoverridevirtual

Implements openvpn::RunContextBase.

Definition at line 342 of file runcontext.hpp.

Here is the caller graph for this function:

◆ cancel()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::cancel ( )
inlineoverridevirtual

Implements openvpn::RunContextBase.

Definition at line 293 of file runcontext.hpp.

Here is the caller graph for this function:

◆ clear_server()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::clear_server ( const unsigned int  unit)
inline

Definition at line 162 of file runcontext.hpp.

Here is the caller graph for this function:

◆ disable_log_history()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::disable_log_history ( )
inlineoverridevirtual

Implements openvpn::RunContextBase.

Definition at line 193 of file runcontext.hpp.

◆ enable_log_history()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::enable_log_history ( )
inline

Definition at line 186 of file runcontext.hpp.

◆ get_servers()

template<typename ServerThread , typename Stats >
std::vector< typename ServerThread::Ptr > openvpn::RunContext< ServerThread, Stats >::get_servers ( )
inline

Definition at line 174 of file runcontext.hpp.

◆ io_context_ptr()

template<typename ServerThread , typename Stats >
openvpn_io::io_context * openvpn::RunContext< ServerThread, Stats >::io_context_ptr ( )
inline

Definition at line 124 of file runcontext.hpp.

◆ join()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::join ( )
inline

Definition at line 235 of file runcontext.hpp.

◆ log()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::log ( const std::string &  str)
inlineoverridevirtual

Implements openvpn::LogBase.

Definition at line 269 of file runcontext.hpp.

◆ log_wrapper()

template<typename ServerThread , typename Stats >
const Log::Context::Wrapper & openvpn::RunContext< ServerThread, Stats >::log_wrapper ( )
inline

Definition at line 332 of file runcontext.hpp.

Here is the caller graph for this function:

◆ process_exception()

template<typename ServerThread , typename Stats >
template<typename SVC >
void openvpn::RunContext< ServerThread, Stats >::process_exception ( const std::string &  thread_name,
const unsigned int  unit,
const bool  io_context_run_called,
openvpn_io::io_context &  io_context,
SVC &  svc,
PThreadBarrier event_loop_bar,
const std::exception &  e 
)
inline

Definition at line 250 of file runcontext.hpp.

◆ remove_thread()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::remove_thread ( )
inlineprivate

Definition at line 356 of file runcontext.hpp.

Here is the caller graph for this function:

◆ run()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::run ( )
inline

Definition at line 229 of file runcontext.hpp.

◆ schedule_debug_exit()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::schedule_debug_exit ( )
inlineprivate

Definition at line 406 of file runcontext.hpp.

Here is the caller graph for this function:

◆ set_async_stop()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::set_async_stop ( Stop async_stop)
inline

Definition at line 129 of file runcontext.hpp.

◆ set_log_reopen()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::set_log_reopen ( LogSetup::Ptr  lr)
inline

Definition at line 134 of file runcontext.hpp.

◆ set_prefix()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::set_prefix ( const std::string &  pre)
inline

Definition at line 224 of file runcontext.hpp.

◆ set_server()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::set_server ( const unsigned int  unit,
ServerThread serv 
)
inline

Definition at line 149 of file runcontext.hpp.

Here is the caller graph for this function:

◆ set_stats_obj()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::set_stats_obj ( const typename Stats::Ptr &  stats_arg)
inline

Definition at line 337 of file runcontext.hpp.

◆ set_thread()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::set_thread ( const unsigned int  unit,
std::thread *  thread 
)
inline

Definition at line 139 of file runcontext.hpp.

◆ signal()

template<typename ServerThread , typename Stats >
virtual void openvpn::RunContext< ServerThread, Stats >::signal ( const openvpn_io::error_code &  error,
int  signum 
)
inlineprotectedvirtual

Definition at line 368 of file runcontext.hpp.

◆ signal_rearm()

template<typename ServerThread , typename Stats >
void openvpn::RunContext< ServerThread, Stats >::signal_rearm ( )
inlineprivate

Definition at line 399 of file runcontext.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ async_stop_

template<typename ServerThread , typename Stats >
Stop* openvpn::RunContext< ServerThread, Stats >::async_stop_ = nullptr
private

Definition at line 440 of file runcontext.hpp.

◆ exit_timer

template<typename ServerThread , typename Stats >
AsioTimer openvpn::RunContext< ServerThread, Stats >::exit_timer
private

Definition at line 425 of file runcontext.hpp.

◆ halt

template<typename ServerThread , typename Stats >
volatile bool openvpn::RunContext< ServerThread, Stats >::halt = false
protected

Definition at line 452 of file runcontext.hpp.

◆ io_context

template<typename ServerThread , typename Stats >
openvpn_io::io_context openvpn::RunContext< ServerThread, Stats >::io_context {1}
private

Definition at line 422 of file runcontext.hpp.

◆ log_context

template<typename ServerThread , typename Stats >
Log::Context openvpn::RunContext< ServerThread, Stats >::log_context
private

Definition at line 447 of file runcontext.hpp.

◆ log_history

template<typename ServerThread , typename Stats >
std::unique_ptr<std::vector<RunContextLogEntry> > openvpn::RunContext< ServerThread, Stats >::log_history
private

Definition at line 444 of file runcontext.hpp.

◆ log_observers

template<typename ServerThread , typename Stats >
std::vector<unsigned int> openvpn::RunContext< ServerThread, Stats >::log_observers
private

Definition at line 443 of file runcontext.hpp.

◆ log_reopen

template<typename ServerThread , typename Stats >
LogSetup::Ptr openvpn::RunContext< ServerThread, Stats >::log_reopen
private

Definition at line 449 of file runcontext.hpp.

◆ log_wrap

template<typename ServerThread , typename Stats >
Log::Context::Wrapper openvpn::RunContext< ServerThread, Stats >::log_wrap
private

Definition at line 448 of file runcontext.hpp.

◆ mutex

template<typename ServerThread , typename Stats >
std::recursive_mutex openvpn::RunContext< ServerThread, Stats >::mutex
private

Definition at line 433 of file runcontext.hpp.

◆ prefix

template<typename ServerThread , typename Stats >
std::string openvpn::RunContext< ServerThread, Stats >::prefix
private

Definition at line 426 of file runcontext.hpp.

◆ servlist

template<typename ServerThread , typename Stats >
std::vector<ServerThread *> openvpn::RunContext< ServerThread, Stats >::servlist
private

Definition at line 436 of file runcontext.hpp.

◆ signals

template<typename ServerThread , typename Stats >
ASIOSignals::Ptr openvpn::RunContext< ServerThread, Stats >::signals
private

Definition at line 424 of file runcontext.hpp.

◆ stats

template<typename ServerThread , typename Stats >
Stats::Ptr openvpn::RunContext< ServerThread, Stats >::stats
private

Definition at line 423 of file runcontext.hpp.

◆ thread_count

template<typename ServerThread , typename Stats >
int openvpn::RunContext< ServerThread, Stats >::thread_count = 0
private

Definition at line 437 of file runcontext.hpp.

◆ threadlist

template<typename ServerThread , typename Stats >
std::vector<std::thread *> openvpn::RunContext< ServerThread, Stats >::threadlist
private

Definition at line 427 of file runcontext.hpp.


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