function.h 555 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // Created by Carl.Guo on 2025/4/17.
  3. //
  4. #ifndef PHPCPP_HELLOWORLD_FUNCTION_H
  5. #define PHPCPP_HELLOWORLD_FUNCTION_H
  6. #include <iostream>
  7. #include <utility>
  8. #include <phpcpp.h>
  9. #include "bpf_module.h"
  10. #include "BPF.h"
  11. class ProgFunc : public Php::Base {
  12. public:
  13. ebpf::BPF *bpf;
  14. std::string _name;
  15. int _fd;
  16. ProgFunc(ebpf::BPF *bpf_instance, std::string name, int fd)
  17. : bpf(bpf_instance), _name(std::move(name)), _fd(fd) {
  18. }
  19. virtual ~ProgFunc() = default;
  20. Php::Value __get(const Php::Value &name);
  21. };
  22. #endif //PHPCPP_HELLOWORLD_FUNCTION_H