https://github.com/taljacob2/oop
`oop` is a static library, that allows the use of OOP in C language.
https://github.com/taljacob2/oop
c class ooc oop
Last synced: 22 days ago
JSON representation
`oop` is a static library, that allows the use of OOP in C language.
- Host: GitHub
- URL: https://github.com/taljacob2/oop
- Owner: taljacob2
- License: mit
- Created: 2022-12-21T08:28:34.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-02-08T12:16:43.000Z (over 3 years ago)
- Last Synced: 2024-04-14T14:10:00.165Z (about 2 years ago)
- Topics: c, class, ooc, oop
- Language: C
- Homepage:
- Size: 918 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/taljacob2/oop/releases/)
- For compiling with GNU's GCC, download `oop-gcc.tar.gz`.
- For compiling with Microsoft's MSVC, download `oop-msvc.zip`.
## Usage
- For GNU's GCC see [GCC Usage](docs/GCCUsage.md).
- For Microsoft's MSVC see [MSVC Usage](docs/MSVCUsage.md).
### Polymorphism
When creating a new class with the `DEFINE_CLASS_H` macro keyword, you actually polymorph the new class with the [`Object`](src/lib//oop/Object/Object.r) class.
Thus, every class you create, is polymorphed with [`Object`](src/lib//oop/Object/Object.r).
> ##### NOTE 1 FOR DEVELOPERS ONLY
> Every object is polymorphed with [`Legacy_Object`](src/lib/oop/Object/Legacy_Object.r)
(it is the **most polymorhpic object in the library**).
### Dynamic Allocation
When you use [`Object`](src/lib//oop/Object/Object.r)s, you do not need to worry
again about dynamic allocation (e.g. `malloc`, `calloc`...).
[`Object`](src/lib//oop/Object/Object.r)s 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`](src/lib//oop/Object/Object.r) is composed of [`AutoDestructable`](src/lib/oop/Object/AutoDestructable.r), which handles the object to **automatically be destructed after the `main`** (see
> [`Legacy_AllocationTableList`](/src/lib/oop/Object/Legacy_AllocationTableList.r)).
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)