OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::ActionList Class Reference

#include <action.hpp>

Inheritance diagram for openvpn::ActionList:
[legend]
Collaboration diagram for openvpn::ActionList:
[legend]

Classes

class  Iter
 

Public Types

typedef RCPtr< ActionListPtr
 
- Public Types inherited from openvpn::DestructorBase
typedef RCPtr< DestructorBasePtr
 
- Public Types inherited from openvpn::RC< thread_unsafe_refcount >
typedef RCPtr< RCPtr
 

Public Member Functions

 ActionList ()
 
void add (Action *action)
 
void add (const Action::Ptr &action)
 
void add (const ActionList &other)
 
bool exists (const Action::Ptr &action) const
 
virtual std::unordered_set< std::string > execute (std::ostream &os)
 Executes a sequence of actions and returns marks of failed actions.
 
void execute_log ()
 
std::string to_string () const
 
void enable_destroy (const bool state)
 
void halt ()
 
void destroy (std::ostream &os) override
 
bool is_halt () const
 
void remove_marked (const std::unordered_set< std::string > &marks, std::ostream &os)
 Removes actions with specified marks and logs the removals.
 
- Public Member Functions inherited from openvpn::DestructorBase
virtual ~DestructorBase ()=default
 
- Public Member Functions inherited from openvpn::RC< thread_unsafe_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 Attributes

bool reverse_ = false
 
bool enable_destroy_ = false
 
volatile bool halt_ = false
 

Additional Inherited Members

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

Detailed Description

Definition at line 47 of file action.hpp.

Member Typedef Documentation

◆ Ptr

Definition at line 50 of file action.hpp.

Constructor & Destructor Documentation

◆ ActionList()

openvpn::ActionList::ActionList ( )
inline

Definition at line 52 of file action.hpp.

Member Function Documentation

◆ add() [1/3]

void openvpn::ActionList::add ( Action action)
inline

Definition at line 57 of file action.hpp.

Here is the caller graph for this function:

◆ add() [2/3]

void openvpn::ActionList::add ( const Action::Ptr action)
inline

Definition at line 63 of file action.hpp.

◆ add() [3/3]

void openvpn::ActionList::add ( const ActionList other)
inline

Definition at line 69 of file action.hpp.

◆ destroy()

void openvpn::ActionList::destroy ( std::ostream &  os)
inlineoverridevirtual

Implements openvpn::DestructorBase.

Definition at line 151 of file action.hpp.

Here is the caller graph for this function:

◆ enable_destroy()

void openvpn::ActionList::enable_destroy ( const bool  state)
inline

Definition at line 141 of file action.hpp.

Here is the caller graph for this function:

◆ execute()

virtual std::unordered_set< std::string > openvpn::ActionList::execute ( std::ostream &  os)
inlinevirtual

Executes a sequence of actions and returns marks of failed actions.

This method iterates over a collection of actions, executing each one. If an action throws an exception, it is caught, logged to the provided output stream, and marked as failed.

Parameters
osReference to an output stream for logging execution results.
Returns
A set of marks for failed actions.

Definition at line 98 of file action.hpp.

Here is the caller graph for this function:

◆ execute_log()

void openvpn::ActionList::execute_log ( )
inline

Definition at line 122 of file action.hpp.

◆ exists()

bool openvpn::ActionList::exists ( const Action::Ptr action) const
inline

Definition at line 74 of file action.hpp.

◆ halt()

void openvpn::ActionList::halt ( )
inline

Definition at line 146 of file action.hpp.

Here is the caller graph for this function:

◆ is_halt()

bool openvpn::ActionList::is_halt ( ) const
inline

Definition at line 160 of file action.hpp.

Here is the caller graph for this function:

◆ remove_marked()

void openvpn::ActionList::remove_marked ( const std::unordered_set< std::string > &  marks,
std::ostream &  os 
)
inline

Removes actions with specified marks and logs the removals.

Iterates through the collection and removes all actions whose marks exist in the provided set of marks. Logs each removal to the provided output stream.

Parameters
marksA set of marks identifying actions to be removed.
osReference to an output stream for logging removed actions.

Definition at line 175 of file action.hpp.

Here is the caller graph for this function:

◆ to_string()

std::string openvpn::ActionList::to_string ( ) const
inline

Definition at line 129 of file action.hpp.

Member Data Documentation

◆ enable_destroy_

bool openvpn::ActionList::enable_destroy_ = false
protected

Definition at line 226 of file action.hpp.

◆ halt_

volatile bool openvpn::ActionList::halt_ = false
protected

Definition at line 227 of file action.hpp.

◆ reverse_

bool openvpn::ActionList::reverse_ = false
protected

Definition at line 225 of file action.hpp.


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