refactor charge sockets data processing into dedicated class

While here, add method to generate the OSM keys corresponding
to a socket list.

Signed-off-by: Séverin Lemaignan <severin@guakamole.org>
This commit is contained in:
Séverin Lemaignan
2025-09-28 20:51:49 +02:00
committed by x7z4w
parent e7f766084f
commit 0c0e9ab5f6
10 changed files with 519 additions and 295 deletions

View File

@@ -10,6 +10,8 @@
#include "coding/string_utf8_multilang.hpp"
#include "feature_helpers/feature_charge_sockets.hpp"
#include <string>
#include <vector>
@@ -17,17 +19,6 @@ namespace osm
{
class EditableMapObject;
// struct to store the representation of a charging station socket
struct ChargeSocketDescriptor
{
std::string type; // https://wiki.openstreetmap.org/wiki/Key:socket:*
// e.g. "type1"
unsigned int count; // number of sockets; 0 means socket present, but unknown count
// (eg, OSM tag for count set to 'yes')
double power; // power output, in kW. 0 means unknown.
};
typedef std::vector<ChargeSocketDescriptor> ChargeSocketDescriptors;
class MapObject
{
public: