1#ifndef FHSIM_BASE_SIGNALBLOCK_H
2#define FHSIM_BASE_SIGNALBLOCK_H
4#include <fhsim/simobject/SimObject.h>
42 static int ReadCount(ISimObjectCreator* creator,
const std::string& name,
int defaultValue);
45 static int ReadCount(ISimObjectCreator* creator,
const std::string& name);
61 std::vector<double>
ReadScalarOrVector(ISimObjectCreator* creator,
const std::string& name,
double defaultValue)
const;
68 std::vector<double>
ReadScalarOrVector(ISimObjectCreator* creator,
const std::string& name)
const;
Definition SignalBlock.h:18
std::vector< double > m_out
The output buffer, PortWidth() elements. A block may resize it, for example to the width of an output...
Definition SignalBlock.h:71
std::vector< double > ReadScalarOrVector(ISimObjectCreator *creator, const std::string &name, double defaultValue) const
SignalBlock(const std::string &name, ISimObjectCreator *creator, PortWidthRule rule=PortWidthRule::DefaultOne)
static int ReadCount(ISimObjectCreator *creator, const std::string &name, int defaultValue)
PortWidthRule
Whether the parameter PortWidth must be in the input file.
Definition SignalBlock.h:22
@ DefaultOne
Not in the file: the width is 1.
@ Required
Not in the file: an error is reported.
int PortWidth() const
The number of elements in the signals of the block (the parameter PortWidth).
Definition SignalBlock.h:49
static int ReadCount(ISimObjectCreator *creator, const std::string &name)
As above for a count that must be in the file.
std::vector< double > ReadScalarOrVector(ISimObjectCreator *creator, const std::string &name) const