首次提交

This commit is contained in:
2026-08-07 16:21:44 +08:00
parent 396311246c
commit 1e903dfe1e
33 changed files with 5960 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
#include <structive/property/extensions/presentation.hpp>
#include <iostream>
using namespace structive;
struct Device : Property_Object<Device> {
double temperature{25.0};
};
template <>
struct structive::Type_Descriptor<Device> {
static auto get() {
return object<Device>(
field < &Device::temperature > (
key < "temperature" >,
unit < "C" >,
presentation::label < "Temperature" >,
presentation::description < "Current device temperature" >
)
);
}
};
int main() {
Device device;
auto info = presentation::describe < &Device::temperature > (device.schema());
std::cout << info.key << '=' << info.label << '\n';
}