MADARA  3.2.3
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::vector< std::string > &originators)
 Adds trusted originators who will be able to prompt deleting. More...
 
void add_trusted_originator (const std::string &originator)
 Adds trusted originator 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

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.

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

Destructor.

Definition at line 14 of file EndpointClear.cpp.

Member Function Documentation

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 105 of file EndpointClear.cpp.

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 116 of file EndpointClear.cpp.

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 123 of file EndpointClear.cpp.

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 20 of file EndpointClear.cpp.

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 129 of file EndpointClear.cpp.

Member Data Documentation

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

A map of discovered peers.

Definition at line 108 of file EndpointClear.h.

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

Tracks if the peers_ map has been initialized.

Definition at line 93 of file EndpointClear.h.

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

The context.

Definition at line 98 of file EndpointClear.h.

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

originators that are trusted to prompt a clear of endpoints

Definition at line 103 of file EndpointClear.h.


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