4#include <ArmarXCore/interface/components/JsonStorageInterface.h>
16 static const char*
const JsonStorage_PropertyName =
"JsonStorageName";
49 properties->defineOptionalProperty<std::string>(
52 "Name of the JSON storage (duh)");
59 JsonStoreValue insert;
61 insert.value = value.dump();
62 insert.provider =
impl->componentName;
63 impl->proxy->storeJsonValue(insert);
69 JsonRetrieveValue iceResult =
impl->proxy->retrieveValue(key);
72 result.
valid = !iceResult.key.empty();
75 result.
key = iceResult.key;
76 result.
value = nlohmann::json::parse(iceResult.value);
77 result.
provider = iceResult.provider;
78 result.
revision = iceResult.revision;
79 result.
storeTimestamp = IceUtil::Time::microSeconds(iceResult.timestampInMicroSeconds);
92 const nlohmann::json& value)
94 plugin->storeValue(key, value);
100 return plugin->retrieveValue(key);
ManagedIceObject & parent()
std::string makePropertyName(const std::string &name)
std::string getName() const
Retrieve name of object.
This file is part of ArmarX.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
JsonStorageComponentPlugin * plugin
JsonStorageRetrievedValue JsonStorage_retrieveValue(std::string const &key)
void JsonStorage_storeValue(std::string const &key, nlohmann::json const &value)
IceUtil::Time storeTimestamp
std::string componentName
JsonStorageInterfacePrx proxy
void storeValue(std::string const &key, nlohmann::json const &value)
void preOnInitComponent() override
void preOnConnectComponent() override
~JsonStorageComponentPlugin()
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
std::unique_ptr< Impl > impl
JsonStorageRetrievedValue retrieveValue(std::string const &key)