Hi,

is there a convenient way to pass objects, which are _not_ serializable 
but copyable to extern (sub)components?
(It was even more elaborated to be able to pass object by reference - 
reducing (memory) overhead increases performance. I'm not calling 
between different shared libraries, only within one library with 
distinct components)

My current (ugly) solution is as follos:

caller.ecpp:
<%request scope="global">
         std::vector<int> vec;
</%request>

<%cpp>
         vec.push_back(1);
         vec.push_back(2);
</%cpp>

<& start.layout1 &>

invoked (different component):

<%def layout1>
<%request scope="global">
         std::vector<int> vec;
</%request>

     This is Layout 1! Output: <$ vec[0] $>

</%def>

This has another disadvantage: As I can gather from the resulting 
.cpp-file of caller.ecpp, the vector is always acquired - if I put an 
if-clause around the request-variab-definition, it's simply dismissed. 
Thus, the program will acquire params for all possible calls (large 
project) on every call. This will lead to a performance comparable to 
PHP's ;-)
It's not an option to put all subcomponents in the same components (aka 
the same file), of course.

Is there a way to utilize %param (which already serves for complex 
objects with copy-ctor) for extern subcomponents?
Or any other method adhering to the classic model of params for functions?

Regards,




------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Tntnet-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tntnet-general

Reply via email to