Hopsan
ComponentPowerAuthorFunctions

Functions

template<typename T >
T * getSafeConstantDataPtr (ComponentSystem *pSystem, Component *pComp, const HString &rConstantName)
 Help function to safely get the internal parameter data pointer from a subcomponent, the type needs to be known If parameter or component NULL, then error message instead of crash.
 
virtual bool preInitialize ()
 This function can be used to automate things prior to component initialization, only use this if you know what you are doing.
 

Variables

bool mWarnIfUnusedSystemParameters
 This bool can be toggled off in programmed subsystems to avoid annoying warnings.
 

Detailed Description

Function Documentation

◆ getSafeConstantDataPtr()

template<typename T >
T * getSafeConstantDataPtr ( ComponentSystem pSystem,
Component pComp,
const HString rConstantName 
)

Help function to safely get the internal parameter data pointer from a subcomponent, the type needs to be known If parameter or component NULL, then error message instead of crash.

Note
circumvents the ordinary parameter system, use only if you know what you are doing
It will only work for Constants not input/output variables (then you will get pointer to start value instead)
Returns
A pointer to the parameter or a dummy parameter (to avoid crash on further use)

◆ preInitialize()

bool preInitialize ( )
virtual

This function can be used to automate things prior to component initialization, only use this if you know what you are doing.

One example of what you can do, is reconnecting internal connections in programmed subsystems

Returns
True or False to signal success or failure

Reimplemented in ComponentSystem.