/*
 * Go2Object.c
 * 
 * Gocator system communication library
 * Copyright (C) 2010 by LMI Technologies Inc.
 * 
 * Licensed under The MIT License.
 * Redistributions of files must retain the above copyright notice.
 */
#include <z/zGo2Object.h>

GO2_EXPORT(Go2Type) Go2Object_Type(Go2Object object)
{
    Go2ObjectClass* obj = zHANDLE_POINTER(object); 
    return obj->type; 
}

GO2_EXPORT(Go2Status) Go2Object_Destroy(Go2Object object)
{
    Go2ObjectClass* obj = zHANDLE_POINTER(object); 

    if (!zIS_NULL(obj))
    {
        zCHECK(obj->Release(obj)); 
        zCHECK(zFree(obj)); 
    }

    return zOK; 
}

GO2_EXPORT(Go2Type) Go2Object_Init(Go2Object object, Go2Type type)
{
    Go2ObjectClass* obj = zHANDLE_POINTER(object); 

    obj->Release = Go2Object_VRelease; 

    obj->type = type; 

    return zOK; 
}

GO2_EXPORT(Go2Status) Go2Object_VRelease(Go2Object object)
{
    return zOK; 
}
