Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Remove a lot of typedefs and typedef usage
[simgrid.git] / src / mc / mc_forward.h
index 42edadf..a3a56e6 100644 (file)
@@ -4,68 +4,27 @@
 /* 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. */
 
+/** \file mc_forward.h
+ *
+ *  Define type names for pointers of MC objects for the C code
+ */
+
 #ifndef SIMGRID_MC_FORWARD_H
 #define SIMGRID_MC_FORWARD_H
 
-#include <xbt/misc.h>
-#include <mc/datatypes.h>
-
 #ifdef __cplusplus
 
-#define MC_OVERRIDE
-
-namespace simgrid {
-namespace mc {
-
-class PageStore;
-class ModelChecker;
-class AddressSpace;
-class Process;
-class Snapshot;
-class ObjectInformation;
-class Type;
-class Variable;
-class Frame;
-
-}
-}
-
-typedef ::simgrid::mc::ModelChecker s_mc_model_checker_t;
-typedef ::simgrid::mc::PageStore s_mc_pages_store_t;
-typedef ::simgrid::mc::AddressSpace s_mc_address_space_t;
-typedef ::simgrid::mc::Process s_mc_process_t;
-typedef ::simgrid::mc::Snapshot s_mc_snapshot_t;
-typedef ::simgrid::mc::ObjectInformation s_mc_object_info_t;
-typedef ::simgrid::mc::Type s_mc_type_t;
-typedef ::simgrid::mc::Variable s_mc_variable_t;
-typedef ::simgrid::mc::Frame s_mc_frame_t;
+// If we're in C++, we give the real definition:
+#include "mc_forward.hpp"
+typedef simgrid::mc::Snapshot *mc_snapshot_t;
+typedef simgrid::mc::Type *mc_type_t;
 
 #else
 
-typedef struct _s_mc_model_checker s_mc_model_checker_t;
-typedef struct _s_mc_pages_store s_mc_pages_store_t;
-typedef struct _s_mc_address_space_t s_mc_address_space_t;
-typedef struct _s_mc_process_t s_mc_process_t;
-typedef struct _s_mc_snapshot_t s_mc_snapshot_t;
-typedef struct _s_mc_object_info_t s_mc_object_info_t;
-typedef struct _s_mc_type_t s_mc_type_t;
-typedef struct _s_mc_variable_t s_mc_variable_t;
-typedef struct _s_mc_frame_t s_mc_frame_t;
+// Otherwise we use dummy opaque structs:
+typedef struct _mc_snapshot_t *mc_snapshot_t;
+typedef struct _s_mc_type_t *mc_type_t;
 
 #endif
 
-typedef s_mc_pages_store_t *mc_pages_store_t;
-typedef s_mc_model_checker_t *mc_model_checker_t;
-typedef s_mc_address_space_t *mc_address_space_t;
-typedef s_mc_process_t *mc_process_t;
-typedef s_mc_snapshot_t *mc_snapshot_t;
-typedef s_mc_object_info_t *mc_object_info_t;
-typedef s_mc_type_t *mc_type_t;
-typedef s_mc_variable_t *mc_variable_t;
-typedef s_mc_frame_t *mc_frame_t;
-
-SG_BEGIN_DECL()
-extern mc_model_checker_t mc_model_checker;
-SG_END_DECL()
-
 #endif