#include "View.h"

View::View()
{
    ref = 1;
}

View::~View()
{}

View *View::getThis()
{
    ref++;
    return this;
}

View *View::release()
{
    if( !--ref )
        delete this;
    return 0;
}


ActionView::ActionView( std::function< void( Model * ) > f )
    : View()
{
    this->f = f;
}

void ActionView::update( Model *m )
{
    f( m );
}