Porytiles
Loading...
Searching...
No Matches
operand_declaration.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <expected>
4#include <string>
5#include <typeindex>
6
7namespace porytiles2 {
8
18 public:
29 OperandDeclaration(std::string key, const std::type_index type)
30 : key_{std::move(key)}, expected_type_{type}, desc_{key}
31 {
32 }
33
39 [[nodiscard]] const std::string &key() const
40 {
41 return key_;
42 }
43
49 [[nodiscard]] const std::type_index &expected_type() const
50 {
51 return expected_type_;
52 }
53
59 [[nodiscard]] const std::string &description() const
60 {
61 return desc_;
62 }
63
69 void set_description(const std::string &desc)
70 {
71 desc_ = desc;
72 }
73
74 private:
75 std::string key_;
76 std::type_index expected_type_;
77 std::string desc_;
78};
79
80} // namespace porytiles2
A specification for operands required or produced by orchestration operations.
void set_description(const std::string &desc)
Sets a custom description for this operand.
OperandDeclaration(std::string key, const std::type_index type)
Constructs an operand declaration with the specified key and type.
const std::string & description() const
Gets the human-readable description of this operand.
const std::string & key() const
Gets the operand's unique identifier.
const std::type_index & expected_type() const
Gets the expected type information for this operand.