mirror of
https://github.com/guilhermewerner/reflection
synced 2025-06-16 05:34:17 +00:00
Create initial reflection system
This commit is contained in:
27
Source/Object.rs
Normal file
27
Source/Object.rs
Normal file
@ -0,0 +1,27 @@
|
||||
use crate::{Class, Reflect};
|
||||
use anyhow::Result;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Object {
|
||||
inner: Arc<dyn Reflect>,
|
||||
}
|
||||
|
||||
impl Object {
|
||||
fn New(obj: impl Reflect) -> Self {
|
||||
Self {
|
||||
inner: Arc::new(obj),
|
||||
}
|
||||
}
|
||||
|
||||
fn InstanceOf(&self, class: &Class) -> bool {
|
||||
self.inner.as_ref().type_id() == class.GetId()
|
||||
}
|
||||
|
||||
fn GetClass(&self) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn GetProperty(&self) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user