LCOV - code coverage report
Current view: top level - src/tables/typeTable - attrTable.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 0.0 % 25 0
Test Date: 2025-04-18 15:53:49 Functions: 0.0 % 4 0

            Line data    Source code
       1              : #include "../../../inc/tables/typeTable/types/userTypes/attrTable.h"
       2              : 
       3              : namespace nicole {
       4              : 
       5            0 : bool AttrTable::has(const std::string &id) const noexcept {
       6            0 :   return table_.count(id);
       7            0 : }
       8              : 
       9              : const std::expected<Attribute, Error>
      10            0 : AttrTable::getAttribute(const std::string &id) const noexcept {
      11            0 :   if (table_.count(id)) {
      12            0 :     return table_.at(id);
      13            0 :   }
      14            0 :   return createError(ERROR_TYPE::ATTR, "Attribute: " + id + " does not exist");
      15            0 : }
      16              : 
      17              : std::expected<std::monostate, Error>
      18            0 : AttrTable::insert(const Attribute &attribute) noexcept {
      19            0 :   if (!has(attribute.id())) {
      20            0 :     table_.emplace(attribute.id(), attribute);
      21            0 :     return {};
      22            0 :   }
      23            0 :   return createError(ERROR_TYPE::ATTR,
      24            0 :                      "the attribute: " + attribute.id() + " already exists");
      25            0 : }
      26              : 
      27              : std::expected<std::monostate, Error>
      28            0 : AttrTable::setAttribute(const Attribute &attribute) noexcept {
      29            0 :   if (!has(attribute.id())) {
      30            0 :     return createError(ERROR_TYPE::ATTR,
      31            0 :                        "Attribute: " + attribute.id() + " does not exist");
      32            0 :   }
      33            0 :   table_.at(attribute.id()) = attribute;
      34            0 :   return {};
      35            0 : }
      36              : 
      37              : 
      38              : } // namespace nicole
        

Generated by: LCOV version 2.0-1