// SPDX-License-Identifier: MIT #ifndef DBC_ATTRIBUTES_H #define DBC_ATTRIBUTES_H #include #include #include #include #include #include enum class AttributeScope { Database, Node, Frame, Signal, Environment }; enum class AttributeType { Integer, Hex, Float, String, Enum }; using AttributeValue = std::variant; using AttributeMap = std::map; struct AttributeDefinition { AttributeScope scope = AttributeScope::Database; AttributeType type = AttributeType::String; std::int64_t integerMinimum = 0; std::int64_t integerMaximum = 0; double minimum = 0.0; double maximum = 0.0; std::vector enumValues; std::optional defaultValue; }; /** Explicit assignment; defaults remain on definitions. Named nodes/environment * variables are retained without validating declarations, which are not parsed. */ struct AttributeAssignment { std::string name; AttributeScope scope = AttributeScope::Database; std::uint32_t canId = 0U; bool isExtended = false; std::string targetName; AttributeValue value; }; #endif