Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API theme discussion #178

Open
bemcdonnell opened this issue May 3, 2018 · 1 comment
Open

API theme discussion #178

bemcdonnell opened this issue May 3, 2018 · 1 comment

Comments

@bemcdonnell
Copy link
Member

We’re reaching a point where the API could use some style checks. We have functions that scoop out larger sets of data and functions that pluck single values. The current api is absolutely functional, however, as it begins to grow, we will benefit from a unified vision.

@michaeltryby has been encouraging that we adopt a style that serves more data with a single call. For example, if we call swmm_getLinkResult() we have to pass the output value pointer AND and parameter key. Alternately, we could return an array with ALL the values and use the parameter key to get the value we care about from the array.

@michaeltryby
Copy link

michaeltryby commented May 3, 2018

The time has come for the API to evolve. It turns out it's straight forward to allocate memory and return multiple values. This is demonstrated in the SWMM and EPANET output APIs to great effect. It allows us to create a compact and functional API that is more convenient for the programmer to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants