Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Simplify the library initialization + deprecate 2 XBT functions
[simgrid.git] / include / xbt / virtu.h
1 /* virtu - virtualization layer for the logging to know about the actors    */
2
3 /* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved.          */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef XBT_VIRTU_H
9 #define XBT_VIRTU_H
10
11 #include <simgrid/actor.h>
12 #include <xbt/base.h>
13
14 #ifdef __cplusplus
15 #include <string>
16 #include <vector>
17
18 namespace simgrid {
19 namespace xbt {
20
21 /* Get the name of the UNIX process englobing the world */
22 XBT_PUBLIC_DATA std::string binary_name;
23 /** Contains all the parameters we got from the command line (including argv[0]) */
24 XBT_PUBLIC_DATA std::vector<std::string> cmdline;
25
26 } // namespace xbt
27 } // namespace simgrid
28 #endif
29
30 SG_BEGIN_DECL
31
32 XBT_ATTRIB_DEPRECATED_v337("Please use sg_actor_self_get_name()") static const char* xbt_procname(void)
33 {
34   return sg_actor_self_get_name() ?: "maestro";
35 }
36
37 XBT_ATTRIB_DEPRECATED_v337("Please use sg_actor_self_get_pid()") static int xbt_getpid(void)
38 {
39   return sg_actor_self_get_pid();
40 };
41
42 SG_END_DECL
43
44 #endif /* XBT_VIRTU_H */