Skip to content

Commit

Permalink
Shared/Sink/Source: remove operator overloaded API (#71)
Browse files Browse the repository at this point in the history
No more assignment operator, type operator.

This leads to less confusion as discussed in #67.
  • Loading branch information
aentinger committed Jun 28, 2022
1 parent 3be602b commit c6db209
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
15 changes: 0 additions & 15 deletions src/threading/Shared.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ class Shared
void push(T const & val);
inline T peek() const { return _val; }

operator T() [[deprecated("Use 'pop()' instead.")]];
void operator = (T const & val) [[deprecated("Use 'push()' instead.")]];

private:

T _val;
Expand Down Expand Up @@ -94,16 +91,4 @@ void Shared<T,QUEUE_SIZE>::push(T const & val)
}
}

template<class T, size_t QUEUE_SIZE>
Shared<T,QUEUE_SIZE>::operator T()
{
return pop();
}

template<class T, size_t QUEUE_SIZE>
void Shared<T,QUEUE_SIZE>::operator = (T const & val)
{
push(val);
}

#endif /* ARDUINO_THREADS_SHARED_HPP_ */
5 changes: 0 additions & 5 deletions src/threading/Sink.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ class SinkBase

virtual T pop() = 0;
virtual void inject(T const & value) = 0;

inline operator T() [[deprecated("Use 'pop()' instead.")]]
{
return pop();
}
};

template<typename T>
Expand Down
8 changes: 0 additions & 8 deletions src/threading/Source.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ class Source
void connectTo(SinkBase<T> & sink);
void push(T const & val);

void operator = (T const & val) [[deprecated("Use 'push()' instead.")]];

private:
std::list<SinkBase<T> *> _sink_list;
};
Expand All @@ -72,10 +70,4 @@ void Source<T>::push(T const & val)
});
}

template<typename T>
void Source<T>::operator = (T const & val)
{
push(val);
}

#endif /* ARDUINO_THREADS_SOURCE_HPP_ */

0 comments on commit c6db209

Please sign in to comment.