networkservice
Public Member Functions | Private Attributes | List of all members
service::plugins::firewall::Rule Class Reference

Represents a single firewall rule. More...

#include "plugins/firewall/Rule.h"

Inheritance diagram for service::plugins::firewall::Rule:
Inheritance graph
[legend]
Collaboration diagram for service::plugins::firewall::Rule:
Collaboration graph
[legend]

Public Member Functions

 Rule (const std::string &name, const std::vector< std::string > &commands, const utils::command::IExecutor &executor)
 
 ~Rule () override
 
 Rule (const Rule &)=delete
 
Ruleoperator= (const Rule &)=delete
 
 Rule (Rule &&)=delete
 
Ruleoperator= (Rule &&)=delete
 
void applyCommands () const override
 
- Public Member Functions inherited from service::plugins::firewall::IRule
 IRule ()=default
 
virtual ~IRule ()=default
 
 IRule (const IRule &)=delete
 
IRuleoperator= (const IRule &)=delete
 
 IRule (IRule &&)=delete
 
IRuleoperator= (IRule &&)=delete
 

Private Attributes

std::unique_ptr< Internal > m_internal
 

Detailed Description

Represents a single firewall rule.

This class is the "low level class" that implements IRule.h

Note
Copy contructor, copy-assignment operator, move constructor and move-assignment operator are defined to be compliant with the "Rule of five"
See also
https://en.cppreference.com/w/cpp/language/rule_of_three
Author
Boubacar DIENE bouba.nosp@m.car..nosp@m.diene.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Date
April 2020

Constructor & Destructor Documentation

◆ Rule() [1/3]

service::plugins::firewall::Rule::Rule ( const std::string &  name,
const std::vector< std::string > &  commands,
const utils::command::IExecutor executor 
)
explicit

Class constructor

Parameters
nameA name for the rule mainly used in logs messages to help identifying rules
commandsThe list of shell commands that compose the rule
executorCommand executor to use

◆ ~Rule()

service::plugins::firewall::Rule::~Rule ( )
override

Class destructor

Note
The override specifier aims at making the compiler warn if the base class's destructor is not virtual.

◆ Rule() [2/3]

service::plugins::firewall::Rule::Rule ( const Rule )
delete

Class copy constructor

◆ Rule() [3/3]

service::plugins::firewall::Rule::Rule ( Rule &&  )
delete

Class move constructor

Member Function Documentation

◆ applyCommands()

void service::plugins::firewall::Rule::applyCommands ( ) const
overridevirtual

Apply all commands in this rule

Implements service::plugins::firewall::IRule.

◆ operator=() [1/2]

Rule& service::plugins::firewall::Rule::operator= ( const Rule )
delete

Class copy-assignment operator

◆ operator=() [2/2]

Rule& service::plugins::firewall::Rule::operator= ( Rule &&  )
delete

Class move-assignment operator

Member Data Documentation

◆ m_internal

std::unique_ptr<Internal> service::plugins::firewall::Rule::m_internal
private

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