Skip to content

Commit

Permalink
[Messaging] Adding a method to get all available modules, Controls me…
Browse files Browse the repository at this point in the history
…thod now also takes a module name (#298)

* The initial commit after which oop only controls are yet missed

* Changing the modules list to a vector to match framework changes
  • Loading branch information
VeithMetro authored May 8, 2024
1 parent 0ae7d1c commit 6081b90
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions MessageControl/MessageControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,18 +407,30 @@ namespace Plugin {
}
}

uint32_t Enable(const messagetype type, const string& category, const string& module, const bool enabled) override
Core::hresult Enable(const messagetype type, const string& category, const string& module, const bool enabled) override
{
_client.Enable({static_cast<Core::Messaging::Metadata::type>(type), category, module}, enabled);

return (Core::ERROR_NONE);
}

uint32_t Controls(Exchange::IMessageControl::IControlIterator*& controls) const override
Core::hresult Modules(Exchange::IMessageControl::IStringIterator*& modules) const override
{
std::vector<string> list;

_client.Modules(list);

using Implementation = RPC::IteratorType<RPC::IStringIterator>;
modules = Core::ServiceType<Implementation>::Create<RPC::IStringIterator>(list);

return (Core::ERROR_NONE);
}

Core::hresult Controls(const string& module, Exchange::IMessageControl::IControlIterator*& controls) const override
{
std::list<Exchange::IMessageControl::Control> list;
Messaging::MessageUnit::Iterator index;
_client.Controls(index);
_client.Controls(index, module);

while (index.Next() == true) {
list.push_back( { static_cast<messagetype>(index.Type()), index.Category(), index.Module(), index.Enabled() } );
Expand Down

0 comments on commit 6081b90

Please sign in to comment.