[C++] Interfacewrapper.cpp compilation failure (string cache)
还没有人认领这个 Issue。
评估
调研方向
从生成的 interfacewrapper.cpp 示例开始,检查参数缓存如何处理 class 或 optionalclass 参数。追踪 pBaseThisResult、ParameterCache_3 和绑定类 CMyComponentFoo 所使用的类型,然后验证生成的包装器能够编译,并且缓存路径仍能正常工作。
由索引模型根据 Issue 内容生成。
描述
Given a function with a class / optionalclass argument, the generated code ends up looking something like this:
interfacewrapper.cpp
std::string sName("");
IBase* pBaseThisResult(nullptr);
IFoo* pIFoo = dynamic_cast<IFoo*>(pIBaseClass);
if (!pIFoo)
throw EMyComponentInterfaceException(MYCOMPONENT_ERROR_INVALIDCAST);
bool isCacheCall = (pNameBuffer == nullptr);
if (isCacheCall) {
pBaseThisResult = pIFoo->GetProperties(sName, *pBar);
pIFoo->_setCache (new ParameterCache_3<std::string, MyComponent_uint8, CMyComponentFoo *> (sName, *pBar, pBaseThisResult));
}
else {
auto cache = dynamic_cast<ParameterCache_3<std::string, MyComponent_uint8, CMyComponentFoo *>*> (pIFoo->_getCache ());
if (cache == nullptr)
throw EMyComponentInterfaceException(MYCOMPONENT_ERROR_INVALIDCAST);
cache->retrieveData (sName, *pBar, pBaseThisResult);
pIFoo->_setCache (nullptr);
}
Since CMyComponentFoo is a binding class, this won't compile. Also, the pointer pBaseThisResult is actually of type IBase *.
I've hacked a fix to get it to work by generating IBase * instead, but as I don't know how this parameter caching is supposed to work I can't say if it's the right way to fix it.
- 主要语言
- Go
- 星标
- 55
- 派生
- 28
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Autodesk/AutomaticComponentToolkit 的其他 Issue
-
Python binding: Avoid using globals in Base.__del__()可能重新可做 @martinweismann 于 224 天前认领,目前没有进行中的 PR。 未关闭
Autodesk/AutomaticComponentToolkit#226 · 5 条评论 · 3 个 reaction · 已指派 3 人 ·
-
难度 2/5 1-3 小时 新手友好度 45/100
Autodesk/AutomaticComponentToolkit#213 · 1 条评论 · 2 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 35/100
Autodesk/AutomaticComponentToolkit#188 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
Autodesk/AutomaticComponentToolkit#183 · 1 条评论 ·
-
stringoutclass issues可能重新可做 @martinweismann 于 220 天前认领,目前没有进行中的 PR。 未关闭
Autodesk/AutomaticComponentToolkit#162 · 1 个 reaction · 已指派 2 人 ·
查看 Autodesk/AutomaticComponentToolkit 的全部 Issue
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
JuliusBrussee/caveman#1189 ·
维护者通常 1 天内回复
-
agent-review-finding chore
难度 2/5 半天 新手友好度 78/100
jordansmall/spindrift#4497 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug from-studio
难度 2/5 1-3 小时 新手友好度 70/100
esengine/DeepSeek-Reasonix#12044 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 82/100