Skip to content

Commit

Permalink
[JSONPC] Update the implementation accordingly :-)
Browse files Browse the repository at this point in the history
  • Loading branch information
pwielders committed Jul 30, 2023
1 parent a2bdd86 commit 515aa95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 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

0 comments on commit 515aa95

Please sign in to comment.