ngscopeclient v0.2.2
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
FlowGraphNode Class Referenceabstract

Abstract base class for a node in the signal flow graph. More...

#include <FlowGraphNode.h>

Inheritance diagram for FlowGraphNode:
Inheritance graph
[legend]
Collaboration diagram for FlowGraphNode:
Collaboration graph
[legend]

Public Types

enum class  ExecutionCapabilities {
  None = 0 , CommandBufferAppend = 1 , CommandBufferTailCall = 2 , VulkanOnly = 4 ,
  DynamicShader = 8
}
 
typedef std::map< std::string, FilterParameterParameterMapType
 Short name for a map of strings to parameters.
 

Public Member Functions

void DetachInputs ()
 Disconnects all inputs from the node without releasing them.
 
size_t GetInputCount ()
 Get the number of input ports.
 
std::string GetInputName (size_t i)
 
void SetInput (size_t i, StreamDescriptor stream, bool force=false)
 Connects a stream to the input of this node.
 
void SetInput (const std::string &name, StreamDescriptor stream, bool force=false)
 
virtual bool ValidateChannel (size_t i, StreamDescriptor stream)
 Check if a stream is allowed to be connected to the given input.
 
bool HasInput (StreamDescriptor desc)
 Checks if the given stream is connected to at least one of our inputs.
 
StreamDescriptor GetInput (size_t i)
 Gets the descriptor for one of our inputs.
 
std::shared_ptr< InputConstraintGetInputConstraints (size_t i)
 Get the constraints on one of our inputs.
 
FilterParameterGetParameter (std::string s)
 
bool HasParameter (std::string s)
 Checks if we have a parameter with a given name.
 
ParameterMapType::iterator GetParamBegin ()
 Returns an iterator to the beginning of our parameter map.
 
ParameterMapType::iterator GetParamEnd ()
 Returns an iterator to the end of our parameter map.
 
size_t GetParamCount ()
 Returns the number of parameter we have.
 
virtual YAML::Node SerializeConfiguration (IDTable &table)
 Serializes this trigger's configuration to a YAML string.
 
virtual void LoadParameters (const YAML::Node &node, IDTable &table)
 Load configuration from a save file.
 
virtual void LoadInputs (const YAML::Node &node, IDTable &table)
 
bool IsDownstreamOf (std::set< FlowGraphNode * > nodes)
 Determines if this node is downstream of any of the specified other nodes.
 
virtual uint32_t GetExecutionCapabilitiesMask ()
 Returns a bitmask of ExecutionCapabilities fields.
 
virtual void Refresh (vk::raii::CommandBuffer &cmdBuf, std::shared_ptr< QueueHandle > queue)=0
 
bool HasMessages () const
 Checks if this graph has any messages.
 
const std::vector< FlowGraphNodeMessage > & GetMessages () const
 Walking through any messages.
 
const FlowGraphNodeMessageGetMostSevereMessage () const
 
void AddSink (size_t stream, FlowGraphNode *node)
 
void RemoveSink (size_t stream, FlowGraphNode *node)
 
const std::set< FlowGraphNode * > & GetSinks (size_t stream)
 
sigc::signal< void()> signal_parametersChanged ()
 
sigc::signal< void()> signal_inputsChanged ()
 

Protected Member Functions

virtual void OnInputChanged (size_t i)
 Called when a new input is connected to the node.
 
WaveformBaseGetInputWaveform (size_t i)
 Gets the waveform attached to the specified input.
 
SparseAnalogWaveformGetSparseAnalogInputWaveform (size_t i)
 Gets the analog waveform attached to the specified input.
 
UniformAnalogWaveformGetUniformAnalogInputWaveform (size_t i)
 Gets the analog waveform attached to the specified input.
 
SparseDigitalWaveformGetSparseDigitalInputWaveform (size_t i)
 Gets the digital waveform attached to the specified input.
 
UniformDigitalWaveformGetUniformDigitalInputWaveform (size_t i)
 Gets the digital waveform attached to the specified input.
 
virtual void CreateInput (const std::string &name)
 Gets the digital bus waveform attached to the specified input.
 
template<class T , class... Args>
void CreateInput (const std::string &name, Args &&... args)
 
std::string GetInputDisplayName (size_t i)
 Gets the display name for one of our inputs.
 
void ClearMessages ()
 Remove any messages left over from the last graph refresh.
 
void AddMessage (const FlowGraphNodeMessage &msg)
 Attach a new message to the node.
 
void AddMessage (Severity severity, const std::string &title, const std::string &message)
 Attach a new message to the node.
 
