Atoms Crowd  7.0.0
Port.impl.h
1 namespace AtomsGraph
2 {
3  const std::vector<Port*>& Port::getConnections() const
4  {
5  return m_vConnections;
6  }
7 
8  std::vector<Port*>& Port::getConnections()
9  {
10  return m_vConnections;
11  }
12 
13  Port* Port::input() const
14  {
15  if (isInput() && numConnections() > 0)
16  return *m_vConnections.begin();
17  return nullptr;
18  }
19 
20  Port::port_iterator Port::begin()
21  {
22  return m_vConnections.begin();
23  }
24 
25  Port::port_iterator Port::end()
26  {
27  return m_vConnections.end();
28  }
29 
30  Port::const_port_iterator Port::cbegin() const
31  {
32  return m_vConnections.cbegin();
33  }
34 
35  Port::const_port_iterator Port::cend() const
36  {
37  return m_vConnections.cend();
38  }
39 
40  std::string Port::name() const
41  {
42  return m_sName;
43  }
44 
45  void Port::setNode(Node* node)
46  {
47  m_node = node;
48  }
49 
51  {
52  return m_node;
53  }
54 
55  size_t Port::numConnections() const
56  {
57  return m_vConnections.size();
58  }
59 
60  bool Port::isInput() const
61  {
62  return m_bIsInput;
63  }
64 
65  bool Port::isOutput() const
66  {
67  return !m_bIsInput;
68  }
69 
70  void Port::setAsInput(bool value)
71  {
72  m_bIsInput = value;
73  }
74 
75 }
Definition: Node.h:31
BasePort class.
Definition: Port.h:26
const_port_iterator cend() const
end const iterator to the connections vector
Definition: Port.impl.h:35
const std::vector< Port * > & getConnections() const
Gets all the connections.
Definition: Port.impl.h:3
const_port_iterator cbegin() const
begin const iterator to the connections vector
Definition: Port.impl.h:30
size_t numConnections() const
Gets the number of connections.
Definition: Port.impl.h:55
Node * node()
Get the parent node.
Definition: Port.impl.h:50
void setNode(Node *node)
Sets the parent node.
Definition: Port.impl.h:45
port_iterator end()
end iterator to the connections vector
Definition: Port.impl.h:25
bool isInput() const
Input port.
Definition: Port.impl.h:60
void setAsInput(bool value)
set the port as input
Definition: Port.impl.h:70
Port * input() const
Gets the input ports.
Definition: Port.impl.h:13
port_iterator begin()
begin iterator to the connections vector
Definition: Port.impl.h:20
std::string name() const
Gets the port name.
Definition: Port.impl.h:40
bool isOutput() const
Output port.
Definition: Port.impl.h:65
AtomsGraph namespace.
Definition: PosePort.h:15