mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 19:48:20 +00:00
Reformat the world
This commit is contained in:
parent
194cb24547
commit
b2f171ec69
714 changed files with 35149 additions and 35203 deletions
|
@ -2,29 +2,31 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
namespace zeek::iosource {
|
||||
namespace zeek::iosource
|
||||
{
|
||||
|
||||
/**
|
||||
* Interface class for components providing/consuming data inside Bro's main
|
||||
* loop.
|
||||
*/
|
||||
class IOSource {
|
||||
class IOSource
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
IOSource() { closed = false; }
|
||||
IOSource() { closed = false; }
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
*/
|
||||
virtual ~IOSource() {}
|
||||
virtual ~IOSource() { }
|
||||
|
||||
/**
|
||||
* Returns true if more data is to be expected in the future.
|
||||
* Otherwise, source may be removed.
|
||||
*/
|
||||
bool IsOpen() const { return ! closed; }
|
||||
bool IsOpen() const { return ! closed; }
|
||||
|
||||
/**
|
||||
* Returns true if this is a packet source.
|
||||
|
@ -34,13 +36,13 @@ public:
|
|||
/**
|
||||
* Initializes the source. Can be overwritten by derived classes.
|
||||
*/
|
||||
virtual void InitSource() { }
|
||||
virtual void InitSource() { }
|
||||
|
||||
/**
|
||||
* Finalizes the source when it's being closed. Can be overwritten by
|
||||
* derived classes.
|
||||
*/
|
||||
virtual void Done() { }
|
||||
virtual void Done() { }
|
||||
|
||||
/**
|
||||
* Return the next timeout value for this source. This should be
|
||||
|
@ -74,16 +76,15 @@ public:
|
|||
virtual const char* Tag() = 0;
|
||||
|
||||
protected:
|
||||
|
||||
/*
|
||||
* Callback for derived class to call when they have shutdown.
|
||||
*
|
||||
* @param is_closed True if the source is now closed.
|
||||
*/
|
||||
void SetClosed(bool is_closed) { closed = is_closed; }
|
||||
void SetClosed(bool is_closed) { closed = is_closed; }
|
||||
|
||||
private:
|
||||
bool closed;
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace zeek::iosource
|
||||
} // namespace zeek::iosource
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue