@@ -30,7 +30,7 @@ class RA_DATAFLOW_CORE_API PortBaseOut : public PortBase
3030 // / Get data stored at this outpute port
3131 // / Check if this port type it the same as T
3232 template <typename T>
33- const T& data ();
33+ T& data ();
3434
3535 // / Set port data pointer.
3636 // / Check if this port type it the same as T
@@ -49,7 +49,7 @@ class RA_DATAFLOW_CORE_API PortBaseOut : public PortBase
4949 --m_linkCount;
5050 CORE_ASSERT ( m_linkCount >= 0 , " link count error" );
5151 }
52- virtual int link_count () { return m_linkCount; }
52+ virtual int link_count () const { return m_linkCount; }
5353
5454 protected:
5555 // / Constructor.
@@ -95,10 +95,10 @@ class PortOut : public PortBaseOut
9595 // / @}
9696
9797 // / Gets a reference to the data this ports points to.
98- const T& data () { return *m_data; }
98+ T& data () { return *m_data; }
9999 // / Takes a pointer to the data this port will point to.
100100 // / @param data The pointer to the data.
101- void set_data ( const T* data ) { m_data = data; }
101+ void set_data ( T* data ) { m_data = data; }
102102 // / Returns true if the pointer to the data is not null.
103103 bool has_data () override { return ( m_data ); }
104104
@@ -107,7 +107,7 @@ class PortOut : public PortBaseOut
107107 *
108108 * Use raw ptr since data belongs to the node and can be plain stack variable
109109 */
110- const T* m_data { nullptr };
110+ T* m_data { nullptr };
111111
112112}; // class PortOut<T>
113113
@@ -120,7 +120,7 @@ using PortBaseOutRawPtr = PortRawPtr<PortBaseOut>;
120120using PortBaseOutPtr = PortPtr<PortBaseOut>;
121121
122122template <typename T>
123- const T& PortBaseOut::data () {
123+ T& PortBaseOut::data () {
124124 auto thisOut = dynamic_cast <PortOut<T>*>( this );
125125 if ( thisOut && thisOut->has_data () ) { return thisOut->data (); }
126126
0 commit comments