Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getCallerAddress and operToScalar in setSessionId #5

Open
xuruilong100 opened this issue Apr 28, 2022 · 4 comments
Open

getCallerAddress and operToScalar in setSessionId #5

xuruilong100 opened this issue Apr 28, 2022 · 4 comments

Comments

@xuruilong100
Copy link

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();
@eehlers
Copy link
Owner

eehlers commented Apr 28, 2022

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.

@xuruilong100
Copy link
Author

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.

@eehlers
Copy link
Owner

eehlers commented Apr 29, 2022

Sounds good!

@xuruilong100
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants