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 {
13 namespace ctor {
14 
16 class Network : public NodeBase, public hilti::trait::isCtor {
17 public:
18  using Value = hilti::rt::Network;
19 
20  Network(const Value& network, Meta m = Meta()) : NodeBase(nodes(type::Network(m)), m), _network(network) {}
21 
22  const auto& value() const { return _network; }
23 
24  bool operator==(const Network& other) const { return value() == other.value(); }
25 
27  const auto& type() const { return child<Type>(0); }
29  bool isConstant() const { return true; }
31  auto isLhs() const { return false; }
33  auto isTemporary() const { return true; }
35  auto isEqual(const Ctor& other) const { return node::isEqual(this, other); }
37  auto properties() const { return node::Properties{{"network", to_string(_network)}}; }
38 
39 private:
40  Value _network;
41 };
42 
43 } // namespace ctor
44 } // namespace hilti
Definition: network.h:20
Definition: network.h:13
auto properties() const
Definition: network.h:37
Definition: meta.h:18
const auto & type() const
Definition: network.h:27
bool isConstant() const
Definition: network.h:29
std::map< std::string, node::detail::PropertyValue > Properties
Definition: node.h:99
Definition: network.h:16
Definition: ctor.h:15
auto isLhs() const
Definition: network.h:31
auto isTemporary() const
Definition: network.h:33
auto isEqual(const Ctor &other) const
Definition: network.h:35
Definition: node.h:358