diff --git a/a8/a8.h b/a8/a8.h index 40ec32e..d0a29ac 100644 --- a/a8/a8.h +++ b/a8/a8.h @@ -3,6 +3,7 @@ #include +#include #include #include #include @@ -13,6 +14,7 @@ #include #include +#include #include #include #include @@ -31,6 +33,14 @@ namespace std class condition_variable; }; +namespace google +{ + namespace protobuf + { + class Message; + } +} + #define NEW_NET #define A8_SAFE_DELETE(p) { if(p){delete(p); (p)=nullptr;} } #define A8_DEFINE_RANGE_BIT(type, begin, end) ((((type)1) << (end + 1)) - 1) & (~((((type)1) << (begin + 0)) - 1)) diff --git a/a8/args.h b/a8/args.h new file mode 100644 index 0000000..e6630ea --- /dev/null +++ b/a8/args.h @@ -0,0 +1,20 @@ +#ifndef A8_ARGS_H +#define A8_ARGS_H + +namespace a8 +{ + class Args + { + public: + + Args(std::vector args):args_(std::move(args)) {}; + + template + T Get(size_t index) const { return std::any_cast(args_.at(index));}; + + private: + std::vector args_; + }; +} + +#endif diff --git a/a8/types.h b/a8/types.h index 1122210..650cb81 100644 --- a/a8/types.h +++ b/a8/types.h @@ -14,6 +14,8 @@ namespace a8 SendQueueNode* next = nullptr; }; + typedef std::function CommonCbProc; + const int INVALID_FD = -1; const int INVALID_SOCKET = -1; const int INVALID_SOCKET_HANDLE = 0;