Comments (7)
@yjaeseok Are you interested in this issue?
from bacardi.
Yes I am interested in this issue, But i have some question.
Calculator has only function (looks like static function), so user do not want to use constructor as class.
If we were to show the constructor correctly, would we need an example with member variables and functions or inheritance?
from bacardi.
Hi, @yjaeseok
We can add a constructor in Calculator example for now as follows:
[
Constructor,
Constructor(double createdTime)
]
interface Calculator {
static void print();
double add(double number1, double number2);
...
};
Then, our generator should generate glue codes(bridge codes) and then it should eventually call
developer's cpp constructor.
class Calculator {
public:
Calculator() {
...
}
Calculator(double created_time) {
...
}
};
Yes, we might need variables and inheritance but it's not ready yet. We can implement them incrementally. :)
from bacardi.
Hmm..
I have tried many ways It seems that it is hard to apply patch because of lack of understand concept. Could you help me with some advise?
@romandev
from bacardi.
How could I get constructor value in template_cpp.njk file?
I think i have to modify idls.ts for idl parsing, but i do not understand how to access constructor parameter like member_info variable.
there is no member_info definition in any files.
from bacardi.
We might need a new data structure.
For example, we can think the constructor function is a special member of the interface.
It's my own thinking and your design can be different.
export interface InterfaceConstructor extends InterfaceMember {
}
Also, you can get the information from raw_idl_info.extAttrs.
Please see https://github.com/w3c/webidl2.js#extended-attributes
from bacardi.
The issue is closed.
from bacardi.
Related Issues (20)
- Creating documents HOT 1
- Change exit code of clang-format
- Move build system from gyp to gulp HOT 1
- Fix warning in Examples HOT 2
- Build error occurs in electron_build
- `bacardi pr <pull_request_number>` doesn't work well on Windows. HOT 1
- Source files should be generated by idl generator automatically
- Unexpected text print out when running `./bacardi` HOT 2
- Introduce tslint to lint for TypeScript
- Refactor generator codes
- .last_update is not created HOT 5
- Fix Test Failed HOT 1
- ./bacardi build_electron command make build folder to clean
- Checksum for third-party package(ex: node) is required
- Typo in issue_template.md HOT 2
- Implement command line usage
- Change directory structures HOT 2
- Support package-private feature
- A bunch of lint errors HOT 1
- Something is wrong..
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 bacardi.