Jump to content
  • Advertisement
Gelldur

C++ Looking for constructive feedback on my EventBus implementation

Recommended Posts

Hello there

Some time ago I created EventBus implementation with friends. I used previous and recent implementation in 3-4 games that I was part of.

During this time I receive only feedback from developers that were working with me. Now I would like to get more feedback what do you think and maybe you have some requests/improvements ?

It would be nice to have some opinions from "fresh developers" and more advanced ones.

My main questions: (you don;t have to answer if you don't want to)

- How it generally look ? Is it OK ? ( I mean your first impression, main README)

- Is it easy to use ?

- Does documentation explaining what it needs (in clear way), especially if you didn't previously use event bus pattern.

- What is missing for you ?

- Why you don't want to use it ? (eg. license, minimum C++11, etc.)

- Are you using other implementation, if yes pls mention :)

https://github.com/gelldur/EventBus

 

 

 

Share this post


Link to post
Share on other sites
Advertisement

It looks fine with a once-over.

This is the type of code that every game builds, and it is simple enough that it is rarely reused. That is the only complaint about it.  It re-invents the wheel, and it is an easy wheel to re-create and customize when needed.

A more typical implementation is to use an unordered_map instead of a map, since the hash table of unordered_map is faster to look up than a map when the table gets big.

Share this post


Link to post
Share on other sites
On 10/11/2018 at 5:30 AM, frob said:

It looks fine with a once-over.

This is the type of code that every game builds, and it is simple enough that it is rarely reused. That is the only complaint about it.  It re-invents the wheel, and it is an easy wheel to re-create and customize when needed. 

A more typical implementation is to use an unordered_map instead of a map, since the hash table of unordered_map is faster to look up than a map when the table gets big.

On the start: Thanks!

What I can only not agree that: "it is simple enough that it is rarely reused". It took some time to catch all bugs like listen/unlisten during notification. So important thing is it well tested not mentioning performance measure.

What is different in this implementation that you don't have to inherit form common event or inherit to listen/unlisten. Specially not everyone is template ninja to write cool stuff (neither am I but I try to achieve something cool and easy to use :))

 

Thanks for tip with unordered_map but I think I tested in past (performance) and it gives worser results but I will double check and document that.

 

Also one of big features I want to add is printable graph of events (graphviz) so it would be more easy to track your events. No lib has such feature :)

 

Share this post


Link to post
Share on other sites

As for unordered_map, check out https://github.com/greg7mdp/sparsepp - works as a drop-in replacement and is quite fast.


Another thing you should mention on the main page how this behaves with multiple threads and how it allocates its memory.
Is it ye 'ol queue from everywhere but process in one place? lockless/mutexes/blocking/whatever?
Can i give it custom allocators or make it use some kind of fancy pool/freelist/whatever allocation?


 

Edited by ninnghazad

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!