<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Menlo;
panose-1:2 11 6 9 3 8 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hello,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="background:#ECFDF0;vertical-align:top"><i><span style="font-size:9.5pt;font-family:Menlo;color:#999988">// create mapping of function name to actual function of Entry class</span></i><span style="font-size:9.5pt;font-family:Menlo;color:#303030">
<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#ECFDF0;vertical-align:top"><b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">typedef</span></b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">
</span><span style="font-size:9.5pt;font-family:Menlo;color:#333333">std</span><b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">::</span></b><span style="font-size:9.5pt;font-family:Menlo;color:#333333">string</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">
(</span><span style="font-size:9.5pt;font-family:Menlo;color:#333333">Entry</span><b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">::*</span></b><span style="font-size:9.5pt;font-family:Menlo;color:#333333">entry_method_t</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">)(</span><span style="font-size:9.5pt;font-family:Menlo;color:#333333">std</span><b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">::</span></b><span style="font-size:9.5pt;font-family:Menlo;color:#333333">string</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">);
<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#ECFDF0;vertical-align:top"><span style="font-size:9.5pt;font-family:Menlo;color:#333333">std</span><b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">::</span></b><span style="font-size:9.5pt;font-family:Menlo;color:#333333">map</span><b><span style="font-size:9.5pt;font-family:Menlo;color:#303030"><</span></b><span style="font-size:9.5pt;font-family:Menlo;color:#333333">std</span><b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">::</span></b><span style="font-size:9.5pt;font-family:Menlo;color:#333333">string</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">,
</span><span style="font-size:9.5pt;font-family:Menlo;color:#333333">entry_method_t</span><b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">></span></b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">
</span><span style="font-size:9.5pt;font-family:Menlo;color:#333333">fnMap</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">;
<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#ECFDF0;vertical-align:top"><span style="font-size:9.5pt;font-family:Menlo;color:#333333">fnMap</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">[</span><span style="font-size:9.5pt;font-family:Menlo;color:#DD1144">"resolution"</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">]
<b>=</b> <b>&</b></span><span style="font-size:9.5pt;font-family:Menlo;color:#333333">Entry</span><b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">::</span></b><span style="font-size:9.5pt;font-family:Menlo;color:#333333">resolution</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">;
<o:p></o:p></span></p>
<p class="MsoNormal" style="background:#ECFDF0;vertical-align:top"><span style="font-size:9.5pt;font-family:Menlo;color:#333333">fnMap</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">[</span><span style="font-size:9.5pt;font-family:Menlo;color:#DD1144">"eventid"</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">]
<b>=</b> <b>&</b></span><span style="font-size:9.5pt;font-family:Menlo;color:#333333">Entry</span><b><span style="font-size:9.5pt;font-family:Menlo;color:#303030">::</span></b><span style="font-size:9.5pt;font-family:Menlo;color:#333333">eventId</span><span style="font-size:9.5pt;font-family:Menlo;color:#303030">;<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any thoughts and insights would be appreciated.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Regards,<o:p></o:p></p>
<p class="MsoNormal">Christian<o:p></o:p></p>
</div>
</body>
</html>