How to create a blocking call for our class?
I am trying to create a queue class, with a blocking call for read.
using a read() method or an overloaded >> extraction operator.
I would like my class to behave similar to cin, where it will
wait until there is something in the vector.
I am looking for a method that does not use an additional thread
for polling the vector (queue).
The ones populating this vector (sending signals to this class)
expects nothing more than a lightweight operation on this class
(like pushing a message to the vector)
In short, how to implement a blocking method, which will wait for
data and return with the data, until it encounters an EOF character
(or a terminating pattern string in the vector)
I tried looking out for tying streams to gether.. but nothing worked.
Any help would be appreciated.
Thanks in advance.
Thanks and Regards,