Component

class Component : public vslib::NonCopyableNonMovable

Subclassed by vslib::LimitRange< double >, vslib::LookupTable< IndexType, IndexType >, vslib::AbcToAlphaBetaTransform, vslib::AbcToDq0Transform, vslib::AlphaBetaToAbcTransform, vslib::AlphaBetaToDq0Transform, vslib::ComponentArray< ComponentType, array_length >, vslib::CosLookupTable, vslib::Dq0ToAbcTransform, vslib::Dq0ToAlphaBetaTransform, vslib::Filter, vslib::FullBridge, vslib::HalfBridge, vslib::InstantaneousPowerThreePhase, vslib::LimitIntegral< T, time_window_length >, vslib::LimitRange< T >, vslib::LimitRate< T >, vslib::LimitRms, vslib::LookupTable< IndexType, StoredType >, vslib::PID, vslib::PIDClassic, vslib::RST< order >, vslib::RootComponent, vslib::SRFPLL, vslib::SinLookupTable, vslib::TwoLevelAFE

Public Functions

inline Component(std::string_view component_type, std::string_view name, Component &parent) noexcept

Creates the Component object with the provided type, name, and inside the hierarchy specified by parent.

Parameters:
  • component_type – Type of the Component

  • name – Name of the Component, needs to be unique in the type

  • parent – Possible parent of this Component, for the root Component should be nullptr

inline void addChild(Component &child) noexcept

Adds a child component to this component.

Parameters:

child – Child Component to be added to this component

inline std::string_view getName() const noexcept

Provides the name of this component.

Returns:

String_view of the component name

inline std::string_view getFullName() const noexcept

Provides the full name of this component.

Returns:

String_view of the component name

inline auto const &getChildren() const noexcept

Provides the container with all children belonging to this component.

Returns:

Vector with references to all children of this component

inline auto const &getParameters() const noexcept

Provides the map with all names and references to all parameters registered to this component.

Returns:

Map with names and references to all parameters of this component

inline void registerParameter(IParameter &parameter)

Registers the Parameter to this Component, adding it to the parameters vector and the registry.

Parameters:

parameter – Reference to the added Parameter

inline StaticJson serialize() const noexcept

Serializes this Component to JSON, including all children Components and Parameters across the entire hierarchy.

Returns:

Returns a fully-serialized Component as a JSON object

inline void flipBufferState() noexcept

Flips the buffer state of all Parameters registered with this component.

inline void synchroniseParameterBuffers() noexcept

Synchronises buffers for all Parameters registered with this component.

inline bool parametersInitialized() const noexcept

Returns the value of the flag informing whether the parameters of this component have been initialized

Returns:

True if all Parameters of this Component have been initialized, false otherwise

inline void setParametersValidated() noexcept

Sets the validation flag of owned Parameters to true when the validation has been successfully.

inline void revokeValidation() noexcept

Sets either the validation or the initialization flag of owned Parameters to false when the validation on the Component level has failed. If they were previously not successfully validated, the initialization flag is set to false. This is especially relevant during startup.

inline virtual std::optional<fgc4::utils::Warning> verifyParameters()

Verifies parameters after they are set, to be called after parameters of this component are modified. The checks need to run on the inactive buffer values.