Queues in systemverilog

How to call the elements of a queue which in one class from some other class?
Actually I am generating randomized values in a class and passing those values to another class and storing them in a queue.I want to access those values in the queue from another class and drive them.
how to do this by using task /function?

Please suggest

In reply to techie:

This is best done by wrapping the queue in a class and sharing a handle to class object from both the generator and driver classes. This is typically called the Producer/Consumer pattern.

Many people use the SystemVerilog mailbox class for this. Search for examples.

In reply to dave_59:

I have tried using mailboxes and I could do it.

But while using queue I am facing problems.could you please show me the way to do it.

please suggest

In reply to techie:

Can you show what you tried and what problem you have?