gem-graph-server/include/model.h

91 lines
4.6 KiB
C
Raw Permalink Normal View History

2021-06-21 14:26:09 +02:00
//=-------------------------------------------------------------------------=//
// Model definitions //
// //
// Copyright © 2021 Libre en Communs (contact@a-lec.org) //
// Copyright © 2021 Adrien Bourmault (neox@a-lec.org) //
2021-06-21 14:26:09 +02:00
// //
// This file is part of gem-graph. //
// //
// This program is free software: you can redistribute it and/or modify //
// it under the terms of the GNU Affero General Public License as //
// published by the Free Software Foundation, either version 3 of the //
// License, or (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU Affero General Public License for more details. //
// //
// You should have received a copy of the GNU Affero General Public License //
// along with this program. If not, see <https://www.gnu.org/licenses/>. //
//=-------------------------------------------------------------------------=//
#pragma once
2021-06-21 14:26:09 +02:00
#ifndef BASE_H
#include "../include/base.h"
#endif
#include <dirent.h>
#include <signal.h>
/* -------------------------------------------------------------------------- */
#define MODEL_STRING_SIZE 64
#define MAX_MODEL_NUMBER 1
#define ARROW_NUMBER 6
#define SITE_NUMBER 2
#define MAX_CYCLES 10
#define MAX_THREAD 0
#define XMAX 39
#define YMAX 0
#define ZMAX 0
#define SPACE_SIZE (XMAX+1) * (YMAX+1) * (ZMAX+1)
/* -------------------------------------------------------------------------- */
// -------------------------------------------------------------------------- //
// Model init function (and model discovery) //
// -------------------------------------------------------------------------- //
void ModelSystemInit(Parameters_t *parameters);
2021-06-23 09:13:46 +02:00
// -------------------------------------------------------------------------- //
// Model stopping function //
// -------------------------------------------------------------------------- //
2021-06-23 14:16:45 +02:00
void ModelSystemDestroy(void);
2021-06-23 09:13:46 +02:00
// -------------------------------------------------------------------------- //
// Load a model ready to execute //
// -------------------------------------------------------------------------- //
2021-06-23 14:16:45 +02:00
int ModelLoad(int id);
2021-06-23 09:13:46 +02:00
// -------------------------------------------------------------------------- //
// Unload a model //
// -------------------------------------------------------------------------- //
int ModelUnload(int id);
2021-06-23 14:16:45 +02:00
// -------------------------------------------------------------------------- //
// Add a model to the known model list //
// -------------------------------------------------------------------------- //
void ModelAddToKnown(Model_t **newModel);
2021-06-23 17:07:43 +02:00
// -------------------------------------------------------------------------- //
// Print informations about all models (known and loaded) to the client //
// -------------------------------------------------------------------------- //
2021-07-07 19:46:23 +02:00
void printModels(char *buf);
// -------------------------------------------------------------------------- //
// Launch a model execution //
// -------------------------------------------------------------------------- //
2021-07-12 17:09:38 +02:00
int ModelRun(int id);
2021-06-23 17:07:43 +02:00
// -------------------------------------------------------------------------- //
// Stop a model execution //
// -------------------------------------------------------------------------- //
2021-07-12 17:09:38 +02:00
int ModelStop(int id);
2021-06-23 17:07:43 +02:00
// -------------------------------------------------------------------------- //
// Stop and unload all loaded or running model //
// -------------------------------------------------------------------------- //
2021-06-23 17:07:43 +02:00
void ModelShutdown(void);