#include "Deploy.hpp"

#include <Launcher.hpp>

/*
 * The "static" includes (the one we use inconditionnaly)
 */

int main(int argc, char **argv) {
    int ret = EXIT_SUCCESS;

    // deploy the system corresponding to the root component
    Component &component = *deploy(argc, argv);

    // create an engine launcher
    Launcher launcher(argc, argv, component);

    // initialize the launcher (components, etc.)
    ret = launcher.initialize();

    // run the engine
    if (ret == EXIT_SUCCESS) {
      ret = launcher.launch();
    }

    return ret;
}

Component* deploy(int argc __attribute__((unused)), char **argv __attribute__((unused))){
    // Top is Comp__ROOT



    // Runtime init for Atom: Comp__ROOT__a
    // staticallocated::Comp__ROOT__a


    // Runtime init for Compound: Comp__ROOT
    // staticallocated::Comp__ROOT

    // Finished: Comp__ROOT
    return &(staticallocated::Comp__ROOT);
}

bool isSerializeEnabled() {
    return false;
}

void serialize(char **cbuf __attribute__((unused)), size_t *clen __attribute__((unused))){
    assert(false);
}

void deserialize(const char *buf __attribute__((unused)), size_t len __attribute__((unused))){
    assert(false);
}
