10 "RECEIVING_OPERATION",
11 "REBROADCASTING_OPERATION" 36 if (!args[0].is_file_type ())
63 if (args[0].is_file_type ())
87 std::stringstream buffer;
88 buffer <<
"Filter args:\n";
91 buffer <<
" [0:Record]: " ;
96 buffer <<
" [1:Record Name]: " ;
97 buffer << args[1].to_string ();
101 buffer <<
" [2:Operation Type]: " ;
106 buffer <<
" [3:Send Bandwidth]: " ;
107 buffer << args[3].to_integer ();
111 buffer <<
" [4:Receive Bandwidth]: " ;
112 buffer << args[4].to_integer ();
116 buffer <<
" [5:Update Time]: " ;
117 buffer << args[5].to_integer ();
121 buffer <<
" [6:Current Time]: " ;
122 buffer << args[6].to_integer ();
126 buffer <<
" [7:Knowledge Domain]: " ;
127 buffer << args[7].to_string ();
131 buffer <<
" [8:Originator]: " ;
132 buffer << args[8].to_string ();
135 vars.
print (buffer.str (), 0);
147 std::stringstream buffer;
148 buffer <<
"Aggregate Filter Arguments:\n";
151 buffer <<
" Operation Type: " ;
156 buffer <<
" Send Bandwidth: " ;
161 buffer <<
" Receive Bandwidth: " ;
166 buffer <<
" Update Time: " ;
171 buffer <<
" Current Time: " ;
176 buffer <<
" Knowledge Domain: " ;
181 buffer <<
" Originator: " ;
185 buffer <<
" Updates:\n" ;
186 if (records.size () > 0)
188 for (knowledge::KnowledgeMap::const_iterator i = records.begin ();
189 i != records.end (); ++i)
191 buffer <<
" " << i->first <<
" = ";
192 buffer << i->second.to_string () <<
"\n";
196 vars.
print (buffer.str (), 0);
This class encapsulates an entry in a KnowledgeBase.
MADARA_Export knowledge::KnowledgeRecord discard_nonprimitives(knowledge::FunctionArguments &args, knowledge::Variables &vars)
Filter for discarding a non-primitive record.
madara::knowledge::KnowledgeRecord KnowledgeRecord
std::vector< KnowledgeRecord > FunctionArguments
Provides context about the transport.
uint64_t get_receive_bandwidth(void) const
Gets the receive bandwidth in bytes per second.
uint64_t get_current_time(void) const
Gets the current timestamp.
int64_t get_operation(void) const
Get operation that the context is performing.
MADARA_Export void log_aggregate(knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context, knowledge::Variables &vars)
Filter for logging aggregate update and context.
::std::map< std::string, KnowledgeRecord > KnowledgeMap
MADARA_Export knowledge::KnowledgeRecord discard_nonfiles(knowledge::FunctionArguments &args, knowledge::Variables &vars)
Filter for discarding a non-file record.
uint64_t get_message_time(void) const
Gets the message timestamp.
const char * operation_types[]
MADARA_Export knowledge::KnowledgeRecord discard(knowledge::FunctionArguments &args, knowledge::Variables &vars)
Filter for discarding a record.
const std::string & get_domain(void) const
Returns the network domain.
const std::string & get_originator(void) const
Returns the current message originator.
MADARA_Export knowledge::KnowledgeRecord log_args(knowledge::FunctionArguments &args, knowledge::Variables &vars)
Filter for logging args.
std::string to_string(const std::string &delimiter=", ") const
converts the value to a string.
Provides an interface for external functions into the MADARA KaRL variable settings.
void print(unsigned int level=0) const
Prints all variables and values in the context.
uint64_t get_send_bandwidth(void) const
Gets the send/rebroadcast bandwidth in bytes per second.