getCallerAddress and operToScalar in setSessionId
I am working on QuantLibAddin1.22 now.
When I use QL_ENABLE_SESSIONS, the compiler tells me there are no implementations about getCallerAddress and operToScalar.
Can I replace getCallerAddress by callerAddress?
And I create operToScalar by myself,
namespace ObjectHandler {
//! Convert an OPER to a string.
DLL_API void operToScalar(std::string& value, const OPER& xString) {
std::string v(xString.val.str);
value = v;
}
}
is it right?
In other way, can I just code as follow?
std::string callerAddress = ObjectHandler::FunctionCall::instance().addressString();
That flag QL_ENABLE_SESSIONS is very old and not maintained and you might have to go very far back to find a build in which it functioned properly. Off the top of my head I could not tell you whether your proposed solution is correct, you would need to analyze it yourself.
That flag QL_ENABLE_SESSIONS is very old and not maintained and you might have to go very far back to find a build in which it functioned properly. Off the top of my head I could not tell you whether your proposed solution is correct, you would need to analyze it yourself.
Hi, I use std::string callerAddress = ObjectHandler::FunctionCall::instance().addressString(); now, and it works well.
For example, what addressString() returns would look like [EuropeanVanillaOption.xlsx]Sheet1!$F$4.
Sounds good!
That flag QL_ENABLE_SESSIONS is very old and not maintained and you might have to go very far back to find a build in which it functioned properly. Off the top of my head I could not tell you whether your proposed solution is correct, you would need to analyze it yourself.
A little suggestion about QL_ENABLE_SESSIONS.
By QL_ENABLE_SESSIONS, we can set different evaluation dates in different excel files.
But in QuantLibXL-1.22, all objects created by xll are stored and registered with a "name", so every object must have an unique name around all open excel files(we don't use overwrite).
If we register object by a pair, for instance, <sessionID, objName>, an object should have an unique name in just one open excel file. So, every all excel files are independent computation environment.