Exemplo n.º 1
0
/*---------------------------------------------------------------------------*/
int AddAdaptedClass(ADAPT_TEMPLATES Templates,
                    ADAPT_CLASS Class,
                    CLASS_ID ClassId) {
/*
 **	Parameters:
 **		Templates	set of templates to add new class to
 **		Class		new class to add to templates
 **		ClassId		class id to associate with new class
 **	Globals: none
 **	Operation: This routine adds a new adapted class to an existing
 **		set of adapted templates.
 **	Return: The class index of the new class.
 **	Exceptions: none
 **	History: Thu Mar 14 13:06:09 1991, DSJ, Created.
 */
  INT_CLASS IntClass;
  CLASS_INDEX ClassIndex;

  assert (Templates != NULL);
  assert (Class != NULL);
  assert (LegalClassId (ClassId));
  assert (UnusedClassIdIn (Templates->Templates, ClassId));
  assert (Class->NumPermConfigs == 0);

  IntClass = NewIntClass (1, 1);
  ClassIndex = AddIntClass (Templates->Templates, ClassId, IntClass);

  assert (Templates->Class[ClassIndex] == NULL);

  Templates->Class[ClassIndex] = Class;

  return (ClassIndex);

}                                /* AddAdaptedClass */
Exemplo n.º 2
0
/**
 * This routine adds a new adapted class to an existing
 * set of adapted templates.
 *
 * @param Templates set of templates to add new class to
 * @param Class new class to add to templates
 * @param ClassId class id to associate with new class
 *
 * @note Globals: none
 * @note Exceptions: none
 * @note History: Thu Mar 14 13:06:09 1991, DSJ, Created.
 */
void AddAdaptedClass(ADAPT_TEMPLATES Templates,
                     ADAPT_CLASS Class,
                     CLASS_ID ClassId) {
  INT_CLASS IntClass;

  assert (Templates != NULL);
  assert (Class != NULL);
  assert (LegalClassId (ClassId));
  assert (UnusedClassIdIn (Templates->Templates, ClassId));
  assert (Class->NumPermConfigs == 0);

  IntClass = NewIntClass (1, 1);
  AddIntClass (Templates->Templates, ClassId, IntClass);

  assert (Templates->Class[ClassId] == NULL);
  Templates->Class[ClassId] = Class;

}                                /* AddAdaptedClass */