SubComponent is a class loadable through the factory which allows dynamic functionality to be added to a Component. More...
#include <subcomponent.h>
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 | |
Link * | configureLink (std::string name, TimeConverter *time_base, Event::HandlerBase *handler=NULL) |
Configure a Link. | |
Link * | configureLink (std::string name, std::string time_base, Event::HandlerBase *handler=NULL) |
Configure a Link. | |
Link * | configureLink (std::string name, Event::HandlerBase *handler=NULL) |
Configure a Link. | |
Link * | configureSelfLink (std::string name, TimeConverter *time_base, Event::HandlerBase *handler=NULL) |
Configure a SelfLink (Loopback link). | |
Link * | configureSelfLink (std::string name, std::string time_base, Event::HandlerBase *handler=NULL) |
Configure a SelfLink (Loopback link). | |
Link * | configureSelfLink (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="") |
TimeConverter * | registerClock (std::string freq, Clock::HandlerBase *handler) |
Registers a clock for this component. | |
TimeConverter * | registerClock (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. | |
TimeConverter * | getTimeConverter (const std::string &base) |
TimeConverter * | getTimeConverter (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. | |
Module * | loadModule (std::string type, Params ¶ms) |
Module * | loadModuleWithComponent (std::string type, Params ¶ms) |
SubComponent * | loadSubComponent (std::string type, Params ¶ms) |
SharedRegion * | getLocalSharedRegion (const std::string &key, size_t size) |
Find a lookup table. | |
SharedRegion * | getGlobalSharedRegion (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. |
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.
Link * SST::SubComponent::configureLink | ( | std::string | name, | |
Event::HandlerBase * | handler = NULL | |||
) | [protected] |
Configure a Link.
name | - Port Name on which the link to configure is attached. | |
handler | - Optional Handler to be called when an Event is received |
References SST::Component::configureLink().
Link * SST::SubComponent::configureLink | ( | std::string | name, | |
std::string | time_base, | |||
Event::HandlerBase * | handler = NULL | |||
) | [protected] |
Configure a Link.
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 |
References configureLink(), and SST::Simulation::getSimulation().
Link * SST::SubComponent::configureLink | ( | std::string | name, | |
TimeConverter * | time_base, | |||
Event::HandlerBase * | handler = NULL | |||
) | [protected] |
Configure a Link.
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 |
References SST::Component::configureLink().
Referenced by configureLink().
Link * SST::SubComponent::configureSelfLink | ( | std::string | name, | |
Event::HandlerBase * | handler = NULL | |||
) | [protected] |
Configure a SelfLink (Loopback link).
name | - Name of the self-link port | |
handler | - Optional Handler to be called when an Event is received |
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).
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 |
References SST::Component::configureSelfLink().
Link * SST::SubComponent::configureSelfLink | ( | std::string | name, | |
TimeConverter * | time_base, | |||
Event::HandlerBase * | handler = NULL | |||
) | [protected] |
Configure a SelfLink (Loopback link).
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 |
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
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.
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.
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.
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.
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"