Git Product home page Git Product logo

boopes's Introduction

boopes

Basic Object-Oriented Programming for Embedded Systems

What is boopes?

boopes is a OOP framework for the C programming language. it is meant for embedded/small systems like phones, tablets, etc. I created boopes so i didnt need to use GObject. Apperantly it also makes C not look like C.

what does boopes support?

  • single inheritance
  • classes
  • constructors

How Does It Work?

when you create a class, its actually a struct. inheritance creates a super object inside that struct. functions are actually function pointers that you manually fill in the constructor. the this pointer in functions is actually the first argument of that method.

Requirements

you need a c preprocessor that supports ##VA_ARGS because boopes uses this. for embedded systems you can do the peprocessing with a desktop version of gcc, then compile with the compiler for the system your programming for.

Usage

#include "boopes.h"
//the class YourClass derives from object
class(YourClass) inherits_from(object)
//classes can have variables.
int a;
//a method prototype
method_proto(YourClass, MethodReturnType, MethodName);
//the end of the class definition
class_end(YourClass)

constructors need to be crated manually. for example, a constructor for the class above could be

YourClass* YourClass_ctor(int a){
    YourClass* example = new(YourClass);
    //YourMethod is a function that meets the prototype that you declared in the 
    //method_proto above
    example->MethodName = &YourMethod;
    example->a = a;
    return example;
}

this constructor could be called like any normal C function.

YourClass* ex = YourClass_ctor(5);

but to call methods in a class,

call_method(YourCLass, ex, MethodName);

License

boopes is licensed under the GPLv2. the full license should be located in the LICENSE file in the same directory as this one. if you have not received a copy of the license with this software, it can be found at gnu.org/licenses/old-licenses/gpl-2.0.html

boopes's People

Contributors

ancientstraits avatar ttury avatar wholesomeisland avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.