Skip to content

Commit

Permalink
Merge branch 'master' into development/Compositor2306
Browse files Browse the repository at this point in the history
  • Loading branch information
bramoosterhuis authored Jul 31, 2023
2 parents b0059c2 + 54a6974 commit 036d5ad
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions Dictionary/Dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ namespace Plugin {
return (result);
}

/* virtual */ bool Dictionary::Get(const string& nameSpace, const string& key, string& value) const
/* virtual */ Core::hresult Dictionary::Get(const string& nameSpace, const string& key, string& value) const
{
bool result = false;
Core::hresult result = Core::ERROR_UNKNOWN_KEY;

_adminLock.Lock();

Expand All @@ -244,7 +244,7 @@ namespace Plugin {
}

if (listIndex != container.end()) {
result = true;
result = Core::ERROR_NONE;
value = listIndex->Value();
}
}
Expand Down Expand Up @@ -281,10 +281,10 @@ namespace Plugin {

// Direct method to Set a value for a key in a certain namespace from the dictionary.
// NameSpace and key MUST be filled.
/* virtual */ bool Dictionary::Set(const string& nameSpace, const string& key, const string& value)
/* virtual */ Core::hresult Dictionary::Set(const string& nameSpace, const string& key, const string& value)
{
// Direct method to Set a value for a key in a certain namespace from the dictionary.
bool result = false;
Core::hresult result = Core::ERROR_UNKNOWN_KEY;

_adminLock.Lock();

Expand All @@ -296,14 +296,14 @@ namespace Plugin {
}

if (listIndex == container.end()) {
result = true;
result = Core::ERROR_NONE;
container.push_back(RuntimeEntry(key, value, VOLATILE));
} else if (listIndex->Value() != value) {
result = true;
result = Core::ERROR_NONE;
listIndex->Value(value);
}

if (result == true) {
if (result == Core::ERROR_NONE) {
ObserverMap::iterator index(_observers.begin());

// Right, we updated send out the modification !!!
Expand Down
4 changes: 2 additions & 2 deletions Dictionary/Dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,12 @@ namespace Plugin {
// -------------------------------------------------------------------------------------------------------
// Direct method to Get a value from a key in a certain namespace from the dictionary.
// NameSpace and key MUST be filled.
bool Get(const string& nameSpace, const string& key, string& value) const override;
Core::hresult Get(const string& nameSpace, const string& key, string& value) const override;
IDictionary::IIterator* Get(const string& nameSpace) const override;

// Direct method to Set a value for a key in a certain namespace from the dictionary.
// NameSpace and key MUST be filled.
bool Set(const string& nameSpace, const string& key, const string& value) override;
Core::hresult Set(const string& nameSpace, const string& key, const string& value) override;
void Register(const string& nameSpace, struct Exchange::IDictionary::INotification* sink) override;
void Unregister(const string& nameSpace, struct Exchange::IDictionary::INotification* sink) override;

Expand Down
2 changes: 1 addition & 1 deletion ProcessContainers/Containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace Plugin {
uint32_t endpoint_start(const JsonData::Containers::StartParamsData& params);
uint32_t endpoint_stop(const JsonData::Containers::StopParamsData& params);
uint32_t get_containers(Core::JSON::ArrayType<Core::JSON::String>& response) const;
uint32_t get_networks(const string& index, Core::JSON::ArrayType<JsonData::Containers::NetworksData>& response) const;
uint32_t get_networks(const string& index, Core::JSON::ArrayType<JsonData::Containers::NetworksResultDataElem>& response) const;
uint32_t get_memory(const string& index, JsonData::Containers::MemoryData& response) const;
uint32_t get_cpu(const string& index, JsonData::Containers::CpuData& response) const;
};
Expand Down
6 changes: 3 additions & 3 deletions ProcessContainers/ContainersJsonRpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Plugin {
Register<StartParamsData,void>(_T("start"), &Containers::endpoint_start, this);
Register<StopParamsData,void>(_T("stop"), &Containers::endpoint_stop, this);
Property<Core::JSON::ArrayType<Core::JSON::String>>(_T("containers"), &Containers::get_containers, nullptr, this);
Property<Core::JSON::ArrayType<NetworksData>>(_T("networks"), &Containers::get_networks, nullptr, this);
Property<Core::JSON::ArrayType<NetworksResultDataElem>>(_T("networks"), &Containers::get_networks, nullptr, this);
Property<MemoryData>(_T("memory"), &Containers::get_memory, nullptr, this);
Property<CpuData>(_T("cpu"), &Containers::get_cpu, nullptr, this);
}
Expand Down Expand Up @@ -137,7 +137,7 @@ namespace Plugin {
// Return codes:
// - ERROR_NONE: Success
// - ERROR_UNAVAILABLE: Container not found
uint32_t Containers::get_networks(const string& index, Core::JSON::ArrayType<NetworksData>& response) const
uint32_t Containers::get_networks(const string& index, Core::JSON::ArrayType<NetworksResultDataElem>& response) const
{
uint32_t result = Core::ERROR_NONE;

Expand All @@ -149,7 +149,7 @@ namespace Plugin {

if (iterator != nullptr) {
while(iterator->Next() == true) {
NetworksData networkData;
NetworksResultDataElem networkData;

networkData.Interface = iterator->Name();

Expand Down
2 changes: 1 addition & 1 deletion examples/OutOfProcessPlugin/OutOfProcessPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace Plugin {
_browserresources = _browser->QueryInterface<Exchange::IBrowserResources>();
if( _browserresources != nullptr) {
Exchange::JBrowserResources::Register(*this, _browserresources);
Register("bigupdate", [this](const Core::JSONRPC::Context&, const string& params){
Register("bigupdate", [this](const Core::JSONRPC::Context&, const string& params, Core::OptionalType<Core::JSON::Error>&) {
uint32_t updates = 5000;
string sleep("100");
if(params.empty() == false) {
Expand Down

0 comments on commit 036d5ad

Please sign in to comment.