Add a static kType field to all objects

This commit is contained in:
Dr. Chat 2015-11-12 19:01:55 -06:00
parent b970b970f0
commit 7fc22f1987
9 changed files with 18 additions and 0 deletions

View File

@ -23,6 +23,8 @@ namespace kernel {
class NotifyListener : public XObject { class NotifyListener : public XObject {
public: public:
static const Type kType = kTypeNotifyListener;
explicit NotifyListener(KernelState* kernel_state); explicit NotifyListener(KernelState* kernel_state);
~NotifyListener() override; ~NotifyListener() override;

View File

@ -21,6 +21,8 @@ namespace kernel {
class XEnumerator : public XObject { class XEnumerator : public XObject {
public: public:
static const Type kType = kTypeEnumerator;
XEnumerator(KernelState* kernel_state, size_t item_capacity, XEnumerator(KernelState* kernel_state, size_t item_capacity,
size_t item_size); size_t item_size);
virtual ~XEnumerator(); virtual ~XEnumerator();

View File

@ -24,6 +24,8 @@ struct X_KEVENT {
class XEvent : public XObject { class XEvent : public XObject {
public: public:
static const Type kType = kTypeEvent;
explicit XEvent(KernelState* kernel_state); explicit XEvent(KernelState* kernel_state);
~XEvent() override; ~XEvent() override;

View File

@ -77,6 +77,8 @@ static_assert_size(X_FILE_DIRECTORY_INFORMATION, 72);
class XFile : public XObject { class XFile : public XObject {
public: public:
static const Type kType = kTypeFile;
~XFile() override; ~XFile() override;
vfs::Device* device() const { return entry_->device(); } vfs::Device* device() const { return entry_->device(); }

View File

@ -57,6 +57,8 @@ class XModule : public XObject {
kUserModule = 1, kUserModule = 1,
}; };
static const Type kType = kTypeModule;
XModule(KernelState* kernel_state, ModuleType module_type, XModule(KernelState* kernel_state, ModuleType module_type,
const std::string& path); const std::string& path);
virtual ~XModule(); virtual ~XModule();

View File

@ -19,6 +19,8 @@ namespace kernel {
class XMutant : public XObject { class XMutant : public XObject {
public: public:
static const Type kType = kTypeMutant;
explicit XMutant(KernelState* kernel_state); explicit XMutant(KernelState* kernel_state);
~XMutant() override; ~XMutant() override;

View File

@ -24,6 +24,8 @@ struct X_KSEMAPHORE {
class XSemaphore : public XObject { class XSemaphore : public XObject {
public: public:
static const Type kType = kTypeSemaphore;
explicit XSemaphore(KernelState* kernel_state); explicit XSemaphore(KernelState* kernel_state);
~XSemaphore() override; ~XSemaphore() override;

View File

@ -103,6 +103,8 @@ static_assert_size(X_KTHREAD, 0xAB0);
class XThread : public XObject { class XThread : public XObject {
public: public:
static const Type kType = kTypeThread;
struct CreationParams { struct CreationParams {
uint32_t stack_size; uint32_t stack_size;
uint32_t xapi_thread_startup; uint32_t xapi_thread_startup;

View File

@ -21,6 +21,8 @@ class XThread;
class XTimer : public XObject { class XTimer : public XObject {
public: public:
static const Type kType = kTypeTimer;
explicit XTimer(KernelState* kernel_state); explicit XTimer(KernelState* kernel_state);
~XTimer() override; ~XTimer() override;