Falcon
Loading...
Searching...
No Matches

Public Member Functions

 IProcessor (ThreadPriority priority=PRIORITY_HIGH)
void record_metrics (uint64_t sync, uint64_t work) noexcept
void dump_benchmarks ()
const std::string name () const
const std::string type () const
unsigned int n_input_ports () const
unsigned int n_output_ports () const
const std::set< std::string > input_port_names () const
const std::set< std::string > output_port_names () const
bool has_input_port (const std::string &port)
bool has_output_port (const std::string &port)
virtual bool issource () const
virtual bool issink () const
virtual bool isfilter () const
virtual bool isautonomous () const
ThreadPriority thread_priority () const
ThreadCore thread_core () const
bool running () const
YAML::Node ExportYAML ()
void checkNonvoluntaryContextSwitches ()

Static Public Attributes

static std::vector< TimingEntry > * t_metrics = nullptr
static constexpr size_t MAX_SAMPLES = 100000

Protected Member Functions

void create_file (const std::string &prefix, const std::string &variable_name, const std::string &extension="bin")
void prepare_latency_test (ProcessingContext &context)
void save_source_timestamps_to_disk (std::uint64_t n_timestamps)
template<typename TValue>
void add_option (std::string name, TValue &value, std::string description="", bool required=false)
void remove_option (const std::string &name)
template<typename DATATYPE>
PortOut< DATATYPE > * create_output_port (std::string name, const typename DATATYPE::Parameters &parameters, const PortOutPolicy &policy)
template<typename DATATYPE>
PortOut< DATATYPE > * create_output_port (const typename DATATYPE::Parameters &parameters, const PortOutPolicy &policy)
template<typename DATATYPE>
PortIn< DATATYPE > * create_input_port (std::string name, const typename DATATYPE::Capabilities &capabilities, const PortInPolicy &policy)
template<typename DATATYPE>
PortIn< DATATYPE > * create_input_port (const typename DATATYPE::Capabilities &capabilities, const PortInPolicy &policy)
IPortIn * input_port (const std::string &port)
IPortOut * output_port (const std::string &port)
IPortIn * input_port (const PortAddress &address)
IPortOut * output_port (const PortAddress &address)
ISlotIn * input_slot (const SlotAddress &address)
ISlotOut * output_slot (const SlotAddress &address)
template<typename T>
StaticState< T > * create_static_state (std::string state, T default_value, bool shared=true, Permission external=Permission::WRITE, std::string description="")
template<typename T>
ProducerState< T > * create_producer_state (std::string state, T default_value, bool cooperative=false, Permission external=Permission::READ, std::string description="")
template<typename T>
BroadcasterState< T > * create_broadcaster_state (std::string state, T default_value, Permission external=Permission::NONE, std::string description="")
template<typename T>
FollowerState< T > * create_follower_state (std::string state, T default_value, Permission external=Permission::NONE, std::string description="")
template<typename T>
ReadableState< T > * create_readable_shared_state (const std::string &state, T default_value, Permission peers=Permission::WRITE, Permission external=Permission::NONE, std::string description="")
template<typename T>
WritableState< T > * create_writable_shared_state (const std::string &state, T default_value, Permission peers=Permission::READ, Permission external=Permission::NONE, std::string description="")
std::shared_ptr< IState > shared_state (const std::string &state)
template<class T>
void expose_method (const std::string &methodname, YAML::Node(T::*method)(const YAML::Node &))
std::function< YAML::Node(const YAML::Node &)> & exposed_method (const std::string &method)
virtual std::string default_input_port () const
virtual std::string default_output_port () const

Protected Attributes

std::map< std::string, std::shared_ptr< std::ostream > > streams_
std::vector< TimePoint > test_source_timestamps_
options::OptionList options_
options::OptionList advanced_options_

Friends

class ISlotIn
class graph::ProcessorGraph

Member Function Documentation

◆ add_option()

template<typename TValue>
void IProcessor::add_option ( std::string name,
TValue & value,
std::string description = "",
bool required = false )
inlineprotected

Add an option to the processor.

A static state can only be read by the owning processor. If shared is true, then the state can be read by other processors as well (if their states are connected). Otherwise, a non-shared static state is created that is not accessible from other processors. The main use of static states is to expose the state value to clients by setting the external permissions to Permission::READ or Permission::WRITE.

