Skip to content

A simple and lightweight C++ event library to use out of the box.

License

Notifications You must be signed in to change notification settings

torresflo/Simple-Event-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GitHub license PRs Welcome GitHub contributors GitHub issues

Simple Event Library

A simple and lightweight C++ event library to use out of the box.
Report a bug or request a feature

Table of Contents

Getting Started

Installation

Clone the repo (git clone https:://github.com/torresflo/Simple-Event-Library.git) and add the EventSystem folder to your project, you are ready to go!

Usage

Example

#include <EventSystem\Event.hpp>
#include <EventSystem\EventHandler.hpp>
#include <EventSystem\IEventListener.hpp>

//Declaration of an event
class EventExample : public EventSystem::Event {};

//Declaration of an event listener for this event
class EventListenerExample : public EventSystem::IEventListener
{
public:
    virtual void onEvent(const EventSystem::Event & event) override { /*Do something...*/ }
};

//Usage
EventListenerExample listener;
EventSystem::EventHandler eventHandler;

eventHandler.registerListener<EventExample>(&listener);
eventHandler.sendEvent<EventExample>(/*Parameters of the event if needed*/);
eventHandler.unregisterListener<EventExample>(&listener);

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature)
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GNU General Public License v3.0. See LICENSE for more information.

About

A simple and lightweight C++ event library to use out of the box.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages