Source now has a default "reload" method implementation which uses
generic configure method.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
#ifndef __HERMES_CONFIG_H__
#define __HERMES_CONFIG_H__
+#include "hermes/core/Severity.h" // TODO Put this into SourceSetting.h
+#include "hermes/core/SourceSetting.h"
+
namespace hermes
{
+// TODO Introduce Source.forward.h
+class Source;
+
/**
* @brief Top-level configuration interface
*
struct Config
{
virtual ~Config() = default;
+
+ virtual void configure(const Source *, SourceSetting &) const = 0;
};
} // namespace hermes
* @brief Update Source with a given configuration
*
* WARNING Do NOT invoke this manually.
+ *
+ * TODO Remove virtual after migration
*/
- virtual void reload(const Config *) = 0;
+ virtual void reload(const Config *);
public:
std::unique_ptr<MessageBuffer> buffer(const Severity &) const;
assert((_reg == nullptr) && (_bus == nullptr));
}
+void Source::reload(const Config *c) { c->configure(this, _setting); }
+
std::unique_ptr<MessageBuffer> Source::buffer(const Severity &) const
{
// TODO Pass Severity