Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[C++] Interfacewrapper.cpp compilation failure (string cache)

オープン
#148 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp
領域
tooling

調査の方向性

生成された 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
スター
54
フォーク
26
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Autodesk/AutomaticComponentToolkit のほかの issue

Autodesk/AutomaticComponentToolkit の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。