/*
 *  This file was generated by the SOM Compiler and Emitter Framework.
 *  Generated using:
 *      SOM Emitter emitctm: 2.7
 */

#define Dog_Class_Source
#include <dog.ih>

/*
 * The breed of this Dog.
 */

SOM_Scope void  SOMLINK dog__set_breed(Dog *somSelf, string myBreed)
{
    DogData *somThis = DogGetData(somSelf);
    DogMethodDebug("Dog","dog__set_breed");

    if (_breed)
        SOMFree (_breed);
    if (myBreed) {
        _breed = (string) SOMMalloc (strlen (myBreed) + 1);
        strcpy (_breed, myBreed);
    } else
        _breed = (string) NULL;

}

/*
 * The color of this Dog.
 */

SOM_Scope void  SOMLINK dog__set_color(Dog *somSelf, string myColor)
{
    DogData *somThis = DogGetData(somSelf);
    DogMethodDebug("Dog","dog__set_color");

    if (_color)
        SOMFree (_color);
    if (myColor) {
        _color = (string) SOMMalloc (strlen (myColor) + 1);
        strcpy (_color, myColor);
    } else
        _color = (string) NULL;

}

SOM_Scope string  SOMLINK dog__get_genus(Dog *somSelf)
{
    DogMethodDebug("Dog","dog__get_genus");

    return ("Canis");
}

SOM_Scope string  SOMLINK dog__get_species(Dog *somSelf)
{
    DogMethodDebug("Dog","dog__get_species");

    return ("Familiaris");
}

SOM_Scope void  SOMLINK dog_display(Dog *somSelf)
{
    DogMethodDebug("Dog","dog_display");

    Dog_parent_Animal_display(somSelf);
    somPrintf("It's breed is %s", __get_breed (somSelf));
    somPrintf(" and its color is %s.\n", __get_color (somSelf));
}

SOM_Scope void  SOMLINK dog_somInit(Dog *somSelf)
{
    DogData *somThis = DogGetData(somSelf);
    DogMethodDebug("Dog","dog_somInit");

    Dog_parent_Animal_somInit(somSelf);
    _color = (string) NULL;
    _breed = (string) NULL;
}

SOM_Scope void  SOMLINK dog_somUninit(Dog *somSelf)
{
    DogData *somThis = DogGetData(somSelf);
    DogMethodDebug("Dog","dog_somUninit");

    if (_color)
        SOMFree(_color);
    if (_breed)
        SOMFree(_breed);
    Dog_parent_Animal_somUninit(somSelf);
}

SOM_Scope void  SOMLINK dog_somDumpSelfInt(Dog *somSelf, long level)
{
    DogData *somThis = DogGetData(somSelf);
    DogMethodDebug("Dog","dog_somDumpSelfInt");

    Dog_parent_Animal_somDumpSelfInt(somSelf, level);
}
