Solved

Giving a Queue a Unique Id and Name

Posted on 2006-06-12
4
214 Views
Last Modified: 2008-03-04
I am looking to give my Queues a unique Name (a String) and unique ID (an int or other number).. Is this possible as I would really like to track/manage my queues.
0
Comment
Question by:directxBOB
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:ciuly
ID: 16891991
you have a variaty of possibilities. for example, just incrementing a number will give a unique number and the limit is pretty high (for an long it 2^64-1)
for a name, you can also use the ID and maybe something like "Queue" + ID;
or if you want something unique accross machines, you can use GUID's
0
 

Author Comment

by:directxBOB
ID: 16898587
ok but if I have

Queue myQueue = new Queue();

how do I give it a unique ID?

for example if I am passing in a string for a hashtable ID how do I tack that string on so it becomes the unique ID for the
0
 

Author Comment

by:directxBOB
ID: 16898590
Queue
0
 
LVL 28

Accepted Solution

by:
ciuly earned 500 total points
ID: 16900247
you have at least 2 options, but none of it is ... perfect.
1) extend the Queue class and add the necessary fields.
2) use a hashtable or something like that in which you add either the ID or an object with the necessary fields

examples:
1)
class MyQueue : Queue{
  public int ID;
}
MyQueue q = new MyQueue();
q.ID = ID;
2) HashTable t;
t.Add(myQueue,ID);
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now