SST::SubComponent Class Reference

SubComponent is a class loadable through the factory which allows dynamic functionality to be added to a Component. More...

#include <subcomponent.h>

Inheritance diagram for SST::SubComponent:
SST::Module SST::Interfaces::SimpleNetwork SST::Interfaces::SimpleNetwork::NetworkInspector

Public Member Functions

 SubComponent (Component *parent)
virtual void init (unsigned int phase)
 Used during the init phase.
virtual void setup ()
 Called after all components have been constructed and inialization has completed, but before simulation time has begun.
virtual void finish ()
 Called after simulation completes, but before objects are destroyed.

Protected Member Functions

LinkconfigureLink (std::string name, TimeConverter *time_base, Event::HandlerBase *handler=NULL)
 Configure a Link.
LinkconfigureLink (std::string name, std::string time_base, Event::HandlerBase *handler=NULL)
 Configure a Link.
LinkconfigureLink (std::string name, Event::HandlerBase *handler=NULL)
 Configure a Link.
LinkconfigureSelfLink (std::string name, TimeConverter *time_base, Event::HandlerBase *handler=NULL)
 Configure a SelfLink (Loopback link).
LinkconfigureSelfLink (std::string name, std::string time_base, Event::HandlerBase *handler=NULL)
 Configure a SelfLink (Loopback link).
LinkconfigureSelfLink (std::string name, Event::HandlerBase *handler=NULL)
 Configure a SelfLink (Loopback link).
bool doesSubComponentInfoStatisticExist (std::string statisticName)
template<typename T >
Statistic< T > * registerStatistic (std::string statName, std::string statSubId="")
TimeConverterregisterClock (std::string freq, Clock::HandlerBase *handler)
 Registers a clock for this component.
TimeConverterregisterClock (const UnitAlgebra &freq, Clock::HandlerBase *handler)
void unregisterClock (TimeConverter *tc, Clock::HandlerBase *handler)
 Removes a clock handler from the component.
Cycle_t reregisterClock (TimeConverter *freq, Clock::HandlerBase *handler)
 Reactivates an existing Clock and Handler.
Cycle_t getNextClockCycle (TimeConverter *freq)
 Returns the next Cycle that the TimeConverter would fire.
TimeConvertergetTimeConverter (const std::string &base)
TimeConvertergetTimeConverter (const UnitAlgebra &base)
SimTime_t getCurrentSimTime (TimeConverter *tc) const
 return the time since the simulation began in units specified by the parameter.
SimTime_t getCurrentSimTime (std::string base)
 return the time since the simulation began in timebase specified
SimTime_t getCurrentSimTimeNano () const
 Utility function to return the time since the simulation began in nanoseconds.
SimTime_t getCurrentSimTimeMicro () const
 Utility function to return the time since the simulation began in microseconds.
SimTime_t getCurrentSimTimeMilli () const
 Utility function to return the time since the simulation began in milliseconds.
ModuleloadModule (std::string type, Params &params)
ModuleloadModuleWithComponent (std::string type, Params &params)
SubComponentloadSubComponent (std::string type, Params &params)
SharedRegiongetLocalSharedRegion (const std::string &key, size_t size)
 Find a lookup table.
SharedRegiongetGlobalSharedRegion (const std::string &key, size_t size, SharedRegionMerger *merger=NULL)

Protected Attributes

Component *const parent

Friends

class Component
 Component's type, set by the factory when the object is created.

Detailed Description

SubComponent is a class loadable through the factory which allows dynamic functionality to be added to a Component.

The SubComponent API is nearly identical to the Component API and all the calls are proxied to the parent Compoent.


Member Function Documentation

Link * SST::SubComponent::configureLink ( std::string  name,
Event::HandlerBase handler = NULL 
) [protected]

Configure a Link.

Parameters:
name - Port Name on which the link to configure is attached.
handler - Optional Handler to be called when an Event is received
Returns:
A pointer to the configured link, or NULL if an error occured.

References SST::Component::configureLink().

Link * SST::SubComponent::configureLink ( std::string  name,
std::string  time_base,
Event::HandlerBase handler = NULL 
) [protected]

Configure a Link.

