/* This function will return the length of object list in object container. */
int rt_object_get_length(enum rt_object_class_type type)
/* This function will return the length of object list in object container. */
int rt_object_get_length(enum rt_object_class_type type)
{
    int count = 0;
    rt_ubase_t level;
    struct rt_list_node *node = RT_NULL;
    struct rt_object_information *information = RT_NULL;
    information = rt_object_get_information((enum rt_object_class_type)type);
    if (information == RT_NULL) return 0;
    level = rt_hw_interrupt_disable();
    rt_list_for_each(node, &(information->object_list))
    {
        count ++;
    }
    rt_hw_interrupt_enable(level);
    return count;
}