Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#148 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Start with the generated interfacewrapper.cpp example and inspect how parameter caching handles class or optionalclass arguments. Trace the types used for pBaseThisResult, ParameterCache_3, and the binding class CMyComponentFoo, then verify the generated wrapper compiles and that the cache path still behaves correctly.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Go
Stars
54
Forks
26
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Autodesk/AutomaticComponentToolkit

All issues in Autodesk/AutomaticComponentToolkit

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.