Parameters:
name - Port Name on which the link to configure is attached.
time_base - Time Base of the link
handler - Optional Handler to be called when an Event is received
Returns:
A pointer to the configured link, or NULL if an error occured.

References configureLink(), and SST::Simulation::getSimulation().

Link * SST::SubComponent::configureLink ( std::string  name,
TimeConverter time_base,
Event::HandlerBase handler = NULL 
) [protected]

Configure a Link.

Parameters:
name - Port Name on which the link to configure is attached.
time_base - Time Base of the link
handler - Optional Handler to be called when an Event is received
Returns:
A pointer to the configured link, or NULL if an error occured.

References SST::Component::configureLink().

Referenced by configureLink().

Link * SST::SubComponent::configureSelfLink ( std::string  name,
Event::HandlerBase handler = NULL 
) [protected]

Configure a SelfLink (Loopback link).

Parameters:
name - Name of the self-link port
handler - Optional Handler to be called when an Event is received
Returns:
A pointer to the configured link, or NULL if an error occured.

References SST::Component::configureSelfLink().

Link * SST::SubComponent::configureSelfLink ( std::string  name,
std::string  time_base,
Event::HandlerBase handler = NULL 
) [protected]

Configure a SelfLink (Loopback link).

Parameters:
name - Name of the self-link port
time_base - Time Base of the link
handler - Optional Handler to be called when an Event is received
Returns:
A pointer to the configured link, or NULL if an error occured.

References SST::Component::configureSelfLink().

Link * SST::SubComponent::configureSelfLink ( std::string  name,
TimeConverter time_base,
Event::HandlerBase handler = NULL 
) [protected]

Configure a SelfLink (Loopback link).

Parameters:
name - Name of the self-link port
time_base - Time Base of the link
handler - Optional Handler to be called when an Event is received
Returns:
A pointer to the configured link, or NULL if an error occured.

References SST::Component::configureSelfLink().

virtual void SST::SubComponent::finish (  )  [inline, virtual]

Called after simulation completes, but before objects are destroyed.

A good place to print out statistics.

Reimplemented in SST::Interfaces::SimpleNetwork.

SimTime_t SST::SubComponent::getCurrentSimTime ( std::string  base  )  [protected]

return the time since the simulation began in timebase specified

Parameters:
base Timebase frequency in SI Units

References getCurrentSimTime(), and SST::Simulation::getSimulation().

SimTime_t SST::SubComponent::getCurrentSimTime ( TimeConverter tc  )  const [protected]

return the time since the simulation began in units specified by the parameter.

Parameters:
tc TimeConverter specificing the units

References SST::TimeConverter::convertFromCoreTime(), and SST::Simulation::getSimulation().

Referenced by getCurrentSimTime(), getCurrentSimTimeMicro(), getCurrentSimTimeMilli(), and getCurrentSimTimeNano().

virtual void SST::SubComponent::init ( unsigned int  phase  )  [inline, virtual]

Used during the init phase.

The method will be called each phase of initialization. Initialization ends when no components have sent any data.

Reimplemented in SST::Interfaces::SimpleNetwork.

TimeConverter * SST::SubComponent::registerClock ( std::string  freq,
Clock::HandlerBase handler 
) [protected]

Registers a clock for this component.

Parameters:
freq Frequency for the clock in SI units
handler Pointer to Clock::HandlerBase which is to be invoked at the specified interval NOTE: Unlike Components, SubComponents do not have a default timebase

References SST::Component::registerClock().

Cycle_t SST::SubComponent::reregisterClock ( TimeConverter freq,
Clock::HandlerBase handler 
) [protected]

Reactivates an existing Clock and Handler.

Returns:
time of next time clock handler will fire

References SST::Component::reregisterClock().

virtual void SST::SubComponent::setup (  )  [inline, virtual]

Called after all components have been constructed and inialization has completed, but before simulation time has begun.

Reimplemented in SST::Interfaces::SimpleNetwork.


Friends And Related Function Documentation

friend class Component [friend]

Component's type, set by the factory when the object is created.

It is identical to the configuration string used to create the component. I.e. the XML "<component id="aFoo"><foo>..." would set component::type to "foo"


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

Generated on 14 Sep 2015 for SST by  doxygen 1.6.1