| 52 | |
| 53 | public: |
| 54 | GoModule(int id, const std::shared_ptr<SharedLibrary> &lib) |
| 55 | : id_(id), lib_(lib) { |
| 56 | process_func_ = lib->symbol<decltype(process_func_)>("ModuleProcess"); |
| 57 | init_func_ = lib->symbol<decltype(init_func_)>("ModuleInit"); |
| 58 | reset_func_ = lib->symbol<decltype(reset_func_)>("ModuleReset"); |
| 59 | close_func_ = lib->symbol<decltype(reset_func_)>("ModuleClose"); |
| 60 | module_info_func_ = |
| 61 | lib->symbol<decltype(module_info_func_)>("ModuleGetInfo"); |
| 62 | hungry_check_func_ = |
| 63 | lib->symbol<decltype(hungry_check_func_)>("ModuleNeedHungryCheck"); |
| 64 | is_hungry_func_ = |
| 65 | lib->symbol<decltype(is_hungry_func_)>("ModuleIsHungry"); |
| 66 | is_infinity_func_ = |
| 67 | lib->symbol<decltype(is_infinity_func_)>("ModuleIsInfinity"); |
| 68 | } |
| 69 | |
| 70 | ~GoModule() { close(); } |
| 71 | |