File: setup.hpp

package info (click to toggle)
lager 0.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,904 kB
  • sloc: cpp: 10,868; javascript: 10,433; makefile: 214; python: 100; sh: 98
file content (32 lines) | stat: -rw-r--r-- 562 bytes parent folder | download | duplicates (2)
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
27
28
29
30
31
32
#pragma once

#include <lager/extra/struct.hpp>

#include <lager/store.hpp>
#include <lager/event_loop/manual.hpp>

#include <variant>
#include <string>

struct Foo
{
    int b{1};
    LAGER_STRUCT_NESTED(Foo, b);
};
struct Model
{
    int a{0};
    Foo foo{};
    LAGER_STRUCT_NESTED(Model, a);
};
struct ModelAction
{
    LAGER_STRUCT_NESTED(ModelAction);
};

using Action = std::variant<ModelAction>;
Model update(Model m, Action a) { return m; }

auto make_dummy_store() {
  return lager::make_store<ModelAction>(Model{}, lager::with_manual_event_loop{});
}