Philipp Schrader | 790cb54 | 2023-07-05 21:06:52 -0700 | [diff] [blame] | 1 | #include "glog/logging.h" |
| 2 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 3 | #include "aos/configuration.h" |
Austin Schuh | 6b9c415 | 2019-11-29 12:45:24 -0800 | [diff] [blame] | 4 | #include "aos/events/ping_generated.h" |
| 5 | #include "aos/events/pong_generated.h" |
| 6 | #include "aos/events/pong_lib.h" |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 7 | #include "aos/events/shm_event_loop.h" |
| 8 | #include "aos/init.h" |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 9 | |
Austin Schuh | 67afe52 | 2022-09-16 15:41:52 -0700 | [diff] [blame] | 10 | DEFINE_string(config, "pingpong_config.json", "Path to the config."); |
Austin Schuh | 5d89cf5 | 2019-12-28 16:27:42 -0800 | [diff] [blame] | 11 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 12 | int main(int argc, char **argv) { |
Austin Schuh | bb08ad9 | 2020-12-08 20:16:40 -0800 | [diff] [blame] | 13 | aos::InitGoogle(&argc, &argv); |
James Kuszmaul | 762e869 | 2023-07-31 14:57:53 -0700 | [diff] [blame] | 14 | aos::EventLoop::SetDefaultVersionString("pong_version"); |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 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 | |
Alex Perry | cb7da4b | 2019-08-28 19:35:56 -0700 | [diff] [blame] | 25 | return 0; |
| 26 | } |