SST/macro
integrated_component.h
Go to the documentation of this file.
1 /*
2 //@HEADER
3 // ************************************************************************
4 //
5 // integrated_component.h
6 // sst-macro
7 // Copyright (C) 2015 Sandia Corporation
8 //
9 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
10 // the U.S. Government retains certain rights in this software.
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions are
14 // met:
15 //
16 // 1. Redistributions of source code must retain the above copyright
17 // notice, this list of conditions and the following disclaimer.
18 //
19 // 2. Redistributions in binary form must reproduce the above copyright
20 // notice, this list of conditions and the following disclaimer in the
21 // documentation and/or other materials provided with the distribution.
22 //
23 // 3. Neither the name of the Corporation nor the names of the
24 // contributors may be used to endorse or promote products derived from
25 // this software without specific prior written permission.
26 //
27 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
28 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
30 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
31 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
32 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
33 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
35 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
36 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
37 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 //
39 // Questions? Contact David S. Hollman (dshollm@sandia.gov)
40 //
41 // ************************************************************************
42 //@HEADER
43 */
44 
45 #ifndef SSTMAC_MICRO_INTEGRATED_COMPONENT_H_
46 #define SSTMAC_MICRO_INTEGRATED_COMPONENT_H_
47 
50 
51 #include <sst/core/link.h>
52 #include <sst/core/linkMap.h>
53 #include <sst/core/params.h>
54 #include <sst/core/element.h>
57 
58 namespace sstmac {
59 
60 // lightweight layer in between integrated components and SST core, useful for common helper functions, etc
62  : public SST::Component
63 {
64  public:
65  void handle_event(SST::Event* ev);
66 
67  virtual void
68  handle(event* ev) = 0;
69 
70  virtual void
71  init(unsigned int phase);
72 
73  void
74  handle_self_link(SST::Event* ev);
75 
76  protected:
78  SST::ComponentId_t id,
79  SST::Params& params);
80 
81  void configure_self_link();
82 
83  virtual void
84  init_factory_params(sprockit::sim_parameters* params) = 0;
85 
86  virtual void
87  init_sst_params(SST::Params& params);
88 
89  SST::SimTime_t
90  extra_delay(timestamp t) const;
91 
92  SST::LinkMap* link_map_;
93  SST::Link* self_link_;
94  sprockit::sim_parameters* params_;
95  static SST::TimeConverter* time_converter_;
96 
97 };
98 
99 } /* end namespace sstmac */
100 
101 #endif /* SSTMAC_MICRO_INTEGRATED_COMPONENT_H_ */
102 
sprockit::sim_parameters * params_
virtual void init(unsigned int phase)
SSTIntegratedComponent(SST::ComponentId_t id, SST::Params &params)
void handle_self_link(SST::Event *ev)
A basic container for time (subject to future transplant).
Definition: timestamp.h:29
SUMI = Simulator unified messagine interface It is also the name for a solid ink in Japanese - i...
static SST::TimeConverter * time_converter_
SST::SimTime_t extra_delay(timestamp t) const
void handle_event(SST::Event *ev)
virtual void init_factory_params(sprockit::sim_parameters *params)=0
virtual void init_sst_params(SST::Params &params)
virtual void handle(event *ev)=0