void AddErrorMessage (const std::string &err)
 Add a new error message.
 
void AddErrorMessage (const std::string &title, const std::string &err)
 Add a new error message with a title.
 

Protected Attributes

std::vector< std::shared_ptr< InputDescriptor > > m_inputs
 Input ports.
 
std::vector< std::set< FlowGraphNode * > > m_sinks
 The nodes (if any) that each of our streams drives.
 
ParameterMapType m_parameters
 
sigc::signal< void()> m_parametersChangedSignal
 Signal emitted when the set of parameters changes.
 
sigc::signal< void()> m_inputsChangedSignal
 Signal emitted when the set of inputs changes.
 
std::vector< FlowGraphNodeMessagem_messages
 

Detailed Description

Abstract base class for a node in the signal flow graph.

A FlowGraphNode has one or more channel inputs, zero or more configuration parameters.

Member Function Documentation

◆ AddErrorMessage()

void FlowGraphNode::AddErrorMessage ( const std::string &  title,
const std::string &  err 
)
inlineprotected

Add a new error message with a title.

The title replaces any previous title, if set

◆ CreateInput()

virtual void FlowGraphNode::CreateInput ( const std::string &  name)
protectedvirtual

Gets the digital bus waveform attached to the specified input.

Reimplemented in MeasurementsDialog, and WaveformArea.

◆ DetachInputs()

void FlowGraphNode::DetachInputs ( )

Disconnects all inputs from the node without releasing them.

This function is intended for use in Oscilloscope::~Oscilloscope() only. Using it carelessly is likely to lead to memory leaks.

◆ GetExecutionCapabilitiesMask()

virtual uint32_t FlowGraphNode::GetExecutionCapabilitiesMask ( )
inlinevirtual

◆ GetInputDisplayName()

string FlowGraphNode::GetInputDisplayName ( size_t  i)
protected

Gets the display name for one of our inputs.

This includes the stream name iff the input comes from a multi-stream source.

◆ GetInputWaveform()

WaveformBase * FlowGraphNode::GetInputWaveform ( size_t  i)
inlineprotected

Gets the waveform attached to the specified input.

This function is safe to call on a NULL input and will return NULL in that case.

This function is safe to call on a null input and will return null in that case.

Parameters
iInput index
Returns
Data from the channel if applicable, null if no data or no input connected

◆ HasParameter()

bool FlowGraphNode::HasParameter ( std::string  s)
inline

Checks if we have a parameter with a given name.

Parameters
sName of the parameter
Returns
True if found, false if not found

◆ IsDownstreamOf()

bool FlowGraphNode::IsDownstreamOf ( std::set< FlowGraphNode * >  nodes)

Determines if this node is downstream of any of the specified other nodes.

Returns true if any of this node's inputs, or their inputs, etc. eventually chain back to an element in the set.

◆ LoadParameters()

void FlowGraphNode::LoadParameters ( const YAML::Node &  node,
IDTable table 
)
virtual

Load configuration from a save file.

Reimplemented in Filter, PausableFilter, IBISDriverFilter, and ScalarStairstepFilter.

◆ OnInputChanged()

void FlowGraphNode::OnInputChanged ( size_t  i)
protectedvirtual

Called when a new input is connected to the node.

The default implementation does nothing, but some special cases may find this hook useful.

For example, instrument channels may make hardware changes as soon as a new input is connected.

Reimplemented in BufferedSwitchMatrixInputChannel, BufferedSwitchMatrixIOChannel, and BufferedSwitchMatrixOutputChannel.

◆ SerializeConfiguration()

YAML::Node FlowGraphNode::SerializeConfiguration ( IDTable table)
virtual

Serializes this trigger's configuration to a YAML string.

Returns
YAML block with this trigger's configuration

Reimplemented in Filter, Trigger, and WaveformArea.

◆ SetInput()

void FlowGraphNode::SetInput ( size_t  i,
StreamDescriptor  stream,
bool  force = false 
)

Connects a stream to the input of this node.

Parameters
iIndex of the input port to connect
streamInput data stream
forceForcibly connect this stream without checking to make sure it's the right type. Should only be set true by by Filter::LoadInputs() or in similar specialized situations.

◆ ValidateChannel()

bool FlowGraphNode::ValidateChannel ( size_t  i,
StreamDescriptor  stream 
)
virtual

Member Data Documentation

◆ m_sinks

std::vector< std::set<FlowGraphNode*> > FlowGraphNode::m_sinks
protected

The nodes (if any) that each of our streams drives.

m_sinks[i] is the set of sinks for output stream i


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