Giter Site home page Giter Site logo

dynio's Introduction

dynio: Dynamic I/O Drivers

Usage

This library exposes a C header, driver.h for both producers and consumers.

Producers (aka driver implementors)

At a minimum, driver implementations require:

  1. The registration function, which allocates and assigns your new driver to passed pointer:

    extern "C" void register_driver(dyn_driver**);
  2. The deregistration function, which deallocates your created driver:

    extern "C" void deregister_driver(dyn_driver**);
  3. An implementation of your driver providing 3 functions,

    • dyn_driver::option, which is a pointer to a function that returns a dyn_driver_option.
    • dyn_driver::read, which performs the reading portion of your driver.
    • dyn_driver::write, which performs the writing portion of your driver.
  4. The source file containing the above 3 requirements to be compilable as a shared library. Drivers in dynio are loaded dynamically via dlopen.

Any internal state or functionality for your driver can be stored in the dyn_driver::internals void pointer.

See test/csv/csv.{cpp/hpp} for a producer view of how example::csv is implemented.

Consumers (aka driver users)

Users of driver implementations are intended to be C++ users, and should use driver.hpp (the C++ header), which provides a C++ abstraction of dyn_driver and the template function load_driver, which handles loading from a dynio-based shared-library driver.

See test/csv_test.cpp for a consumer view of how example::csv is loaded.

License

Distributed under the Boost Software License, Version 1.0.

dynio's People

Contributors

program-- avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.