<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jun 5, 2014 at 1:05 PM, Janosch Machowinski <span dir="ltr">&lt;<a href="mailto:Janosch.Machowinski@dfki.de" target="_blank">Janosch.Machowinski@dfki.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It loads a type description, either from the installed TLB files,<br>
or from a log stream. From this a Typelib::Type is generated.<br></blockquote><div>Not exactly. TLB files represent a registry, i.e. a self-consistent set of types (Pocolog streams simply embed a XML document that is in the same format than the .tlb files). What you therefore get from the XML description is a Typelib::Registry object out of which you can query for the Typelib::Type object(s) that describe your type.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">To store or load a type, one needs to create a Typelib::Value<br>
A typlib value is a unpacked version of the Type, plus the type description<br></blockquote><div>You store and load a value, not a type. Types describe values.</div><div><br></div><div>A value is a typed pointer, i.e. a pointer to memory with the Typelib::Type object that describes the binary layout of said memory.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Here is my first question, how can I load non POD types. I suppose,<br>
I must supply a preinitialized type as target Pointer ?<br>
<br>
Is there a way of doing this anonymously ?<br></blockquote><div>Yes. You must create a big enough buffer (use type.size() to know how big) and initialize it with Typelib::init()</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How do I check (in c++) if the local type and the stream type are the same ?<br>
I suppose I load the system tlb and check it against the stream tlb, is<br>
there<br>
already a function for this ?<br></blockquote><div>For you application; type.isSame(*other_type) will do the trick. Do NOT use == unless you know the two types are within the same registry. Another way is to merge the two registries. It will fail if some types are found with same name and different definitions (thus ensuring that all the types are the same)</div>
<div><br></div><div>Warning: there is no such thing as a &#39;system tlb&#39;. TLBs are saved per-orogen component to make sure that it indeed describes the types that the component uses (very important in case of partial rebuilds after a type change) </div>
<div><br></div><div>Given the stream of commits in pocolog_cpp and your questions, you are obviously reimplementing in C++ big chunks of what is already done in Ruby. Care to share your plans with the group ?</div><div><br>
</div><div>Sylvain</div></div></div></div>