Comments (5)
Shroud automatically creates a getter and setter method for the C++ object which is shadowed by the derived type. The default names are 'get_instance' and 'set_instance'. The C++ name getInstance
is changed to get_instance
for Fortran by default (since Fortran is not case sensitive). The name conflicts and the compiler complains. The easiest work around is to suppress the creation of the getter and setter by setting their names to blank use a format block on the class:
- decl: class ResourceManager
format:
F_name_instance_get:
F_name_instance_set:
You can also explicitly name them something else if you want to keep them. The other option is to change the name of the Fortran wrapper for getInstance
to something else using a format block on the method:
- decl: static ResourceManager& getInstance()
format:
F_name_impl: non_conflicting_name
from shroud.
Thanks! Are there any side effects from disabling the getter/setters?
from shroud.
Not really. A typical user should not need access to the raw C++ pointer.
from shroud.
Perfect, I will give that try. I think I tried using F_name_impl
before and something was still amiss, but maybe it did work.
In any case, it's nice to able to have the names match across C++/C/Fortran. Thanks again.
from shroud.
Suppressing the getter/setter creation worked, closing.
from shroud.
Related Issues (20)
- Wrapping a const function that returns a pointer HOT 1
- Feature request: pull full spec from header file
- options not read from config file HOT 1
- Undefined symbol on Python import HOT 4
- options still not being honored HOT 4
- template struct HOT 4
- adding header files to wrapNAME.cpp HOT 4
- A<int> as a return value HOT 2
- string member variable: Error with template HOT 2
- splicer as YAML multiline text HOT 2
- Test user codes as part of CI
- new release? HOT 4
- Function returning string* type HOT 6
- Add interface wrapper for functions with default arguments defined as class members HOT 4
- Pure functions
- Self-referential structure HOT 4
- Error generating python bindings for C++ bool variable HOT 3
- Support for variadic templates HOT 4
- Add examples shroud user projects?
- cpp_if not taken in account for associated method HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shroud.