Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Inventive hack to get flex raising exceptions on parse error
[simgrid.git] / src / surf / xml / platf.hpp
1 /* Copyright (c) 2006-2019. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #ifndef SURF_SURFXML_PARSE_HPP
7 #define SURF_SURFXML_PARSE_HPP
8
9 #include <xbt/base.h>
10 #include <xbt/signal.hpp>
11 #include <vector>
12
13 /* Module management functions */
14 XBT_PUBLIC void sg_platf_init();
15 XBT_PUBLIC void sg_platf_exit();
16
17 XBT_PUBLIC void surf_parse_open(const std::string& file);
18 XBT_PUBLIC void surf_parse_close();
19 XBT_PUBLIC void surf_parse_assert(bool cond, std::string&& msg);
20 SG_BEGIN_DECL
21 XBT_ATTRIB_NORETURN XBT_PUBLIC void surf_parse_error(const char* msg);
22 SG_END_DECL
23 XBT_ATTRIB_NORETURN XBT_PUBLIC void surf_parse_error(std::string&& msg);
24 XBT_PUBLIC void surf_parse_assert_netpoint(const std::string& hostname, const std::string& pre,
25                                            const std::string& post);
26
27 XBT_PUBLIC double surf_parse_get_double(const std::string& s);
28 XBT_PUBLIC int surf_parse_get_int(const std::string& s);
29 XBT_PUBLIC double surf_parse_get_time(const char* string, const char* entity_kind, const std::string& name);
30 XBT_PUBLIC double surf_parse_get_size(const char* string, const char* entity_kind, const std::string& name);
31 XBT_PUBLIC double surf_parse_get_bandwidth(const char* string, const char* entity_kind, const std::string& name);
32 XBT_PUBLIC std::vector<double> surf_parse_get_bandwidths(const char* string, const char* entity_kind,
33                                                          const std::string& name);
34 XBT_PUBLIC double surf_parse_get_speed(const char* string, const char* entity_kind, const std::string& name);
35
36 XBT_PUBLIC void surf_parse(); /* Entry-point to the parser */
37
38 #endif