SST 15.0
Structural Simulation Toolkit
SST::Link::AttachPoint Class Referenceabstract

Attach point for inspecting, modifying or dropping events sent on the Link. More...

#include <link.h>

Inheritance diagram for SST::Link::AttachPoint:
SST::PortModule SST::Profile::EventHandlerProfileTool SST::CoreTestPortModule::TestPortModule SST::IMPL::PortModule::RandomDrop SST::Profile::EventHandlerProfileToolTime< std::chrono::high_resolution_clock > SST::Profile::EventHandlerProfileToolTime< std::chrono::steady_clock > SST::Profile::EventHandlerProfileToolCount SST::Profile::EventHandlerProfileToolTime< T > SST::Profile::EventHandlerProfileToolTimeHighResolution SST::Profile::EventHandlerProfileToolTimeSteady

Public Member Functions

virtual uintptr_t registerLinkAttachTool (const AttachPointMetaData &mdata)=0
 Function that will be called when an attach point is registered with the tool implementing the attach point.
 
virtual void eventSent (uintptr_t key, Event *&ev)=0
 Function that will be called when an event is sent on a link with registered attach points.
 
virtual void serializeEventAttachPointKey (SST::Core::Serialization::serializer &ser, uintptr_t &key)
 Function that will be called to handle the key returned from registerLinkAttachTool, if the AttachPoint tool is serializable.
 

Detailed Description

Attach point for inspecting, modifying or dropping events sent on the Link.

NOTE: Using the Link::AttachPoint will noticeably affect the performance of sending events on Links and it is recommended that, if possible, Event::HandlerBase::AttachPoint or Event::HandlerBase::InterceptPoint be used instead.

Member Function Documentation

◆ eventSent()

virtual void SST::Link::AttachPoint::eventSent ( uintptr_t key,
Event *& ev )
pure virtual

Function that will be called when an event is sent on a link with registered attach points.

If ev is set to nullptr, then the event will not be delivered and the tool should delete the original event.

Parameters
keyOpaque key returned from registerLinkAttachTool()

Implemented in SST::CoreTestPortModule::TestPortModule, SST::IMPL::PortModule::RandomDrop, SST::PortModule, and SST::Profile::EventHandlerProfileToolCount.

◆ registerLinkAttachTool()

virtual uintptr_t SST::Link::AttachPoint::registerLinkAttachTool ( const AttachPointMetaData & mdata)
pure virtual

Function that will be called when an attach point is registered with the tool implementing the attach point.

The metadata passed in will be dependent on what type of tool this is attached to. The uintptr_t returned from this function will be passed into the eventSent() function.

Parameters
mdataMetadata to be passed into the tool
Returns
Opaque key that will be passed back into eventSent() to identify the source of the call

Implemented in SST::IMPL::PortModule::RandomDrop, SST::PortModule, SST::Profile::EventHandlerProfileToolCount, SST::Profile::EventHandlerProfileToolTime< T >, SST::Profile::EventHandlerProfileToolTime< std::chrono::high_resolution_clock >, and SST::Profile::EventHandlerProfileToolTime< std::chrono::steady_clock >.

◆ serializeEventAttachPointKey()

void SST::Link::AttachPoint::serializeEventAttachPointKey ( SST::Core::Serialization::serializer & ser,
uintptr_t & key )
virtual

Function that will be called to handle the key returned from registerLinkAttachTool, if the AttachPoint tool is serializable.

This is needed because the key is opaque to the Link, so it doesn't know how to handle it during serialization. During SIZE and PACK phases of serialization, the tool needs to store out any information that will be needed to recreate data that is reliant on the key. On UNPACK, the function needs to recreate any state and reinitialize the passed in key reference to the proper state to continue to make valid calls to eventSent().

Since not all tools will be serializable, there is a default, empty implementation.

Parameters
serSerializer to use for serialization
keyKey that would be passed into the eventSent() function.

Reimplemented in SST::PortModule.


The documentation for this class was generated from the following files: