Spicy
network.h
1 // Copyright (c) 2020-2021 by the Zeek Project. See LICENSE for details.
2 
3 #pragma once
4 
5 #include <utility>
6 
7 #include <hilti/rt/types/network.h>
8 
9 #include <hilti/ast/ctor.h>
10 #include <hilti/ast/types/network.h>
11 
12 namespace hilti::ctor {
13 
15 class Network : public NodeBase, public hilti::trait::isCtor {
16 public:
17  using Value = hilti::rt::Network;
18 
19  Network(const Value& network, const Meta& m = Meta()) : NodeBase(nodes(type::Network(m)), m), _network(network) {}
20 
21  const auto& value() const { return _network; }
22 
23  bool operator==(const Network& other) const { return value() == other.value(); }
24 
26  const auto& type() const { return child<Type>(0); }
28  bool isConstant() const { return true; }
30  auto isLhs() const { return false; }
32  auto isTemporary() const { return true; }
34  auto isEqual(const Ctor& other) const { return node::isEqual(this, other); }
36  auto properties() const { return node::Properties{{"network", to_string(_network)}}; }
37 
38 private:
39  Value _network;
40 };
41 
42 } // namespace hilti::ctor
Definition: network.h:20
Definition: network.h:12
auto properties() const
Definition: network.h:36
Definition: meta.h:19
const auto & type() const
Definition: network.h:26
bool isConstant() const
Definition: network.h:28
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:98
Definition: network.h:15
Definition: ctor.h:15
auto isLhs() const
Definition: network.h:30
auto isTemporary() const
Definition: network.h:32
auto isEqual(const Ctor &other) const
Definition: network.h:34
Definition: node.h:360