1
This commit is contained in:
parent
7d222040b1
commit
07d53fe46e
@ -14,10 +14,11 @@ pub trait UserApp {
|
||||
|
||||
#[derive(SharedFromSelf)]
|
||||
pub struct App {
|
||||
_self_wp: Weak::<RefCell::<Self>>,
|
||||
zone_id: i32,
|
||||
node_id: i32,
|
||||
instance_id: i32,
|
||||
_self_wp: Weak::<RefCell::<Self>>,
|
||||
user_app: Option<Rc::<RefCell::<dyn UserApp>>>,
|
||||
}
|
||||
|
||||
impl App {
|
||||
@ -35,6 +36,7 @@ impl App {
|
||||
zone_id: 0,
|
||||
node_id: 0,
|
||||
instance_id: 0,
|
||||
user_app: None,
|
||||
_self_wp: Default::default(),
|
||||
}
|
||||
)));
|
||||
@ -46,11 +48,14 @@ impl App {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn init(&mut self) {
|
||||
pub fn init(&mut self, user_app: Rc::<RefCell::<dyn UserApp>>) {
|
||||
self.user_app = Some(user_app);
|
||||
crate::Timer::instance().borrow_mut().init();
|
||||
self.user_app.as_ref().unwrap().borrow_mut().init();
|
||||
}
|
||||
|
||||
pub fn uninit(&mut self) {
|
||||
self.user_app.as_ref().unwrap().borrow_mut().uninit();
|
||||
crate::Timer::instance().borrow_mut().uninit();
|
||||
}
|
||||
|
||||
@ -62,7 +67,7 @@ impl App {
|
||||
}
|
||||
|
||||
pub fn get_pkg_name(&self) -> String {
|
||||
return "".to_string();
|
||||
return self.user_app.as_ref().unwrap().borrow().get_pkg_name();
|
||||
}
|
||||
|
||||
pub fn new_uuid(&self) -> i64 {
|
||||
@ -85,4 +90,16 @@ impl App {
|
||||
return false;
|
||||
}
|
||||
|
||||
pub fn get_now_second(&self) -> i64 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub fn get_now_millis(&self) -> i64 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
pub fn get_time_offset(&self) -> i64 {
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user