11 #include "gu_lock.hpp"
13 #include "gu_buffer.hpp"
61 producer(msg.producer),
68 producer = msg.producer;
109 Cond& get_cond() {
return cond; }
166 virtual void notify() = 0;
virtual void notify()=0
Virtual method to notify consumer about queued message.
void send(const Message &msg, Message *ack)
Send message to the consumer and wait for response.
int get_val() const
Get int value associated to the message.
Definition: gu_prodcons.hpp:93
const Message * get_next_msg()
Get the first message from the message queue.
Definition: gu_mutex.hpp:19
Message class for Producer/Consumer communication.
Definition: gu_prodcons.hpp:37
Definition: gu_cond.hpp:19
Consumer()
Default constructor.
Consumer interface.
Definition: gu_prodcons.hpp:134
Producer(Consumer &cons_)
Consturctor.
Definition: gu_prodcons.hpp:117
Producer & get_producer() const
Get producer associated to the message.
Definition: gu_prodcons.hpp:79
virtual ~Consumer()
Default destructor.
const MessageData * get_data() const
Get data associated to the message.
Definition: gu_prodcons.hpp:86
Producer interface.
Definition: gu_prodcons.hpp:99
Message(Producer *prod_=0, const MessageData *data_=0, int val_=-1)
Constructor.
Definition: gu_prodcons.hpp:52
Definition: gu_prodcons.hpp:28
void queue_and_wait(const Message &msg, Message *ack)
Queue message and wait for ack.
void return_ack(const Message &msg)
Return ack message for the producer.