Atoms Crowd  7.0.0
Node.impl.h
1 // ===========================================================================
2 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
3 //
4 // Use of this software is subject to the terms of the Toolchefs license
5 // agreement provided at the time of installation or download, or which
6 // otherwise accompanies this software in either electronic or hard copy form.
7 // ===========================================================================
8 
9 namespace AtomsGraph
10 {
11  Node::port_iterator Node::inputPortBegin()
12  {
13  return m_vInputPorts.begin();
14  }
15 
16  Node::port_iterator Node::inputPortEnd()
17  {
18  return m_vInputPorts.end();
19  }
20 
21  Node::const_port_iterator Node::inputPortCBegin() const
22  {
23  return m_vInputPorts.cbegin();
24  }
25 
26  Node::const_port_iterator Node::inputPortCEnd() const
27  {
28  return m_vInputPorts.cend();
29  }
30 
31  Node::port_iterator Node::outputPortBegin()
32  {
33  return m_vOutputPorts.begin();
34  }
35 
36  Node::port_iterator Node::outputPortEnd()
37  {
38  return m_vOutputPorts.end();
39  }
40 
41  Node::const_port_iterator Node::outputPortCBegin() const
42  {
43  return m_vOutputPorts.cbegin();
44  }
45 
46  Node::const_port_iterator Node::outputPortCEnd() const
47  {
48  return m_vOutputPorts.cend();
49  }
50 
51  const std::string& Node::name() const
52  {
53  return m_sName;
54  }
55 
56  void Node::setName(const std::string& name)
57  {
58  m_sName = name;
59  }
60 
61  bool Node::isDirty() const
62  {
63  return m_isDirty;
64  }
65 
67  {
68  m_isDirty = true;
69  }
70 
71  size_t Node::numInputPorts() const
72  {
73  return m_vInputPorts.size();
74  }
75 
76  size_t Node::numOutputPorts() const
77  {
78  return m_vOutputPorts.size();
79  }
80 
81 
82 
83  template<class T>
84  T* Node::getInputPort(const std::string& name)
85  {
86  Port* port = getInputPort(name);
87  if (port && (port->typeStr() == T::staticTypeStr()))
88  return static_cast<T*>(port);
89  return nullptr;
90  }
91 
92  template<class T>
93  T* Node::getOutputPort(const std::string& name)
94  {
95  Port* port = getOutputPort(name);
96  if (port && (port->typeStr() == T::staticTypeStr()))
97  return static_cast<T*>(port);
98  return nullptr;
99  }
100 
102  void Node::setProfileTime(size_t value)
103  {
104  m_profileTime = value;
105  }
106 
108  size_t Node::profileTime() const
109  {
110  return m_profileTime;
111  }
112 }
const_port_iterator outputPortCBegin() const
Output port begin iterator.
Definition: Node.impl.h:41
const_port_iterator outputPortCEnd() const
Output port end iterator.
Definition: Node.impl.h:46
port_iterator inputPortEnd()
Inputs port end iterator.
Definition: Node.impl.h:16
T * getOutputPort(const std::string &name)
Gets the output port with the given name.
Definition: Node.impl.h:93
bool isDirty() const
Returns true if the node is dirty.
Definition: Node.impl.h:61
size_t numInputPorts() const
Gets number of input ports.
Definition: Node.impl.h:71
const std::string & name() const
Gets the node name.
Definition: Node.impl.h:51
port_iterator outputPortBegin()
Output port begin iterator.
Definition: Node.impl.h:31
void setName(const std::string &name)
Sets the node name.
Definition: Node.impl.h:56
const_port_iterator inputPortCBegin() const
Input port begin iterator.
Definition: Node.impl.h:21
port_iterator outputPortEnd()
Output port end iterator.
Definition: Node.impl.h:36
size_t numOutputPorts() const
Gets number of output ports.
Definition: Node.impl.h:76
const_port_iterator inputPortCEnd() const
Input port end iterator.
Definition: Node.impl.h:26
port_iterator inputPortBegin()
Inputs port begin iterator.
Definition: Node.impl.h:11
size_t profileTime() const
Get the profile time.
Definition: Node.impl.h:108
void setProfileTime(size_t value)
Set the profile time.
Definition: Node.impl.h:102
void setDirtyFlag()
This set node dirty without propagate the dirty to the connected nodes.
Definition: Node.impl.h:66
T * getInputPort(const std::string &name)
Gets input port.
Definition: Node.impl.h:84
BasePort class.
Definition: Port.h:26
virtual std::string typeStr() const
Class type string.
AtomsGraph namespace.
Definition: PosePort.h:15