<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Solved: Exposition of a getter returning SBHashMap]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto">I had an issue that Stephane and my self managed to solve so I post the fix here because it might be useful for other people that could face the same error.</p>
<p dir="auto">So, I have an importer where I store an SBHashMap and I wanted to expose the getter returning this SBHashMap. To do so, I added the following line to the descriptor of my importer like it is supposed to be done for functions exposition:</p>
<pre><code>SB_INTERFACE_BEGIN;

SB_STATIC_FUNCTION_0(SBHashMap&lt;CustomClass1*, CustomClass2*&gt;*, SECustomImporter, getHashMap);

SB_INTERFACE_END;

</code></pre>
<p dir="auto">But it was not compiling and it was throwing errors saying that the number of arguments of SB_STATIC_FUNCTION_0 was not sufficient. This error might be due to the SBHashMap macro which was not unfolded in a good way.</p>
<p dir="auto">To fix this error we tried to typedef the SBHashMap&lt;CustomClass1*, CustomClass2*&gt; before exposing it like this:</p>
<pre><code>typedef SBHashMap&lt;CustomClass1*, CustomClass2*&gt; CustomHashMap;
SB_REGISTER_TYPE(CustomHashMap, "CustomHashMap", "c5e7844d-1788-41ac-872d-e3d3e9a3c768")
</code></pre>
<p dir="auto">As you can see we also registered this now object in the second line using SB_REGISTER_TYPE. Then we modified the exposition like this:</p>
<pre><code>SB_INTERFACE_BEGIN;

SB_STATIC_FUNCTION_0(CustomHashMap*, SECustomImporter, getHashMap);

SB_INTERFACE_END;
</code></pre>
<p dir="auto">This worked perfectly ! If you have troubles with this fix do not hesitate to reply to this post.</p>
]]></description><link>https://forum.samson-connect.net/topic/31/solved-exposition-of-a-getter-returning-sbhashmap</link><generator>RSS for Node</generator><lastBuildDate>Mon, 08 Jun 2026 01:57:41 GMT</lastBuildDate><atom:link href="https://forum.samson-connect.net/topic/31.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 21 Feb 2018 15:45:06 GMT</pubDate><ttl>60</ttl></channel></rss>