Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 1 | #include "aos/configuration.h" |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 2 | #include "aos/events/ping_generated.h" |
| 3 | #include "aos/events/pong_generated.h" |
| 4 | #include "aos/events/pong_lib.h" |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 5 | #include "aos/events/shm_event_loop.h" |
| 6 | #include "aos/init.h" |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 7 | #include "glog/logging.h" |
| 8 | |
Austin Schuh | 5d89cf5 | 2019-12-28 16:27:42 -0800 | [diff] [blame^] | 9 | DEFINE_string(config, "aos/events/pingpong_config.json", "Path to the config."); |
| 10 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 11 | int main(int argc, char **argv) { |
| 12 | FLAGS_logtostderr = true; |
| 13 | google::InitGoogleLogging(argv[0]); |
| 14 | ::gflags::ParseCommandLineFlags(&argc, &argv, true); |
| 15 | |
| 16 | aos::FlatbufferDetachedBuffer<aos::Configuration> config = |
Austin Schuh | 5d89cf5 | 2019-12-28 16:27:42 -0800 | [diff] [blame^] | 17 | aos::configuration::ReadConfig(FLAGS_config); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 18 | |
| 19 | ::aos::ShmEventLoop event_loop(&config.message()); |
| 20 | |
| 21 | aos::Pong ping(&event_loop); |
| 22 | |
| 23 | event_loop.Run(); |
| 24 | |
| 25 | ::aos::Cleanup(); |
| 26 | return 0; |
| 27 | } |