Skip to content
/ oop Public

`oop` is a static library, that allows the use of OOP in C language.

License

Notifications You must be signed in to change notification settings

taljacob2/oop

Repository files navigation

OOP For C Language

oop is a static library, that allows the use of OOP in C language.

Download The Latest Release Of oop Here

  • For compiling with GNU's GCC, download oop-gcc.tar.gz.
  • For compiling with Microsoft's MSVC, download oop-msvc.zip.

Usage

Polymorphism

When creating a new class with the DEFINE_CLASS_H macro keyword, you actually polymorph the new class with the Object class.

Thus, every class you create, is polymorphed with Object.

NOTE 1 FOR DEVELOPERS ONLY

Every object is polymorphed with Legacy_Object (it is the most polymorhpic object in the library).

Dynamic Allocation

When you use Objects, you do not need to worry again about dynamic allocation (e.g. malloc, calloc...).

Objects allocate themselves (with calloc) in their constructor, and automatically destruct themselves (with free) after the main.

Although, in case you want to manually invoke the object's destructor (similarly to CPP's delete function) you may do so by invoking the DESTRUCT_OBJECT(objectToDestruct) macro.

NOTE 2 FOR DEVELOPERS ONLY

Every Object is composed of AutoDestructable, which handles the object to automatically be destructed after the main (see Legacy_AllocationTableList).

Contributing

See CONTRIBUTING.md