Exemple #1
0
        /// <summary>
        /// This method harmonizeds the indices of all contained event classes.
        /// Indices are re-assigned according to the natural order of class
        /// identities, i.e., the alphabetical order of class identity strings.This
        /// method should be called after the composition or derivation of event
        /// classes is complete, e.g., after scanning a log for generating the log
        /// info. Using parties should not have to worry about event class
        /// harmonization, and can thus safely ignore this method.
        /// </summary>
        public void HarmonizeIndexes()
        {
            lock (Lock)
            {
                List <XEventClass> classList = this.classMap.Values.ToList();
                classList.Sort();

                this.classMap.Clear();
                for (int i = 0; i < classList.Count(); ++i)
                {
                    XEventClass original   = classList[i];
                    XEventClass harmonized = new XEventClass(original.Id, i);
                    harmonized.Size = original.Size;
                    this.classMap.Add(harmonized.Id, harmonized);
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Registers an event class with this set of event classes. This will potentially
 /// add a new event class to this set of event classes.An event class will
 /// be incremented in size, if the given event is found to be a member of it.
 /// </summary>
 /// <param name="classId"> The event class id to be analyzed.</param>
 public void Register(string classId)
 {
     lock (Lock)
     {
         XEventClass eventClass;
         if (classId != null && this.classMap.ContainsKey(classId))
         {
             eventClass = this.classMap[classId];
             eventClass.IncrementSize();
         }
         else
         {
             eventClass = new XEventClass(classId, this.classMap.Count);
             this.classMap.Add(classId, eventClass);
         }
     }
 }