[phosphor-logging] Entry Class Methods Mapping

Christian Choi christianc at nvidia.com
Wed Nov 17 07:26:26 AEDT 2021


Hello,

I need a way to map the string representation of methods in the Entry class to the actual method itself. Right now, I am hard-coding my own map as follows:

// create mapping of function name to actual function of Entry class
typedef std::string (Entry::*entry_method_t)(std::string);
std::map<std::string, entry_method_t> fnMap;
fnMap["resolution"] = &Entry::resolution;
fnMap["eventid"] = &Entry::eventId;

I was wondering if there already exists some mechanism in the code that accomplishes this so I don’t have to write the code myself like I did above. I was told by someone that sdbusplus may provide a mapping like this.

Any thoughts and insights would be appreciated.

Regards,
Christian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20211116/029dfe40/attachment-0001.htm>


More information about the openbmc mailing list