Merge remote-tracking branch 'origin/topic/timw/266-namespaces'

Merge adjustments:

- Preserved original `base_type_no_ref` argument type as ::TypeTag
- Removed superfluous #pragma guard around deprecated TableVal ctor
- Clarify NEWS regarding MetaHook{Pre,Post} deprecations
- Simplify some `::zeek::` qualifications to just `zeek::`
- Prefixed FORWARD_DECLARE_NAMESPACED macro with ZEEK_

* origin/topic/timw/266-namespaces:
  Disable some deprecation diagnostics for GCC
  Rename BroType to Type
  Update NEWS
  Review cleanup
  Move Type types to zeek namespace
  Move Flare/Pipe from the bro namespace to zeek::detail
  Move Attr to the zeek::detail namespace
  Move Trigger into the zeek::detail namespace
  Move ID to the zeek::detail namespace
  Move Anon.h into zeek::detail namespace
  Mark all of the aliased classes in plugin/Plugin.h deprecated, and fix all of the plugins that were using them
  Move all of the base plugin classes into the zeek::plugin namespace
  Expr: move all classes into zeek::detail
  Stmt: move Stmt classes into zeek::detail namespace
  Add utility macro for creating namespaced aliases for classes
This commit is contained in:
Jon Siwek 2020-06-11 23:12:02 -07:00
commit d4f3cad7d1
256 changed files with 4277 additions and 3501 deletions

View file

@ -1,22 +1,25 @@
#pragma once
#include "Obj.h"
#include "Notifier.h"
#include "iosource/IOSource.h"
#include <list>
#include <vector>
#include <map>
class CallExpr;
class Expr;
class Stmt;
#include "Obj.h"
#include "Notifier.h"
#include "iosource/IOSource.h"
#include "util.h"
class Frame;
class Val;
class ID;
class ODesc;
namespace trigger {
ZEEK_FORWARD_DECLARE_NAMESPACED(Stmt, zeek::detail);
ZEEK_FORWARD_DECLARE_NAMESPACED(Expr, zeek::detail);
ZEEK_FORWARD_DECLARE_NAMESPACED(CallExpr, zeek::detail);
ZEEK_FORWARD_DECLARE_NAMESPACED(ID, zeek::detail);
namespace zeek::detail::trigger {
// Triggers are the heart of "when" statements: expressions that when
// they become true execute a body of statements.
@ -29,7 +32,7 @@ public:
// instantiation. Note that if the condition is already true, the
// statements are executed immediately and the object is deleted
// right away.
Trigger(Expr* cond, Stmt* body, Stmt* timeout_stmts, Expr* timeout,
Trigger(zeek::detail::Expr* cond, zeek::detail::Stmt* body, zeek::detail::Stmt* timeout_stmts, zeek::detail::Expr* timeout,
Frame* f, bool is_return, const Location* loc);
~Trigger() override;
@ -60,8 +63,8 @@ public:
// Cache for return values of delayed function calls. Returns whether
// the trigger is queued for later evaluation -- it may not be queued
// if the Val is null or it's disabled.
bool Cache(const CallExpr* expr, Val* val);
Val* Lookup(const CallExpr*);
bool Cache(const zeek::detail::CallExpr* expr, Val* val);
Val* Lookup(const zeek::detail::CallExpr*);
// Disable this trigger completely. Needed because Unref'ing the trigger
// may not immediately delete it as other references may still exist.
@ -87,14 +90,14 @@ private:
friend class TriggerTimer;
void Init();
void Register(ID* id);
void Register(zeek::detail::ID* id);
void Register(Val* val);
void UnregisterAll();
Expr* cond;
Stmt* body;
Stmt* timeout_stmts;
Expr* timeout;
zeek::detail::Expr* cond;
zeek::detail::Stmt* body;
zeek::detail::Stmt* timeout_stmts;
zeek::detail::Expr* timeout;
double timeout_value;
Frame* frame;
bool is_return;
@ -108,7 +111,7 @@ private:
std::vector<std::pair<BroObj *, notifier::Modifiable*>> objs;
using ValCache = std::map<const CallExpr*, Val*>;
using ValCache = std::map<const zeek::detail::CallExpr*, Val*>;
ValCache cache;
};
@ -140,4 +143,9 @@ private:
}
extern trigger::Manager* trigger_mgr;
namespace trigger {
using Trigger [[deprecated("Remove in v4.1. Use zeek::detail::trigger::Trigger instead")]] = zeek::detail::trigger::Trigger;
using Manager [[deprecated("Remove in v4.1. Use zeek::detail::trigger::Manager instead")]] = zeek::detail::trigger::Manager;
}
extern zeek::detail::trigger::Manager* trigger_mgr;