Files
fail/src/experiments/instantiate-experiment-indirect.ah.in
hsc 65eb44a746 workaround for experiment.hpp including generated header
If an experiment's class definition (experiment.hpp) contains a member of
a generated type (which is the common case for protobuf messages), it needs
to include a generated header.  In order to instantiate the experiment in
a SimulatorController::initExperiments() hook aspect, the aspect needs to
include the experiment's class definition -- and indirectly the generated
protobuf header.  As the build system does not know about this dependency,
building SimulatorController.cc fails regularly, because the header is not
generated timely.

This commit works around this (currently only for the RAMpage experiment)
by delegating experiment instantiation to a separate compilation unit,
removing the need to include any headers in the instantiation aspect.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1691 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
2012-09-25 15:52:45 +00:00

23 lines
871 B
Plaintext

#ifndef __INSTANTIATE_@EXPERIMENT_TYPE@_AH__
#define __INSTANTIATE_@EXPERIMENT_TYPE@_AH__
// Use this indirect variant of experiment instantiation if your experiment.hpp
// includes generated headers (e.g., protobuf message definitions) that are not
// guaranteed to exist when the aspect is woven.
// FIXME: cmake does not remove these .ah files when the user configures
// another experiment (or even makes "clean"). Currently, this needs to be
// worked around by manually removing $BUILDDIR/core/experiments/*/*.ah .
// You need to provide the implementation of this function in your experiment
// directory:
void instantiate@EXPERIMENT_TYPE@();
aspect @EXPERIMENT_TYPE@ExperimentHook {
advice execution ("void fail::SimulatorController::initExperiments()") : after () {
instantiate@EXPERIMENT_TYPE@();
}
};
#endif // __INSTANTIATE_@EXPERIMENT_TYPE@_AH__