1
This commit is contained in:
parent
fdce7c9025
commit
358c62df57
10
a8/a8.h
10
a8/a8.h
@ -3,6 +3,7 @@
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <any>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
@ -13,6 +14,7 @@
|
||||
#include <functional>
|
||||
#include <initializer_list>
|
||||
|
||||
#include <a8/args.h>
|
||||
#include <a8/types.h>
|
||||
#include <a8/list.h>
|
||||
#include <a8/xvalue.h>
|
||||
@ -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))
|
||||
|
20
a8/args.h
Normal file
20
a8/args.h
Normal file
@ -0,0 +1,20 @@
|
||||
#ifndef A8_ARGS_H
|
||||
#define A8_ARGS_H
|
||||
|
||||
namespace a8
|
||||
{
|
||||
class Args
|
||||
{
|
||||
public:
|
||||
|
||||
Args(std::vector<std::any> args):args_(std::move(args)) {};
|
||||
|
||||
template <typename T>
|
||||
T Get(size_t index) const { return std::any_cast<T>(args_.at(index));};
|
||||
|
||||
private:
|
||||
std::vector<std::any> args_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
@ -14,6 +14,8 @@ namespace a8
|
||||
SendQueueNode* next = nullptr;
|
||||
};
|
||||
|
||||
typedef std::function<void(const a8::Args&)> CommonCbProc;
|
||||
|
||||
const int INVALID_FD = -1;
|
||||
const int INVALID_SOCKET = -1;
|
||||
const int INVALID_SOCKET_HANDLE = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user