HELP in getting the name of the queue class as string
I have queue class as below
public class queue
{
public:
queue();
~queue();
bool Empty() const;
void Enqueue(message^);
void Dequeue();
void DisplayAll() const;
private:
gcroot<String^> bindingkey;
queue(queue const& obj);
ListNode* head;
ListNode* tail;
};
queue::queue():head(nullptr), tail(nullptr) {}
queue::~queue()
{
while (head != nullptr)
{
Dequeue();
}
}
//bool queue::Empty() const
//{
// return head == nullptr;
//}
//String^ queue::Next() const
//{
// return head->msg;
//}
void queue::Enqueue(message^ key)
{
if (head == nullptr)
{
head = tail = new ListNode(key);
}
else
{
tail->next = new ListNode(key);
tail = tail->next;
}
}
void queue::Dequeue()
{
ListNode* temp = head->next;
delete head;
head = temp;
}
void queue::DisplayAll() const
{
for (ListNode* p = head; p; p = p->next)
{
Console::WriteLine("the element is {0}", p->msg->routingk);
}
}
int main(array<System::String^> ^args)
{
//four queues are created and added to the list of the queues
queue *usa = new queue;
queue *weather = new queue;
queue *news = new queue;
queue *europe = new queue;
}
Can I have the name of the queue as STRING. PLEASE HELP.
SAM2012
Junior Poster in Training
63 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Thanks for reply, I want to store the name of the queue like usa, weather as strings.
Thanks for reply, I want to strore the name of the queue like usa, weather as strings.
SAM2012
Junior Poster in Training
63 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Yes Emil you are right that what I want. To programatically get the name of the pointer that points to a certain queue object and store it as string.How can I do this please help.
SAM2012
Junior Poster in Training
63 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Thanks for answer. Can you explain it with some coding please. What other ideas you think suit best with the situation.
SAM2012
Junior Poster in Training
63 posts since Feb 2012
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
Question Answered as of 1 Year Ago by
emilo35
and
Z33shan