Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
damn, missing files
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 14 Jul 2015 23:58:35 +0000 (01:58 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Sat, 18 Jul 2015 18:07:02 +0000 (20:07 +0200)
include/simgrid/host.h [new file with mode: 0644]
src/simgrid/host.cpp [new file with mode: 0644]

diff --git a/include/simgrid/host.h b/include/simgrid/host.h
new file mode 100644 (file)
index 0000000..b7a79f0
--- /dev/null
@@ -0,0 +1,28 @@
+/* Copyright (c) 2013-2015. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef SIMGRID_HOST_H_
+#define SIMGRID_HOST_H_
+
+#include <xbt/dict.h>
+
+SG_BEGIN_DECL()
+
+typedef xbt_dictelm_t sg_host_t;
+
+typedef struct s_smx_host_priv *smx_host_priv_t;
+
+// Function returning the SIMIX's private part of the host
+XBT_PUBLIC(smx_host_priv_t) sg_host_simix(sg_host_t host);
+XBT_PUBLIC(void) sg_host_simix_set(sg_host_t host, smx_host_priv_t priv);
+XBT_PUBLIC(void) sg_host_simix_destroy(sg_host_t host);
+
+// Module initializer. Won't survive the conversion to C++
+XBT_PUBLIC(void) sg_host_init(void);
+
+SG_END_DECL()
+
+#endif /* SIMGRID_HOST_H_ */
diff --git a/src/simgrid/host.cpp b/src/simgrid/host.cpp
new file mode 100644 (file)
index 0000000..969a738
--- /dev/null
@@ -0,0 +1,38 @@
+/* Copyright (c) 2013-2015. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#include "xbt/dict.h"
+#include "simgrid/host.h"
+#include "surf/surf_routing.h" // SIMIX_HOST_LEVEL and friends FIXME: make private here
+
+int SIMIX_HOST_LEVEL;           //Simix host level
+
+#include "simix/smx_host_private.h" // SIMIX_host_destroy. FIXME: killme
+void sg_host_init() {
+       SIMIX_HOST_LEVEL = xbt_lib_add_level(host_lib,SIMIX_host_destroy);
+}
+
+smx_host_priv_t sg_host_simix(sg_host_t host){
+  return (smx_host_priv_t) xbt_lib_get_level(host, SIMIX_HOST_LEVEL);
+}
+void sg_host_simix_set(sg_host_t host, smx_host_priv_t smx_host) {
+         xbt_lib_set(host_lib,host->key,SIMIX_HOST_LEVEL,smx_host);
+}
+void sg_host_simix_destroy(sg_host_t host) {
+         xbt_lib_unset(host_lib,host->key,SIMIX_HOST_LEVEL,1);
+}
+
+
+/*
+host::host() {
+       // TODO Auto-generated constructor stub
+
+}
+
+host::~host() {
+       // TODO Auto-generated destructor stub
+}*/
+