Giter VIP home page Giter VIP logo

dynamic_delegates's Introduction

Dynamic Delegates

This library is a further development of the Don Clugston’s project “Member Function Pointers and the Fastest Possible C++ Delegates” (http://www.codeproject.com/KB/cpp/FastDelegate.aspx).

Modification are mainly aimed to make this library useful for implementing the reflection library and data marshalling systems of SekaiFramework (http://github.com/mikhtonyuk/SekaiFramework).

Invocation feature

Main feature of dynamic delegate library is a possibility to invoke a delegate using an array of arguments. For example:

void F1(int i) { ... }

auto deleg = make_delegate_dynamic(&F1);
int arg = 10;
void* args[] = { &arg };
// Calls F1
deleg.invoke(args, 0 /* no return value */ );

Dynamic invocation extension is separated from original zero-overhead delegates, so that they can be used in places where dynamic invocation is not required.

Performance

Performance of ordinary delegates left unchanged, only slightly reduced compile time thanks to code refactoring.

Dynamic delegates add a virtual table pointer size overhead, plus a virtual call overhead for eack invoke call.

License

This code is distributed free of charge and can be used for any purpose. See LICENSE file for details.

Contacts

If you have any questions – mail me:
Sergey Mikhtonyuk – [email protected]

dynamic_delegates's People

Contributors

sergiimk avatar

Stargazers

 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.