IRC Log Viewer » #firebreath » 2013-09-02

IRC Nick Time (GMT-7) Message
kylehuff 12:09 is it possible (and proper) to use a struct as a method parameter for methods exposed via "make_method", or possibly a VariantMap? I am simply trying to avoid defining a bunch of parameters and making them optional
taxilian 12:09 no, you can't use a struct
you can use a FB::VariantMap, though
and that would allow you to pass in a javascript object
note that there are potentially performance considerations to doing that
kylehuff 12:09 understood. Is the performance degradation influenced by the number of parameters, the size of the parameters, or both?
taxilian 12:09 primarily the number
each parameter in the object requires a call into javascript to get it
kylehuff 12:09 okay, I see. I will give it a shot. thanks for the insight.
hows the little one, btw?
taxilian 12:09 he's doing great
kylehuff 13:09 okay, perhaps this is obvious, but how do you reference the defined members of a VariantMap within the plugin? I've only ever accessed members after it was returned to the browser when it is a JS object... I see the empty() and conversion methods, but nothing else. is it similar to a dictionary object?
taxilian 13:09 a VariantMap is a std::map
keyed by a std::string
so it's a std::map<std::string, FB::variant>