{"id":13421482,"url":"https://github.com/Turbine1991/cpp-event-system","last_synced_at":"2025-03-15T08:32:05.768Z","repository":{"id":21606194,"uuid":"24926456","full_name":"Turbine1991/cpp-event-system","owner":"Turbine1991","description":"C++ extensible hook system. Providing an implementation for generic function delegation and the handling of theem. Designed as a C++ equivalent to the hook functionality found in Garry's Mod.","archived":false,"fork":false,"pushed_at":"2014-11-02T22:54:25.000Z","size":176,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-31T22:58:59.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Turbine1991.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-08T05:47:08.000Z","updated_at":"2019-11-09T15:10:57.000Z","dependencies_parsed_at":"2022-08-05T13:34:14.414Z","dependency_job_id":null,"html_url":"https://github.com/Turbine1991/cpp-event-system","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbine1991%2Fcpp-event-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbine1991%2Fcpp-event-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbine1991%2Fcpp-event-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Turbine1991%2Fcpp-event-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Turbine1991","download_url":"https://codeload.github.com/Turbine1991/cpp-event-system/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243707282,"owners_count":20334613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T22:01:58.344Z","updated_at":"2025-03-15T08:32:05.489Z","avatar_url":"https://github.com/Turbine1991.png","language":"C","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"readme":"cpp-event-system\n================\n\nGCC supported C++ extensible hook system. Providing an implementation for generic delegates and the handling of these as associative events. Designed as a C++ equivalent to the hook functionality found in Garry's Mod.\n\nWhy use an event/hook system? It decouples and simplifies code complexity while promoting modular characteristics. Another defining benefit is enabling developers the ability to provide version redundant compatibility. Any event may be overwritten, replaced, disabled, aliased and invoked.\n\n##Methods\n\n###Events\nStatement     | Return Type\n------------- | -------------\nevents.create(eventName, eventId = 0)|Event\u0026\nevents.get(eventName or eventId)|Event\u0026\nevents.exists(eventName or eventId)|bool\n\n###Event\nStatement     | Return Type\n------------- | -------------\nevent(name = \"\")|constructor\nevent.hasName(name_t name)|bool\nevent.getNames()|const list\u003cname_t\u003e\u0026\nevent.add(name, funct, append = true)|void\nevent.replace(name, funct)|void\nevent.exists(name)|bool\nevent.remove(name)|bool\nevent.clear(eventName or eventId)|void\n\n##Example\n```\n#include \u003ciostream\u003e\n#include \"Events.h\"\n\nusing namespace std;\n```\n...\n```\nbool CanPrint1(int a)\n{\n  cout \u003c\u003c \"Test 1 \" \u003c\u003c a \u003c\u003c endl;\n  return true;\n}\n\nbool CanPrint2(int a)\n{\n  cout \u003c\u003c \"Test 2 \" \u003c\u003c a \u003c\u003c endl;\n  return true;\n}\n```\n...\n```\nEvents::event_t\u0026 event = Events.create(\"CAN_CLIENT_CONNECT\", Events::CAN_CLIENT_CONNECT);\nEvents.exists(\"CAN_CLIENT_CONNECT\");\nEvents.get(Events::CAN_CLIENT_CONNECT);\n\nevent.add(\"test1\", (void*)CanPrint1);\nevent.add(\"test2\", (void*)CanPrint2);\n\nif (event.call(5))\n  cout \u003c\u003c \"Can Print\" \u003c\u003c endl;\n\nevent.remove(\"test2\");\nevent.exists(\"test3\");\nevent.clear();\nevent.disabled = false;\nevent.replace(\"test1\", Test2);*\n```\n\n##More\nPlease see the example .cpp file and Code::Blocks .cbp project for a compilable GCC and VSC++ example. Additionally includes enabling wide char support and iterating through contents.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTurbine1991%2Fcpp-event-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTurbine1991%2Fcpp-event-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTurbine1991%2Fcpp-event-system/lists"}