summaryrefslogtreecommitdiff
path: root/project2/basics/views/viewGroup.cpp
blob: 591babd15091e6e686c049ab938c77381986eba3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include "view.h"
#include "presenter.h"

class ViewGroup : public View {
	public:
		ViewGroup(ScriptNodePtr s) :
			SourceObject(s),
			View(s)
		{
			s->script.lock()->loader.addLoadTarget(s, Storer::into<ViewFactory>(&subViews));
		}

		void execute(const MultiRowSetPresenter * presenter, ExecContext * ec) const
		{
			presenter->addNewRowSet(name);
			for (const SubViews::value_type & sq : subViews) {
				sq->execute(presenter, ec);
			}
			presenter->finishRowSet();
		}

		typedef ANONORDEREDSTORAGEOF(View) SubViews;
		SubViews subViews;
};

NAMEDFACTORY("viewgroup", ViewGroup, ViewFactory);