From: Gabriel Corona Date: Thu, 14 Jan 2016 15:50:24 +0000 (+0100) Subject: [s4u] Add a header file with forward declarations X-Git-Tag: v3_13~1240 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/900387d3c17ad331e7ce770590d07aca4be07c1d [s4u] Add a header file with forward declarations --- diff --git a/include/simgrid/s4u/actor.hpp b/include/simgrid/s4u/actor.hpp index d59ad63348..f8074076d5 100644 --- a/include/simgrid/s4u/actor.hpp +++ b/include/simgrid/s4u/actor.hpp @@ -8,14 +8,11 @@ #include #include +#include namespace simgrid { namespace s4u { -class Comm; -class Host; -class Mailbox; - /** @brief Simulation Agent * * An actor may be defined as a code executing in a location (host). diff --git a/include/simgrid/s4u/async.hpp b/include/simgrid/s4u/async.hpp index 3454a03a5d..37bd4e144f 100644 --- a/include/simgrid/s4u/async.hpp +++ b/include/simgrid/s4u/async.hpp @@ -11,6 +11,8 @@ #include #include +#include + SG_BEGIN_DECL(); typedef enum { inited, started, finished @@ -20,10 +22,6 @@ SG_END_DECL(); namespace simgrid { namespace s4u { -/* Forward declaration */ -class Comm; - - /** @brief Asynchronous Actions * * This class is the ancestor of every asynchronous actions, that is, of actions that do take time in the simulated world. diff --git a/include/simgrid/s4u/comm.hpp b/include/simgrid/s4u/comm.hpp index f006baf849..fa6b0648e0 100644 --- a/include/simgrid/s4u/comm.hpp +++ b/include/simgrid/s4u/comm.hpp @@ -8,14 +8,13 @@ #define SIMGRID_S4U_COMM_HPP #include +#include #include #include namespace simgrid { namespace s4u { -class Mailbox; - /** @brief Communication async * * Represents all asynchronous communications, that you can test or wait onto. diff --git a/include/simgrid/s4u/engine.hpp b/include/simgrid/s4u/engine.hpp index 0f7dca1fc0..da1d33ae3e 100644 --- a/include/simgrid/s4u/engine.hpp +++ b/include/simgrid/s4u/engine.hpp @@ -8,6 +8,8 @@ #include +#include + namespace simgrid { namespace s4u { /** @brief Simulation engine diff --git a/include/simgrid/s4u/forward.hpp b/include/simgrid/s4u/forward.hpp new file mode 100644 index 0000000000..12a789486d --- /dev/null +++ b/include/simgrid/s4u/forward.hpp @@ -0,0 +1,22 @@ +/* Copyright (c) 2016. 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_S4U_FORWARD_HPP +#define SIMGRID_S4U_FORWARD_HPP + +namespace simgrid { +namespace s4u { + +class Async; +class Comm; +class Engine; +class Host; +class Mailbox; +class Storage; + +} +} + +#endif diff --git a/include/simgrid/s4u/mailbox.hpp b/include/simgrid/s4u/mailbox.hpp index 93dad67e96..1962201bde 100644 --- a/include/simgrid/s4u/mailbox.hpp +++ b/include/simgrid/s4u/mailbox.hpp @@ -9,13 +9,12 @@ #include #include +#include #include namespace simgrid { namespace s4u { -class Comm; - /** @brief Mailboxes * * Rendez-vous point for network communications, similar to URLs on which you could post and retrieve data. diff --git a/include/simgrid/s4u/storage.hpp b/include/simgrid/s4u/storage.hpp index b0b3335372..66547b84aa 100644 --- a/include/simgrid/s4u/storage.hpp +++ b/include/simgrid/s4u/storage.hpp @@ -10,6 +10,7 @@ #include #include "xbt/base.h" #include "simgrid/simix.h" +#include namespace simgrid { namespace s4u { diff --git a/tools/cmake/DefinePackages.cmake b/tools/cmake/DefinePackages.cmake index a09ab3966e..bfcf1b08da 100644 --- a/tools/cmake/DefinePackages.cmake +++ b/tools/cmake/DefinePackages.cmake @@ -675,6 +675,7 @@ set(headers_to_install include/simgrid/simix.hpp include/simgrid/host.h include/simgrid/link.h + include/simgrid/s4u/forward.hpp include/simgrid/s4u/actor.hpp include/simgrid/s4u/async.hpp include/simgrid/s4u/comm.hpp