P4C
The P4 Compiler
Loading...
Searching...
No Matches
test_object.h
1/*
2 * SPDX-FileCopyrightText: 2023 The P4 Language Consortium
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_LIB_TEST_OBJECT_H_
8#define BACKENDS_P4TOOLS_MODULES_TESTGEN_LIB_TEST_OBJECT_H_
9#include <map>
10
11#include "backends/p4tools/common/lib/model.h"
12#include "lib/castable.h"
13#include "lib/cstring.h"
14
15namespace P4::P4Tools::P4Testgen {
16
17/* =========================================================================================
18 * Abstract Test Object Class
19 * ========================================================================================= */
20
21class TestObject : public ICastable {
22 public:
23 TestObject() = default;
24 ~TestObject() override = default;
25 TestObject(const TestObject &) = default;
26 TestObject(TestObject &&) = default;
27 TestObject &operator=(const TestObject &) = default;
28 TestObject &operator=(TestObject &&) = default;
29
31 [[nodiscard]] virtual cstring getObjectName() const = 0;
32
35 [[nodiscard]] virtual const TestObject *evaluate(const Model &model, bool doComplete) const = 0;
36
37 DECLARE_TYPEINFO(TestObject);
38};
39
42
43} // namespace P4::P4Tools::P4Testgen
44
45#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_LIB_TEST_OBJECT_H_ */
Definition castable.h:27
Definition backends/p4tools/common/lib/model.h:24
virtual cstring getObjectName() const =0
virtual const TestObject * evaluate(const Model &model, bool doComplete) const =0
Definition cstring.h:85
Definition ordered_map.h:32