blockfactory  0.8
A framework for wrapping algorithms for dataflow programming
Port.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * GNU Lesser General Public License v2.1 or any later version.
7  */
8 
9 #ifndef BLOCKFACTORY_CORE_PORT_H
10 #define BLOCKFACTORY_CORE_PORT_H
11 
12 #include <cstddef>
13 #include <vector>
14 
15 namespace blockfactory {
16  namespace core {
17  class Port;
18  } // namespace core
19 } // namespace blockfactory
20 
34 {
35 public:
36  virtual ~Port() = 0;
37 
39  using Index = size_t;
40 
43  using Dimensions = std::vector<int>;
44 
49  static const int DynamicSize = -1;
50 
62  enum class DataType
63  {
64  DOUBLE,
65  SINGLE,
66  INT8,
67  UINT8,
68  INT16,
69  UINT16,
70  INT32,
71  UINT32,
72  BOOLEAN,
73  };
74 
78  struct Info
79  {
82 
86 
91  };
92 
96  struct Size
97  {
98  using Vector = int;
99 
100  using Rows = int;
101  using Cols = int;
102  using Matrix = struct
103  {
104  Rows rows;
106  };
107  };
108 };
109 
110 #endif // BLOCKFACTORY_CORE_PORT_H
Contained of size-related properties of ports.
Definition: Port.h:96
int Rows
Definition: Port.h:100
static const int DynamicSize
Identifier of a port with dynamic size.
Definition: Port.h:49
size_t Index
The 0-based index of a port.
Definition: Port.h:39
std::vector< int > Dimensions
Definition: Port.h:43
int Cols
Definition: Port.h:101
DataType dataType
Definition: Port.h:90
Definition: Block.h:17
A container of port information.
Definition: Port.h:78
Cols cols
Definition: Port.h:105
Class that stores port properties.
Definition: Port.h:33
int Vector
Definition: Port.h:98
DataType
Defines allowed port data types.
Definition: Port.h:62
struct{Rows rows Matrix
Definition: Port.h:104
Index index
The 0-based index of a port.
Definition: Port.h:81
Dimensions dimension
Definition: Port.h:85