lots of new stuff waow
This commit is contained in:
parent
bb4ccb5d42
commit
867bab1050
38 changed files with 704 additions and 452 deletions
49
src/Services/Weather.hpp
Normal file
49
src/Services/Weather.hpp
Normal file
|
@ -0,0 +1,49 @@
|
|||
#pragma once
|
||||
|
||||
#include <glaze/core/common.hpp> // object
|
||||
#include <glaze/core/meta.hpp> // Object
|
||||
|
||||
#include "Util/Types.hpp"
|
||||
|
||||
namespace weather {
|
||||
using glz::detail::Object, glz::object;
|
||||
using util::types::String, util::types::Vec, util::types::f64, util::types::usize;
|
||||
|
||||
// NOLINTBEGIN(readability-identifier-naming) - Needs to specifically use `glaze`
|
||||
/**
|
||||
* @struct WeatherReport
|
||||
* @brief Represents a weather report.
|
||||
*
|
||||
* Contains temperature, conditions, and timestamp.
|
||||
*/
|
||||
struct WeatherReport {
|
||||
f64 temperature; ///< Degrees (C/F)
|
||||
util::types::Option<String> name; ///< Optional town/city name (may be missing for some providers)
|
||||
String description; ///< Weather description (e.g., "clear sky", "rain")
|
||||
usize timestamp; ///< Seconds since epoch
|
||||
|
||||
/**
|
||||
* @brief Glaze serialization and deserialization for WeatherReport.
|
||||
*/
|
||||
struct [[maybe_unused]] glaze {
|
||||
using T = WeatherReport;
|
||||
|
||||
static constexpr Object value = object(
|
||||
"temperature",
|
||||
&T::temperature,
|
||||
"name",
|
||||
&T::name,
|
||||
"description",
|
||||
&T::description,
|
||||
"timestamp",
|
||||
&T::timestamp
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
struct Coords {
|
||||
f64 lat;
|
||||
f64 lon;
|
||||
};
|
||||
// NOLINTEND(readability-identifier-naming)
|
||||
} // namespace weather
|
Loading…
Add table
Add a link
Reference in a new issue