Make SendEvent callable from all threads

This commit refactors the SendEvent call and moves it from the Input
ReaderBackend to to MsgThread. This allows all other types of threads
to access this functionality.

This necessitated a few more changes. Most importantly, one of the
ValueToVal methods was moved over to SerialTypes. Whereit arguably
belongs - there was nothing that was input-framework specific in
that method - and the functionality could come in useful in a number
of cases.
This commit is contained in:
Johanna Amann 2020-05-18 14:38:10 -07:00
parent 9dec370048
commit 034304b9d5
12 changed files with 353 additions and 331 deletions

View file

@ -60,6 +60,18 @@ public:
*/
void SendOut(BasicOutputMessage* msg) { return SendOut(msg, false); }
/**
* Allows the child thread to send a specified Zeek event. The given Vals
* must match the values expected by the event.
*
* @param name name of the bro event to send
*
* @param num_vals number of entries in \a vals
*
* @param vals the values to be given to the event
*/
void SendEvent(const char* name, const int num_vals, threading::Value* *vals);
/**
* Reports an informational message from the child thread. The main
* thread will pass this to the Reporter once received.
@ -393,7 +405,7 @@ protected:
};
/**
* A paremeterized InputMessage that stores a pointer to an argument object.
* A parameterized InputMessage that stores a pointer to an argument object.
* Normally, the objects will be used from the Process() callback.
*/
template<typename O>