Template Parameters
TValueThe type of the option value.
Parameters
nameThe name of the option that is unique within the processor.
valueA reference to the linked Value object (should be derived from ValueBase).
descriptionA brief description of the option.
requiredMakes it a required option that clients need to specify in the graph definition

◆ create_broadcaster_state()

template<typename T>
BroadcasterState< T > * IProcessor::create_broadcaster_state ( std::string state,
T default_value,
Permission external = Permission::NONE,
std::string description = "" )
inlineprotected

Create a broadcaster state on the processor.

A broadcaster state can be written by the owning processor and can only be read by other processors (if their states are connected). If external permissions are set to Permission::READ or Permission::WRITE, then the state value can also accessed by clients.

Template Parameters
TThe type of the state value.
Parameters
stateThe name of the state that is unique within the processor.
default_valueThe initial value of the state.
externalThe external read/write permissions.
descriptionA brief description of the state's purpose.
Returns
An observing pointer to the broadcaster state.

◆ create_follower_state()

template<typename T>
FollowerState< T > * IProcessor::create_follower_state ( std::string state,
T default_value,
Permission external = Permission::NONE,
std::string description = "" )
inlineprotected

Create a follower state on the processor.

A follower state can only be read the owning processor and can be written to by other processors (if their states are connected). The initial value of the state is only used if the state is not connected to any other state. If external permissions are set to Permission::READ or Permission::WRITE, then the state value can also accessed by clients.

Template Parameters
TThe type of the state value.
Parameters
stateThe name of the state that is unique within the processor.
default_valueThe initial value of the state.
externalThe external read/write permissions.
descriptionA brief description of the state's purpose.
Returns
An observing pointer to the follower state.

◆ create_input_port() [1/2]

template<typename DATATYPE>
PortIn< DATATYPE > * IProcessor::create_input_port ( const typename DATATYPE::Capabilities & capabilities,
const PortInPolicy & policy )
inlineprotected

Create an input port on the processor.

The port name is set to the default data type name.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ create_input_port() [2/2]

template<typename DATATYPE>
PortIn< DATATYPE > * IProcessor::create_input_port ( std::string name,
const typename DATATYPE::Capabilities & capabilities,
const PortInPolicy & policy )
inlineprotected

Create an data input port on the processor.

Template Parameters
DATATYPEThe type of data that will be streamed through the port.
Parameters
capabilitiesThe data type specific capabilities of the port.
policyThe input port policy.
Returns
An observing pointer to the input port.

◆ create_output_port() [1/2]

template<typename DATATYPE>
PortOut< DATATYPE > * IProcessor::create_output_port ( const typename DATATYPE::Parameters & parameters,
const PortOutPolicy & policy )
inlineprotected

Create an output port on the processor.

The port name is set to the default data type name.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

◆ create_output_port() [2/2]

template<typename DATATYPE>
PortOut< DATATYPE > * IProcessor::create_output_port ( std::string name,
const typename DATATYPE::Parameters & parameters,
const PortOutPolicy & policy )
inlineprotected

Create an data output port on the processor.

Template Parameters
DATATYPEThe type of data that will be streamed through the port.
Parameters
parametersThe data type specific parameters of the port.
policyThe output port policy.
Returns
An observing pointer to the output port.

◆ create_producer_state()

template<typename T>
ProducerState< T > * IProcessor::create_producer_state ( std::string state,
T default_value,
bool cooperative = false,
Permission external = Permission::READ,
std::string description = "" )
inlineprotected

Create a producer state on the processor.

A producer state can be written by the owning processor. If cooperative is true, then the state can be written to by other processors as well (if their states are connected). Otherwise, an isolated producer is created that is not accessible from other processors. The main use of isolated producers is to expose the state value to clients by setting the external permissions to Permission::READ or Permission::WRITE.

Template Parameters
TThe type of the state value.
Parameters
stateThe name of the state that is unique within the processor.
default_valueThe initial value of the state.
cooperativeCreates a cooperative or isolated producer state.
externalThe external read/write permissions.
descriptionA brief description of the state's purpose.
Returns
An observing pointer to the producer state.

◆ create_readable_shared_state()

template<typename T>
ReadableState< T > * IProcessor::create_readable_shared_state ( const std::string & state,
T default_value,
Permission peers = Permission::WRITE,
Permission external = Permission::NONE,
std::string description = "" )
inlineprotected

Create a readable shared state on the processor.

A readable state can only be read the owning processor. Access permissions for other processors (if their states are linked) and clients can be set by the peers and external parameters.

