MADARA  3.4.1
madara::filters::EndpointClear Class Reference

Filter for deleting endpoints, usually when new endpoints have been discovered. More...

#include <EndpointClear.h>

Inheritance diagram for madara::filters::EndpointClear:
madara::filters::AggregateFilter

Public Member Functions

 EndpointClear (const std::string &prefix=".endpoints")
 Constructor. More...
 
virtual ~EndpointClear ()
 Destructor. More...
 
void add_trusted_originator (const std::string &originator)
 Adds trusted originator who will be able to prompt deleting. More...
 
void add_trusted_originator (const std::vector< std::string > &originators)
 Adds trusted originators who will be able to prompt deleting. More...
 
void clear_trusted_originators (void)
 Clears all trusted originators who can prompt deleting. More...
 
virtual void filter (knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context, knowledge::Variables &vars)
 Calls the main logic of the filter. More...
 
void set_prefix (const std::string &prefix)
 Sets the prefix to use. More...
 

Protected Attributes

knowledge::containers::Map endpoints_
 A map of discovered peers. More...
 
bool initialized_
 Tracks if the peers_ map has been initialized. More...
 
std::string prefix_
 The context. More...
 
std::map< std::string, bool > trusted_originators_
 originators that are trusted to prompt a clear of endpoints More...
 

Detailed Description

Filter for deleting endpoints, usually when new endpoints have been discovered.

Definition at line 37 of file EndpointClear.h.

Constructor & Destructor Documentation

◆ EndpointClear()

madara::filters::EndpointClear::EndpointClear ( const std::string &  prefix = ".endpoints")

Constructor.

Parameters
prefixthe prefix where the endpoint map can be found

Definition at line 8 of file EndpointClear.cpp.

◆ ~EndpointClear()

madara::filters::EndpointClear::~EndpointClear ( )
virtual

Destructor.

Definition at line 13 of file EndpointClear.cpp.

Member Function Documentation

◆ add_trusted_originator() [1/2]

void madara::filters::EndpointClear::add_trusted_originator ( const std::string &  originator)

Adds trusted originator who will be able to prompt deleting.

Parameters
originatorthe trusted originator to add

Definition at line 102 of file EndpointClear.cpp.

◆ add_trusted_originator() [2/2]

void madara::filters::EndpointClear::add_trusted_originator ( const std::vector< std::string > &  originators)

Adds trusted originators who will be able to prompt deleting.

Parameters
originatorsthe trusted originators to add

Definition at line 92 of file EndpointClear.cpp.

◆ clear_trusted_originators()

void madara::filters::EndpointClear::clear_trusted_originators ( void  )

Clears all trusted originators who can prompt deleting.

A cleared list means all originators who write to the prefix will prompt deletion

Definition at line 108 of file EndpointClear.cpp.

◆ filter()

void madara::filters::EndpointClear::filter ( knowledge::KnowledgeMap records,
const transport::TransportContext transport_context,
knowledge::Variables vars 
)
virtual

Calls the main logic of the filter.

Parameters
recordsthe aggregate records vector
transport_contextcontext for querying transport state
varscontext for querying current program state

Implements madara::filters::AggregateFilter.

Definition at line 15 of file EndpointClear.cpp.

◆ set_prefix()

void madara::filters::EndpointClear::set_prefix ( const std::string &  prefix)

Sets the prefix to use.

Parameters
prefixthe prefix where the endpoint map can be found

Definition at line 113 of file EndpointClear.cpp.

Member Data Documentation

◆ endpoints_

knowledge::containers::Map madara::filters::EndpointClear::endpoints_
protected

A map of discovered peers.

Definition at line 105 of file EndpointClear.h.

◆ initialized_

bool madara::filters::EndpointClear::initialized_
protected

Tracks if the peers_ map has been initialized.

Definition at line 90 of file EndpointClear.h.

◆ prefix_

std::string madara::filters::EndpointClear::prefix_
protected

The context.

Definition at line 95 of file EndpointClear.h.

◆ trusted_originators_

std::map<std::string, bool> madara::filters::EndpointClear::trusted_originators_
protected

originators that are trusted to prompt a clear of endpoints

Definition at line 100 of file EndpointClear.h.


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