Beispiel #1
0
        public ListEntryClass MallocEntry(object object_val)
        {
            int id;
            int index;

            this.debugIt(true, "mallocEntry", "start");

            ListEntryClass entry = new ListEntryClass();

            this.abendListMgrClass("before MallocEntry");
            lock (this.theLock)
            {
                id    = this.allocId();
                index = this.allocIndex();
                if (index != -1)
                {
                    this.entryTableArray[index] = entry;
                }
                else
                {
                    this.abendIt("InsertEntry", "TBD");
                }
            }
            this.abendListMgrClass("after MallocEntry");

            entry.SetData(id, object_val, index);
            return(entry);
        }
Beispiel #2
0
 void FreeEntry(ListEntryClass entry_val)
 {
     this.abendListMgrClass("before FreeEntry");
     lock (this.theLock)
     {
         this.entryTableArray[entry_val.Index()] = null;
         this.entryCount--;
     }
     this.abendListMgrClass("after FreeEntry");
 }
Beispiel #3
0
        public ListEntryClass GetEntryByCompare(CompareStringFunc compare_func_val, string string_val)
        {
            ListEntryClass entry = null;

            this.abendListMgrClass("before GetEntryById");
            lock (this.theLock)
            {
                for (int i = 0; i <= maxIndex; i++)
                {
                    if (compare_func_val(entryTableArray[i].Data(), string_val))
                    {
                        entry = entryTableArray[i];
                        break;
                    }
                }
            }
            this.abendListMgrClass("after GetEntryById");

            return(entry);
        }
Beispiel #4
0
        public ListEntryClass GetEntryById(int id_val)
        {
            ListEntryClass entry = null;

            this.abendListMgrClass("before GetEntryById");
            lock (this.theLock)
            {
                for (int i = 0; i <= maxIndex; i++)
                {
                    if (entryTableArray[i].Id() == id_val)
                    {
                        entry = entryTableArray[i];
                        break;
                    }
                }
            }
            this.abendListMgrClass("after GetEntryById");

            return(entry);
        }