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

Provide a stand-alone C++ API (binding) for ddcutil #65

Open
aryoda opened this issue Nov 3, 2018 · 8 comments
Open

Provide a stand-alone C++ API (binding) for ddcutil #65

aryoda opened this issue Nov 3, 2018 · 8 comments

Comments

@aryoda
Copy link

aryoda commented Nov 3, 2018

It would be great to have C++ API for ddcutil's C API that

  • encapsulates all ddcutil's C API calls
  • cares for correct allocation/deallocation of memory and handles (e. g. via smart pointers like unique_ptr and shared_ptr)
  • is independent of Qt (e. g. uses only STL containers and can be compiled "stand-alone" therefore)

This would be a good basis for different front-ends and clients (e. g. using Gtk+ or another user paradigm).

Much work, I know (esp. finding a good API design).

Edit Nov 04, 2018: One more requirements

  • The API must use STL containers, not Qt containers (Qt does not support unique_ptr since the overloaded copy constructors do not guarantee uniqueness): http://lists.qt-project.org/pipermail/interest/2013-July/007776.html). Good thing: No dependencies on Qt improves the re-usability of the API!
  • The API shall be thread-safe and support async calls via multi-threading for a better user-experience

Edit Nov 11, 2018: More requirement regarding logging

  • Add logging output possibilities
  • Encapsulate the logging output calls and make them independent of any non-standard
    framework/library (e. g. don't use Qt for logging within the API)
  • Allow to "plug-in" your own logging framework (e. g. from Qt)
  • Use exceptions to encapsulate status return codes and reduce if cascades

Edit Nov 13, 2018: Added new requirement

  • Support easy unit testing (e. g. mocking of physical displays)
@rockowitz
Copy link
Owner

rockowitz commented Nov 3, 2018 via email

@aryoda
Copy link
Author

aryoda commented Nov 3, 2018

it would make a great project for someone to take on as a contribution

OK, I really would try to create a C++ (wrapper) API and (lack of) time is my only constraint ;-)

Since I am trying to implement a Qt-based UI that is focused on easy usability of the most frequent use cases incl. the must-have vendor-specific VCP codes as user configuration a C++ wrapper API could be a natural "spin-off".

My intended UI is different from your approach which is a perfect generic solution (similar to EnTech's softMCCS which is proprietary and for Windows only - see https://entechtaiwan.com/lib/softmccs.shtm).

My UI is yet just a "dream", I am still not "public" (at Github) yet - maybe never :-(

Feature value access is encapsulated in a simple class

Which class do you mean, I will have a look...

@rockowitz
Copy link
Owner

rockowitz commented Nov 3, 2018 via email

@rockowitz rockowitz added the API label Nov 4, 2018
@aryoda
Copy link
Author

aryoda commented Nov 13, 2018

I have created a first (very-early) proposal for an API interface for just the "public" layer of an object-oriented ddcutil wrapper API.

This is just a string point to add more layers or implementation details later.

My goal is just to offer the possible settings to a client via an API that could be implemented in any OO language like C++, Python etc.

Therefore you will not find technical data types of the ddcutil C API.

Note that getter/setter methods, public/private visibilities and filtered links are also not yet modelled completely.

I am asking for comments (wrong or strange names, missing or superfluous attributes or operations, things difficult to understand...).

PS: I have used the Umbrello UML Modeler (https://umbrello.kde.org/) to create this class diagram. I could send the file too on demand...

Edit: 04.11.2018: Renamed enum classes to get rid of "VCP"

vcp api layer proposal v0 2

@aryoda
Copy link
Author

aryoda commented Nov 17, 2018

FYI: I have created a new Github repo to publish the UML models and the source code of my experimental implementation (still work in progress)...:

https://github.com/aryoda/ddcutil-cpp-API

@rockowitz
Copy link
Owner

rockowitz commented Nov 27, 2018 via email

@qht1003077897
Copy link

I'm still seeing only the .gitignore, LICENSE, and README.md files at ddcutil-cpp-API. Sanford

On 11/17/2018 11:31 AM, aryoda wrote: FYI: I have created a new Github repo to publish the UML models and the source code of my experimental implementation (still work in progress)...: https://github.com/aryoda/ddcutil-cpp-API — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#65 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/ANhsbr8jE49HYXpMmfTIGkdXoMaFNL47ks5uwDnygaJpZM4YMuC5.

yes,ha,hope mixed with disappointment

@aryoda
Copy link
Author

aryoda commented Mar 19, 2024

yes,ha,hope mixed with disappointment

Yes, I had to prioritize how to "invest" my small spare time into open source projects and the C++ API did loose ;-)

Any contributions welcome 😉

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

3 participants