Skip to main content

All Questions

Tagged with
0 votes
2 answers
70 views

How to Pre-Bind Parameters in a Template-Based Event System in C++

I have an event system in my game engine, consisting of two main components: Event and EventCallback. Event.h: #ifndef _EVENT_H_ #define _EVENT_H_ #include "EventCallback.h" #include <...
mar ben's user avatar
0 votes
0 answers
67 views

C++ inlined events undefined during instantiation

I want to create inlined event functions if possible. Storing func pointers in a container isn't a way because they can't be inlined. The code in the event will be called always and I don't want to ...
Deus's user avatar
  • 1
1 vote
2 answers
413 views

C++ List of member callback functions

I am going from C development to C++ on the STM32 platform and simply cant find a suitable solution for my problem. Please have a look at the simplified example code attached to this post. #include &...
Leon Reucher's user avatar
0 votes
1 answer
614 views

C++ Event Dispatcher - callback casting problem

I'm venturing into creating an EventDispatcher using C++ 17 in Visual Studio 2022. Basically I store a string (id) to identify the event and a callback (lambda, function or method of a class) in a ...
Donavan Carvalho's user avatar
0 votes
1 answer
437 views

Function Pointers as Event Callbacks in a st

I am currently trying to implement an event system where layers can subscribe to certain event types. I am struggling with function pointers for the callback methods. In the layer.h file I have the ...
Nicky's user avatar
  • 121
1 vote
1 answer
575 views

Trigger a C++ action from a C# event

sorry if the question is too general, but I would like to know what is the best solution. I have two projects. The main one is in C++ and needs to receive some information from a software component. ...
Mario Sanz Gómez's user avatar
7 votes
2 answers
10k views

Unreal Engine 4: C++ Delegate not being called

I've been working on converting some blueprint logic over to C++. One of the things I have is a button. The button can be pressed in VR and has a delegate that is called to notify any registered ...
Katianie's user avatar
  • 609
1 vote
2 answers
117 views

Converting different classes to void* and back safely in C++

I have a map of callbacks that pass information and execute various functions throughout code, very much like events in C# but in C++. The map is defined as std::map<std::string, std::function&...
Mich's user avatar
  • 3,542
0 votes
0 answers
660 views

C++ Storing Callback Functions Inside Struct Vector - Performance, Call Options, Deallocation Issues

I am currently experimenting in designing an InputHandler class, which will be responsible for storing callback functions, registered to its instance from various objects, and calling those functions ...
Inan Evin's user avatar
1 vote
1 answer
760 views

linux c++: libaio callback function never called?

I'm on ubuntu 16.10 with g++ 6.2, testing libaio feature: 1. I was trying to test io_set_callback() function 2. I was using main thread and a child thread to talk by a pipe 3. child thread writes ...
Hind Forsum's user avatar
  • 10.3k
1 vote
0 answers
240 views

C++ Create callback from C++/CLI to C++

Hello for my project i have the "main" dll non cli in a process. Then i have multiples instance of c# dll which embed a CLI dll. From c# i can add a "EventHandler" to the cli. Now the tricky part. I ...
Sylvain Martens's user avatar
1 vote
1 answer
785 views

c++ get instance of parent from child

Hey am creating a game as a school project in c++, and trying to get an instance of the parent class from the child class. I have created a class CollisionHandler witch works as a callback or event ...
SlyOtis's user avatar
  • 587
1 vote
0 answers
559 views

OpenCL 1.1 C++ Bindings: Create cl::Event object from cl_event type in callback

how can I create a cl::Event object from cl_event type in OpenCL event callback? There's a cl::Event constructor in OpenCL 2.0 Reference: Event (const cl_event &event, bool retainObject=false) ...
Henrix's user avatar
  • 53
0 votes
0 answers
66 views

C++ Borland Vector of events

I have the following code: A.h typedef bool __fastcall(__closure * Callback)(); class A { private : Callback FCallback public: A(); __property Callback OnCallBack = {read = ...
Kios's user avatar
  • 15
1 vote
0 answers
410 views

How to Implement Event-triggered Callback in C++

Assume in a system, users will register a callback function with system and that callback function will be called when an event is triggered but if the event is already triggered, the user will ...
aaa's user avatar
  • 1,649

15 30 50 per page