neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
i_model.hpp
Go to the documentation of this file.
1// i_model.hpp
2/*
3neogfx C++ App/Game Engine
4Copyright (c) 2020 Leigh Johnston. All Rights Reserved.
5
6This program is free software: you can redistribute it and / or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
24
25namespace neogfx::mvc
26{
27 class i_controller;
28
29 class i_model
30 {
31 public:
32 declare_event(modified)
33 declare_event(controller_added, i_controller&)
34 declare_event(controller_removed, i_controller&)
35 public:
36 virtual ~i_model() = default;
37 public:
38 virtual bool dirty() const = 0;
39 virtual void set_dirty() = 0;
40 virtual void set_clean() = 0;
41 virtual void add_controller(i_controller& aController) = 0;
42 virtual void remove_controller(i_controller& aController) = 0;
43 };
44}
virtual bool dirty() const =0
virtual void set_dirty()=0
virtual void set_clean()=0
virtual void remove_controller(i_controller &aController)=0
virtual void add_controller(i_controller &aController)=0
declare_event(modified) declare_event(controller_added
#define declare_event(declName,...)
Definition i_event.hpp:305