cocomr / coco

Compact Components is a framework for the development of resource intensive applications with a focus on Mixed Reality applications and Robotics. This repository provides the core technology over which CoCo Mixed Reality is based
http://coco.readthedocs.io/
MIT License
6 stars 3 forks source link

Using C++ for type-safe, intellisense enabled XML generation #30

Open eruffaldi opened 7 years ago

eruffaldi commented 7 years ago

1) extract Component signatures 2) generate stub code 3) include code into program that binds components (intellisense enabled) 4) compile and run emitting XML or directly launching CoCo

We implement it in C++ but could be implemented with any typed language

Pros: faster editing, support for arguments Cons: little slower

We could limit the Cons as follows: 1) let launcher support this file at command line with -x automatically compiling and executing and passing the correct includes 2) perform step 1 with some form of caching

eruffaldi commented 7 years ago

Working prototype:

#include "cocoxx.hpp"

int main(int argc, char const *argv[])
{
    coco::CoCoApp h;

    // create objects and assign names (TODO anonymous)
    auto x = coco::vision::OpenNIReaderTask("reader");
    auto y = coco::vision::X264EncoderTask("enc");

    // returns Connectionf or customization
    y.image_IN << x.rgb_buffer_OUT;

    // put into container
    h << x << y;

    h.generateXML();
    //h.run();

    return 0;
}

Example with CLion

image