📄 object.h
字号:
//
// INTEL CORPORATION PROPRIETARY INFORMATION
// This software is supplied under the terms of a license agreement or
// nondisclosure agreement with Intel Corporation and may not be copied
// or disclosed except in accordance with the terms of that agreement.
// Copyright (c) 2005-2006 Intel Corporation. All Rights Reserved.
//
#ifndef __OBJECT_H
#define __OBJECT_H
#include "vm_strings.h"
#include "vm_shared_object.h"
class Object
{
public:
Object* m_pnext;
// Object* m_pprev;
public:
virtual ~Object(void) = 0;
virtual void* Create() = 0;
virtual void Destroy(void*) = 0;
virtual vm_char* GetName() = 0;
virtual vm_char* GetVersion() = 0;
virtual int Try(void*) = 0; /* <0 - not implemented,
=0 - not supported,
>0 - supported */
virtual vm_char* GetObjectType(void) = 0;
// static vm_char* GetStaticObjectType(void);
};
struct ObjectsList
{
Object* p_begin;
ObjectsList* p_next;
vm_so_handle handle;
static ObjectsList* Load(vm_char*, vm_char* = NULL);
static bool Free(ObjectsList*);
};
bool ObjectReg(Object*);
extern ObjectsList g_static_objects_list;
#define OBJECT_TYPE_DECL()\
public:\
static vm_char* m_object_type;\
virtual vm_char* GetObjectType();\
static vm_char* GetStaticObjectType();
#define OBJECT_TYPE_IMPL(class_name)\
vm_char* class_name::m_object_type = VM_STRING(#class_name);\
vm_char* class_name::GetObjectType(){ return m_object_type;}\
vm_char* class_name::GetStaticObjectType(){ return m_object_type;}
bool ObjectTypeCheck(Object* p_object);
template <class T>
bool ObjectTypeCheck(T* p_object)
{
return !vm_string_strcmp(T::GetStaticObjectType(),p_object->GetObjectType());
}
#endif//__OBJECT_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -