ReUseX  0.0.5
3D Point Cloud Processing for Building Reuse
Loading...
Searching...
No Matches
resources.hpp File Reference
#include "reusex/core/ProjectDB.hpp"
#include "reusex/core/resource_keys.hpp"
#include <cstddef>
#include <cstdint>
#include <optional>
#include <stdexcept>
#include <string>
#include <string_view>
#include <vector>
Include dependency graph for resources.hpp:

Go to the source code of this file.

Classes

struct  reusex::core::ResourceValue
struct  reusex::core::Resource
struct  reusex::core::ResourceWrite
struct  reusex::core::ResourcePatchResult
struct  reusex::core::SurveyTypeDeletion
 Delete a survey type and every part in it, with delete_resource's rules for each part (tombstones, passports), in one transaction. More...
struct  reusex::core::ColumnPatch
 Sparse update of a user column definition. More...

Namespaces

namespace  reusex
namespace  reusex::core
 Wire form of one stored report PDF version — the ReportPdfVersion schema in ruxd's API contract (docs/gui/openapi.yaml, in the ruxd repo).

Functions

std::optional< std::string > reusex::core::value_of (const Resource &r, std::string_view key)
 The value stored under key in r, or nullopt (absent or unset).
std::vector< Resource > reusex::core::list_resources (const ProjectDB &db, const std::optional< std::vector< std::string > > &keys=std::nullopt)
 One per survey part, by code.
Resource reusex::core::resource (const ProjectDB &db, std::string_view code, const std::optional< std::vector< std::string > > &keys=std::nullopt)
ResourcePatchResult reusex::core::patch_resource (ProjectDB &db, std::string_view code, const std::vector< ResourceWrite > &writes, const std::optional< std::vector< std::string > > &keys=std::nullopt)
 Validate every write (normalise_value), then apply them in one transaction: type-scoped keys to the survey type, part-scoped built-ins to the part, leksikon/column keys to the part's passport (created on the first non-null write).
Resource reusex::core::create_resource (ProjectDB &db, int64_t type_id, const std::optional< std::string > &name=std::nullopt)
 A manual part with the next RX code; name becomes its designation.
void reusex::core::delete_resource (ProjectDB &db, std::string_view code)
 Delete a part — manual or instance-backed — in one transaction.
SurveyTypeDeletion reusex::core::delete_survey_type (ProjectDB &db, int64_t type_id)
ProjectDB::PropertyDefinition reusex::core::create_column (ProjectDB &db, ProjectDB::PropertyDefinition def)
 Add a user column (def.id is ignored and returned filled in).
void reusex::core::delete_column (ProjectDB &db, const std::string &id)
 Delete a user column and, in the same transaction, every value stored under its name (logged at warn with the count), so the name can be used again.
ProjectDB::PropertyDefinition reusex::core::update_column (ProjectDB &db, const std::string &id, const ColumnPatch &patch)
 A rename moves the stored values in the same transaction.

Variables

constexpr std::string_view reusex::core::kDesignationField = "designation"
 The leksikon field a hand-added resource's name is stored under.