Template Parameters
TThe type of the state value.
Parameters
stateThe name of the state that is unique within the processor.
default_valueThe initial value of the state.
peersThe state access permissions for other processors.
externalThe external read/write permissions.
descriptionA brief description of the state's purpose.
Returns
An observing pointer to the readable state.

◆ create_static_state()

template<typename T>
StaticState< T > * IProcessor::create_static_state ( std::string state,
T default_value,
bool shared = true,
Permission external = Permission::WRITE,
std::string description = "" )
inlineprotected

Create a static state on the processor.

A static state can only be read by the owning processor. If shared is true, then the state can be read by other processors as well (if their states are connected). Otherwise, a non-shared static state is created that is not accessible from other processors. The main use of static states is to expose the state value to clients by setting the external permissions to Permission::READ or Permission::WRITE.

Template Parameters
TThe type of the state value.
Parameters
stateThe name of the state that is unique within the processor.
default_valueThe initial value of the state.
cooperativeCreates a cooperative or isolated producer state.
externalThe external read/write permissions.
descriptionA brief description of the state's purpose.
Returns
An observing pointer to the static state.

◆ create_writable_shared_state()

template<typename T>
WritableState< T > * IProcessor::create_writable_shared_state ( const std::string & state,
T default_value,
Permission peers = Permission::READ,
Permission external = Permission::NONE,
std::string description = "" )
inlineprotected

Create a writable shared state on the processor.

A writable state can be written to by the owning processor. Access permissions for other processors (if their states are linked) and clients can be set by the peers and external parameters.

Template Parameters
TThe type of the state value.
Parameters
stateThe name of the state that is unique within the processor.
default_valueThe initial value of the state.
peersThe state access permissions for other processors.
externalThe external read/write permissions.
descriptionA brief description of the state's purpose.
Returns
An observing pointer to the writable state.

◆ has_input_port()

bool IProcessor::has_input_port ( const std::string & port)
inline

Check if input port with given name exists.

Parameters
portThe name of the port.

◆ has_output_port()

bool IProcessor::has_output_port ( const std::string & port)
inline

Check if output port with given name exists.

Parameters
portThe name of the port.

◆ input_port() [1/2]

IPortIn * IProcessor::input_port ( const PortAddress & address)
protected

Retrieve observing pointer to input port.

Parameters
portThe address of the input port.

◆ input_port() [2/2]

IPortIn * IProcessor::input_port ( const std::string & port)
inlineprotected

Retrieve observing pointer to input port.

Parameters
portThe name of the input port.

◆ input_port_names()

const std::set< std::string > IProcessor::input_port_names ( ) const

Get set of all input port names.

◆ input_slot()

ISlotIn * IProcessor::input_slot ( const SlotAddress & address)
protected

Retrieve observing pointer to input slot.

Parameters
portThe address of the input slot.

◆ n_input_ports()

unsigned int IProcessor::n_input_ports ( ) const
inline

Get number of input ports on the processor.

◆ n_output_ports()

unsigned int IProcessor::n_output_ports ( ) const
inline

Get number of output ports on the processor.

◆ name()

const std::string IProcessor::name ( ) const
inline

Get processor's name.

The processor's name is set during the graph build phase after construction.

◆ output_port() [1/2]

IPortOut * IProcessor::output_port ( const PortAddress & address)
protected

Retrieve observing pointer to output port.

Parameters
portThe address of the output port.

◆ output_port() [2/2]

IPortOut * IProcessor::output_port ( const std::string & port)
inlineprotected

Retrieve observing pointer to output port.

Parameters
portThe name of the output port.

◆ output_port_names()

const std::set< std::string > IProcessor::output_port_names ( ) const

Get set of all output port names.

◆ output_slot()

ISlotOut * IProcessor::output_slot ( const SlotAddress & address)
protected

Retrieve observing pointer to output slot.

Parameters
portThe address of the output slot.

◆ remove_option()

void IProcessor::remove_option ( const std::string & name)
protected

Remove an existing processor option.

Parameters
nameThe name of the existing option.

◆ shared_state()

std::shared_ptr< IState > IProcessor::shared_state ( const std::string & state)
inlineprotected

Retrieve a pointer to a state.

Parameters
stateThe name of the state.

◆ type()

const std::string IProcessor::type ( ) const
inline

Get processor's class name.

The processor's class name is set during the graph build phase after construction.


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