This is an OOP implementation for SQF which is hugely inspired by a similar project, OOP.h .
Why another one? I like OOP.h but as I found out, it has a big impact on performance, which lies deep in how it is done. I don't mean to say that OOP.h is bad, it just has one limitation which I was forced to work around. Then it's better to share code than not, right?
So, I decided to reinvent it, but with the aim of minimizing performance impact, and here is what we have:
Based on SQF preprocessor, so you need to #include a single file.
Supports member variables, methods, static variables, static methods and class inheritance(no multiple inheritance yet).
With a single preprocessor flag (#define OOP_ASSERT in OOP_Light.h) you can enable or disable run-time error checks, which verify most common errors, like attempts to access a non-existent member or class. If enabled, it will output errors in a human-readable way.
Good performance. Really, with debug disabled, a macro like GETV(_veh, "varName"); gets expanded into "missionNamespace getVariable (_veh+"_"+"varName");", which is typically not such a great performance loss.
No support for public/private/protected keywords yet, so all members are public.
Currently it is in 'beta' state. It seems to work and I don't see any major game-breaking issues with it as I have tried to do a little development with it. Also there is no documentation but you can examine the example files and classes and see how it works.
As an example, the project contains a few useful classes written with OOP-Light: MessageLoop, MessageReceiver and Timer. An example of how to use them is located in Example.sqf file.
MessageLoop and MessageReceiver can help you easily create a message loop, a useful construction which lets you manage processing of some events in a fixed amount of SQF threads, or helps you pass data between threads.
Timer class just generates messages at fixed time intervals and sends them to the specified MessageReceiver.
Github link:
https://github.com/Sparker95/OOP-Light
I hope someone finds this useful!