16#ifndef SST_CORE_CORETEST_MESSAGEMESH_ENCLOSINGCOMPONENT_H
17#define SST_CORE_CORETEST_MESSAGEMESH_ENCLOSINGCOMPONENT_H
19#include "sst/core/testElements/message_mesh/messageEvent.h"
21#include "sst/core/component.h"
22#include "sst/core/event.h"
23#include "sst/core/link.h"
24#include "sst/core/rng/rng.h"
25#include "sst/core/ssthandler.h"
26#include "sst/core/subcomponent.h"
30namespace MessageMesh {
64 template <
typename classT,
typename dataT =
void>
67 virtual void setNotifyOnReceive(
HandlerBase* functor) { rFunctor = functor; }
83 virtual void send(
MessageEvent* ev,
int incoming_port) = 0;
90 SST_ELI_REGISTER_COMPONENT(
93 "message_mesh.enclosing_component",
94 SST_ELI_ELEMENT_VERSION(1,0,0),
95 "Base element that encloses the SubComponents that actually provide the functionality",
96 COMPONENT_CATEGORY_NETWORK
99 SST_ELI_DOCUMENT_PARAMS(
100 {
"id",
"Id for this componentd",
""},
103 SST_ELI_DOCUMENT_STATISTICS(
106 SST_ELI_DOCUMENT_PORTS(
109 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
110 {
"ports",
"Slot that the ports objects go in",
"SST::CoreTest::MessageMesh::PortInterface" },
111 {
"route",
"Slot that the ports objects go in",
"SST::CoreTest::MessageMesh::RouteInterface" }
122 std::vector<PortInterface*> ports;
135 SST_ELI_REGISTER_SUBCOMPONENT_DERIVED(
138 "message_mesh.port_slot",
139 SST_ELI_ELEMENT_VERSION(1,0,0),
140 "SubComponent implementing PortInterface that simply defers to another loaded PortInterface",
144 SST_ELI_DOCUMENT_PARAMS(
147 SST_ELI_DOCUMENT_STATISTICS(
150 SST_ELI_DOCUMENT_PORTS(
153 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
154 {
"port",
"Slot to load the real PortInterface object",
"SST::CoreTest::MessageMesh::PortInterface" }
160 void send(
MessageEvent* ev)
override { port->send(ev); }
161 void setNotifyOnReceive(
HandlerBase* functor)
override { port->setNotifyOnReceive(functor); }
172 SST_ELI_REGISTER_SUBCOMPONENT_DERIVED(
175 "message_mesh.message_port",
176 SST_ELI_ELEMENT_VERSION(1,0,0),
177 "SubComponent implementing PortInterface for sending and receiving messages",
181 SST_ELI_DOCUMENT_PARAMS(
184 SST_ELI_DOCUMENT_STATISTICS(
187 SST_ELI_DOCUMENT_PORTS(
188 {
"port",
"Port to send or receive on", {
"" } },
191 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
198 void handleEvent(
Event* ev);
208 SST_ELI_REGISTER_SUBCOMPONENT_DERIVED(
211 "message_mesh.route_message",
212 SST_ELI_ELEMENT_VERSION(1,0,0),
213 "SubComponent implementing message routing",
217 SST_ELI_DOCUMENT_PARAMS(
220 SST_ELI_DOCUMENT_STATISTICS(
223 SST_ELI_DOCUMENT_PORTS(
226 SST_ELI_DOCUMENT_SUBCOMPONENT_SLOTS(
229 RouteMessage(ComponentId_t
id,
Params& params,
const std::vector<PortInterface*>& ports,
int my_id);
232 void send(
MessageEvent* ev,
int incoming_port)
override;
235 const std::vector<PortInterface*> ports;
Main component object for the simulation.
Definition: component.h:31
Definition: enclosingComponent.h:87
void finish()
Called after complete phase, but before objects are destroyed.
Definition: enclosingComponent.cc:76
void setup()
Called after all components have been constructed and initialization has completed,...
Definition: enclosingComponent.cc:64
Definition: messageEvent.h:26
Definition: enclosingComponent.h:169
Definition: enclosingComponent.h:33
SSTHandlerBase< void, Event * > HandlerBase
Base handler for event delivery.
Definition: enclosingComponent.h:43
Definition: enclosingComponent.h:132
Definition: enclosingComponent.h:76
Definition: enclosingComponent.h:205
Base class for Events - Items sent across links to communicate between components.
Definition: event.h:35
Link between two components.
Definition: link.h:38
Parameter store.
Definition: params.h:56
Implements the base class for random number generators for the SST core.
Definition: rng.h:28
Handlers with 1 handler defined argument to callback from caller.
Definition: ssthandler.h:171
Handler class with user-data argument.
Definition: ssthandler.h:220
SubComponent is a class loadable through the factory which allows dynamic functionality to be added t...
Definition: subcomponent.h:29