Commit 3e486920 authored by Gauthier Quesnel's avatar Gauthier Quesnel
Browse files

a new vpz?

parent 60b426d6
Pipeline #2153 failed with stage
in 18 seconds
......@@ -30,5 +30,6 @@ endfunction()
add_unit_test(test_parameter test/parameter.cpp)
add_unit_test(test_array test/array.cpp)
add_unit_test(test_vpz test/vpz.cpp)
enable_testing()
/* Copyright (C) 2016-2018 INRA
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <bits/array.hpp>
#include <bits/unit-test.hpp>
#include <ratio>
#include <string>
namespace vle {
struct Dynamics
{
std::string name;
std::string package;
std::string library;
std::string language;
};
struct View
{
std::string name;
std::string package;
std::string library;
std::string location;
std::ration timestep;
enum class view_type
{
timed = 0,
alloc = 1 << 1,
output = 1 << 2,
internal = 1 << 3,
external = 1 << 4,
confluent = 1 << 5,
finish = 1 << 6,
};
view_type type;
};
struct Value
{};
struct Condition
{
std::string name;
Value value;
};
struct Connection
{
ID model_src;
ID model_slot_src;
ID model_dst;
ID model_slot_dst;
};
struct Model
{
std::string name;
ID dynamics;
ID observables;
data_array<ID> conditions;
data_array<ID> input_slots;
data_array<ID> output_slots;
data_array<ID> models;
data_array<ID> internal_connections;
enum class model_type
{
atomic,
coupled
};
model_type type;
};
struct Class
{
std::string name;
ID model;
};
struct Vpz
{
std::string name;
std::string author;
std::string version;
data_array<Dynamics> dynamics;
data_array<View> views;
data_array<Conditions> conditions;
data_array<Model> models;
data_array<Connection> connections;
data_array<Class> classes;
data_array<float> value_float;
data_array<double> value_double;
data_array<std::int8_t> value_int8;
data_array<std::int64_t> value_int64;
data_array<std::string> value_string;
};
} // vle
int
main(int /* argc */, char* /* argv */ [])
{
return unit_test::report_errors();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment