SST 15.0
Structural Simulation Toolkit
SST::SSTHandlerBase< void, argT >::AttachPoint Class Referenceabstract

Attach Point to get notified when a handler starts and stops. More...

#include <ssthandler.h>

Inheritance diagram for SST::SSTHandlerBase< void, argT >::AttachPoint:
SST::Core::Serialization::serializable SST::Core::Serialization::serializable_base

Public Member Functions

virtual uintptr_t registerHandler (const AttachPointMetaData &mdata)=0
 Function that will be called when a handler is registered with the tool implementing the attach point.
 
virtual void beforeHandler (uintptr_t key, std::conditional_t< std::is_pointer_v< argT >, const std::remove_pointer_t< argT > *, const argT & > arg)=0
 Function to be called before the handler is called.
 
virtual void afterHandler (uintptr_t key)=0
 Function to be called after the handler is called.
 
virtual void serializeHandlerAttachPointKey (SST::Core::Serialization::serializer &UNUSED(ser), uintptr_t &UNUSED(key))
 Function that will be called to handle the key returned from registerHandler, if the AttachPoint tool is serializable.
 
virtual uintptr_t registerHandler (const AttachPointMetaData &mdata)=0
 Function that will be called when a handler is registered with the tool implementing the attach point.
 
virtual void beforeHandler (uintptr_t key, std::conditional_t< std::is_pointer_v< argT >, const std::remove_pointer_t< argT > *, const argT & > arg)=0
 Function to be called before the handler is called.
 
virtual void afterHandler (uintptr_t key, std::conditional_t< std::is_pointer_v< void >, const std::remove_pointer_t< void > *, const void & > ret_value)=0
 Function to be called after the handler is called.
 
virtual void serializeHandlerAttachPointKey (SST::Core::Serialization::serializer &UNUSED(ser), uintptr_t &UNUSED(key))
 Function that will be called to handle the key returned from registerHandler, if the AttachPoint tool is serializable.
 
void operator() (argT arg)
 
void attachTool (AttachPoint *tool, const AttachPointMetaData &mdata)
 Attaches a tool to the AttachPoint.
 
void detachTool (AttachPoint *tool)
 Remove an attached tool.
 
void transferAttachedToolInfo (SSTHandlerBase *handler)
 Transfers attached tools from existing handler.
 
- Public Member Functions inherited from SST::Core::Serialization::serializable_base
virtual const char * cls_name () const =0
 
virtual uint32_t cls_id () const =0
 
virtual std::string serialization_name () const =0
 

Protected Member Functions

virtual void operator_impl (argT)=0
 
void serialize_order (SST::Core::Serialization::serializer &ser) override
 

Additional Inherited Members

- Static Public Attributes inherited from SST::Core::Serialization::serializable
static constexpr uint32_t NullClsId = std::numeric_limits<uint32_t>::max()
 
- Static Public Attributes inherited from SST::Core::Serialization::serializable_base
static constexpr uint32_t NullClsId = std::numeric_limits<uint32_t>::max()
 
- Protected Types inherited from SST::Core::Serialization::serializable_base
enum  cxn_flag_t { ConstructorFlag }
 
- Static Protected Member Functions inherited from SST::Core::Serialization::serializable_base
static void serializable_abort (uint32_t line, const char *file, const char *func, const char *obj)
 

Detailed Description

template<typename argT>
class SST::SSTHandlerBase< void, argT >::AttachPoint

Attach Point to get notified when a handler starts and stops.

This class is used in conjuction with a Tool type base class to create various tool types to attach to the handler.

Member Function Documentation

◆ afterHandler() [1/2]

template<typename argT>
virtual void SST::SSTHandlerBase< void, argT >::AttachPoint::afterHandler ( uintptr_t key)
pure virtual

Function to be called after the handler is called.

The key passed in is the uintptr_t returned from registerHandler()

Parameters
keyuintptr_t returned from registerHandler() when handler was registered with the tool

◆ afterHandler() [2/2]

virtual void SST::SSTHandlerBase< void, argT >::AttachPoint::afterHandler ( uintptr_t key,
std::conditional_t< std::is_pointer_v< void >, const std::remove_pointer_t< void > *, const void & > ret_value )
pure virtual

Function to be called after the handler is called.

The key passed in is the uintptr_t returned from registerHandler()

Parameters
keyuintptr_t returned from registerHandler() when handler was registered with the tool
ret_valuevalue that was returned by the handler. If retunT is a pointer, this will be passed as a const pointer, if not, it will be passed as a const reference

◆ attachTool()

void SST::SSTHandlerBase< void, argT >::attachTool ( AttachPoint * tool,
const AttachPointMetaData & mdata )
inline

Attaches a tool to the AttachPoint.

Parameters
toolTool to attach
mdataMetadata to pass to the tool

◆ beforeHandler() [1/2]

virtual void SST::SSTHandlerBase< void, argT >::AttachPoint::beforeHandler ( uintptr_t key,
std::conditional_t< std::is_pointer_v< argT >, const std::remove_pointer_t< argT > *, const argT & > arg )
pure virtual

Function to be called before the handler is called.

@key uintptr_t returned from registerHandler() when handler was registered with the tool

  • argument that will be passed to the handler function. If argT is a pointer, this will be passed as a const pointer, if not, it will be passed as a const reference

◆ beforeHandler() [2/2]

template<typename argT>
virtual void SST::SSTHandlerBase< void, argT >::AttachPoint::beforeHandler ( uintptr_t key,
std::conditional_t< std::is_pointer_v< argT >, const std::remove_pointer_t< argT > *, const argT & > arg )
pure virtual

Function to be called before the handler is called.

@key uintptr_t returned from registerHandler() when handler was registered with the tool

  • argument that will be passed to the handler function. If argT is a pointer, this will be passed as a const pointer, if not, it will be passed as a const reference

◆ detachTool()

void SST::SSTHandlerBase< void, argT >::detachTool ( AttachPoint * tool)
inline

Remove an attached tool.

Parameters
toolTool to remove. If tool doesn't exist, then no action is taken

◆ registerHandler() [1/2]

virtual uintptr_t SST::SSTHandlerBase< void, argT >::AttachPoint::registerHandler ( const AttachPointMetaData & mdata)
pure virtual

Function that will be called when a handler 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 beforeHandler() and afterHandler() functions.

Parameters
mdataMetadata to be passed into the tool
Returns
Opaque key that will be passed back into beforeHandler() and afterHandler() to identify the source of the calls

◆ registerHandler() [2/2]

template<typename argT>
virtual uintptr_t SST::SSTHandlerBase< void, argT >::AttachPoint::registerHandler ( const AttachPointMetaData & mdata)
pure virtual

Function that will be called when a handler 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 beforeHandler() and afterHandler() functions.

Parameters
mdataMetadata to be passed into the tool
Returns
Opaque key that will be passed back into beforeHandler() and afterHandler() to identify the source of the calls

Referenced by SST::SSTHandlerBase< void, argT >::attachTool().

◆ serialize_order()

void SST::SSTHandlerBase< void, argT >::serialize_order ( SST::Core::Serialization::serializer & ser)
inlineoverrideprotectedvirtual

◆ serializeHandlerAttachPointKey() [1/2]

virtual void SST::SSTHandlerBase< void, argT >::AttachPoint::serializeHandlerAttachPointKey ( SST::Core::Serialization::serializer & UNUSEDser,
uintptr_t & UNUSEDkey )
inlinevirtual

Function that will be called to handle the key returned from registerHandler, 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 beforeHandler() and afterHandler().

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 beforeHandler() and afterHandler() functions.

◆ serializeHandlerAttachPointKey() [2/2]

template<typename argT>
virtual void SST::SSTHandlerBase< void, argT >::AttachPoint::serializeHandlerAttachPointKey ( SST::Core::Serialization::serializer & UNUSEDser,
uintptr_t & UNUSEDkey )
inlinevirtual

Function that will be called to handle the key returned from registerHandler, 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 beforeHandler() and afterHandler().

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 beforeHandler() and afterHandler() functions.

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