Pothos  0.2.1-g9f04573d
The Pothos dataflow programming software suite
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros
BlockImpl.hpp
Go to the documentation of this file.
1 
11 #pragma once
15 
16 inline const Pothos::WorkInfo &Pothos::Block::workInfo(void) const
17 {
18  return _workInfo;
19 }
20 
21 inline Pothos::InputPort *Pothos::Block::input(const std::string &name) const
22 {
23  auto it = _namedInputs.find(name);
24  if (it == _namedInputs.end()) throw PortAccessError(
25  "Pothos::Block::input("+name+")", "input port name does not exist");
26  return it->second;
27 }
28 
29 inline Pothos::InputPort *Pothos::Block::input(const size_t index) const
30 {
31  if (index >= _indexedInputs.size()) throw PortAccessError(
32  "Pothos::Block::input("+std::to_string(index)+")", "input port index does not exist");
33  return _indexedInputs[index];
34 }
35 
36 inline Pothos::OutputPort *Pothos::Block::output(const std::string &name) const
37 {
38  auto it = _namedOutputs.find(name);
39  if (it == _namedOutputs.end()) throw PortAccessError(
40  "Pothos::Block::output("+name+")", "output port name does not exist");
41  return it->second;
42 }
43 
44 inline Pothos::OutputPort *Pothos::Block::output(const size_t index) const
45 {
46  if (index >= _indexedOutputs.size()) throw PortAccessError(
47  "Pothos::Block::output("+std::to_string(index)+")", "output port index does not exist");
48  return _indexedOutputs[index];
49 }
50 
51 inline const std::vector<Pothos::InputPort*> &Pothos::Block::inputs(void) const
52 {
53  return _indexedInputs;
54 }
55 
56 inline const std::vector<Pothos::OutputPort*> &Pothos::Block::outputs(void) const
57 {
58  return _indexedOutputs;
59 }
60 
61 inline const std::map<std::string, Pothos::InputPort*> &Pothos::Block::allInputs(void) const
62 {
63  return _namedInputs;
64 }
65 
66 inline const std::map<std::string, Pothos::OutputPort*> &Pothos::Block::allOutputs(void) const
67 {
68  return _namedOutputs;
69 }
Definition: WorkInfo.hpp:23
const std::vector< InputPort * > & inputs(void) const
Definition: BlockImpl.hpp:51
Definition: OutputPort.hpp:30
const WorkInfo & workInfo(void) const
Definition: BlockImpl.hpp:16
OutputPort * output(const std::string &name) const
Definition: BlockImpl.hpp:36
const std::map< std::string, InputPort * > & allInputs(void) const
Definition: BlockImpl.hpp:61
Definition: InputPort.hpp:30
InputPort * input(const std::string &name) const
Definition: BlockImpl.hpp:21
const std::vector< OutputPort * > & outputs(void) const
Definition: BlockImpl.hpp:56
const std::map< std::string, OutputPort * > & allOutputs(void) const
Definition: BlockImpl.hpp:66