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

A factory class to help creating firewalling rules. More...

#include "plugins/firewall/RuleFactory.h"

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

Public Member Functions

 RuleFactory (const utils::command::IExecutor &executor)
 
 ~RuleFactory () override
 
 RuleFactory (const RuleFactory &)=delete
 
RuleFactoryoperator= (const RuleFactory &)=delete
 
 RuleFactory (RuleFactory &&)=delete
 
RuleFactoryoperator= (RuleFactory &&)=delete
 
std::unique_ptr< IRulecreateRule (const std::string &name, const std::vector< std::string > &commands) const override
 Create a firewalling rule. More...
 
- Public Member Functions inherited from service::plugins::firewall::IRuleFactory
 IRuleFactory ()=default
 
virtual ~IRuleFactory ()=default
 
 IRuleFactory (const IRuleFactory &)=delete
 
IRuleFactoryoperator= (const IRuleFactory &)=delete
 
 IRuleFactory (IRuleFactory &&)=delete
 
IRuleFactoryoperator= (IRuleFactory &&)=delete
 

Private Attributes

std::unique_ptr< Internal > m_internal
 

Detailed Description

A factory class to help creating firewalling rules.

This class is the "low level class" that implements IRuleFactory.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

◆ RuleFactory() [1/3]

service::plugins::firewall::RuleFactory::RuleFactory ( const utils::command::IExecutor executor)
explicit

Class constructor

Parameters
executorCommand executor to use

◆ ~RuleFactory()

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

Class destructor

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

◆ RuleFactory() [2/3]

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

Class copy constructor

◆ RuleFactory() [3/3]

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

Class move constructor

Member Function Documentation

◆ createRule()

std::unique_ptr<IRule> service::plugins::firewall::RuleFactory::createRule ( const std::string &  name,
const std::vector< std::string > &  commands 
) const
overridevirtual

Create a firewalling rule.

Create a firewall rule based on informations provided by user in the configuration file.

Parameters
nameThe name of the rule (For internal usage: logging, ...)
commandsThe list of shell commands that compose the rule
Returns
The created rule

Implements service::plugins::firewall::IRuleFactory.

◆ operator=() [1/2]

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

Class copy-assignment operator

◆ operator=() [2/2]

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

Class move-assignment operator

Member Data Documentation

◆ m_internal

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

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