gsiaddclass function

Internal function: give a derived subclass to an object