blob: 0c3c353cdb035081ac1b5307fb5ec697037e9b9d [file] [log] [blame]
Deepak Kodihalli16e87542017-02-27 07:07:33 -06001#pragma once
2
3#include <vector>
4#include <string>
5#include <phosphor-logging/elog-errors.hpp>
6#include "elog_entry.hpp"
7
8namespace phosphor
9{
10namespace logging
11{
12namespace metadata
13{
14
15using Metadata = std::string;
16
17namespace associations
18{
19
20using Type = void(const std::string&,
21 const std::vector<std::string>&,
22 AssociationList& list);
23
24/** @brief Build error associations specific to metadata. Specialize this
25 * template for handling a specific type of metadata.
26 * @tparam M - type of metadata
Deepak Kodihalli327e5802017-02-28 02:39:56 -060027 * @param [in] match - metadata to be handled
Deepak Kodihalli16e87542017-02-27 07:07:33 -060028 * @param [in] data - metadata key=value entries
29 * @param [out] list - list of error association objects
30 */
31template <typename M>
32void build(const std::string& match,
33 const std::vector<std::string>& data,
34 AssociationList& list) = delete;
35
Deepak Kodihalli327e5802017-02-28 02:39:56 -060036// Example template specialization - we don't want to do anything
37// for this metadata.
38using namespace example::xyz::openbmc_project::Example::Elog;
39template <>
40inline void build<TestErrorTwo::DEV_ID>(const std::string& match,
41 const std::vector<std::string>& data,
42 AssociationList& list)
43{
44}
45
Deepak Kodihalli16e87542017-02-27 07:07:33 -060046} // namespace associations
47} // namespace metadata
48} // namespace logging
49} // namespace phosphor