SST  11.0.0
StructuralSimulationToolkit
module.h
1 // Copyright 2009-2021 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2021, NTESS
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 
13 #ifndef SST_CORE_MODULE_H
14 #define SST_CORE_MODULE_H
15 
16 #include "sst/core/eli/elementinfo.h"
17 
18 namespace SST {
19  /**
20  Module is a tag class used with the loadModule function.
21  */
22  class Module {
23  public:
24  SST_ELI_DECLARE_BASE(Module)
25  //declare extern to limit compile times
26  SST_ELI_DECLARE_CTORS(
27  ELI_CTOR(SST::Params&),
28  ELI_CTOR(Component*,SST::Params&)
29  )
30  SST_ELI_DECLARE_INFO_EXTERN(ELI::ProvidesParams)
31  Module() {}
32  virtual ~Module() {}
33 
34  };
35 } //namespace SST
36 
37 #define SST_ELI_REGISTER_MODULE(cls,lib,name,version,desc,interface) \
38  SST_ELI_REGISTER_DERIVED(SST::Module,cls,lib,name,ELI_FORWARD_AS_ONE(version),desc) \
39  SST_ELI_INTERFACE_INFO(interface)
40 
41 
42 // New way to register modules. Must register an interface (API)
43 // first, then you can register a module that implements it
44 #define SST_ELI_REGISTER_MODULE_API(cls,...) \
45  SST_ELI_DECLARE_NEW_BASE(SST::Module,::cls) \
46  SST_ELI_NEW_BASE_CTOR(SST::Params&,##__VA_ARGS__)
47 
48 #define SST_ELI_REGISTER_MODULE_DERIVED_API(cls,base,...) \
49  SST_ELI_DECLARE_NEW_BASE(::base,::cls) \
50  SST_ELI_NEW_BASE_CTOR(SST::Params&,##__VA_ARGS__)
51 
52 #define SST_ELI_REGISTER_MODULE_DERIVED(cls,lib,name,version,desc,interface) \
53  SST_ELI_REGISTER_DERIVED(::interface,cls,lib,name,ELI_FORWARD_AS_ONE(version),desc) \
54  SST_ELI_INTERFACE_INFO(#interface)
55 
56 
57 #endif // SST_CORE_ACTION_H
Main component object for the simulation.
Definition: component.h:31
Module is a tag class used with the loadModule function.
Definition: module.h:22
Definition: paramsInfo.h:39
Parameter store.
Definition: params.h:44