use shareable::SharedI64;
use item_value::ItemValue;
use notify::Notify;
#[derive(Clone)]
pub struct I64Value
{
value : SharedI64
}
impl I64Value
{
pub fn new() -> I64Value
{
I64Value {
value : SharedI64::new(0)
}
}
pub fn get(&self) -> i64
{
self.value.get()
}
}
use std::fmt::{Debug, Display, Formatter, Error};
impl Debug for I64Value
{
fn fmt(
&self,
f : &mut Formatter
) -> Result<(), Error>
{
write!(f, "{:?}", self.get())
}
}
impl Display for I64Value
{
fn fmt(
&self,
f : &mut Formatter
) -> Result<(), Error>
{
write!(f, "{}", self.get())
}
}
impl Notify for I64Value
{
fn send(
&self,
value : &ItemValue
)
{
self.value.set(value.get_i64());
}
}