mirror of
https://github.com/tribufu/sdk-cpp
synced 2025-06-19 15:54:18 +00:00
Add libhv and test http client
This commit is contained in:
.gitignore
examples
include/tribufu
scripts
src
vendor
.gitkeep
cpp-httplib
include
libhv
LICENSE
include
hv
AsyncHttpClient.hBuffer.hChannel.hEvent.hEventLoop.hEventLoopThread.hEventLoopThreadPool.hHttpClient.hHttpContext.hHttpMessage.hHttpParser.hHttpResponseWriter.hHttpServer.hHttpService.hStatus.hTcpClient.hTcpServer.hThreadLocalStorage.hUdpClient.hUdpServer.hWebSocketChannel.hWebSocketClient.hWebSocketParser.hWebSocketServer.haxios.hbase64.hhasync.hhatomic.hhbase.hhbuf.hhconfig.hhdef.hhdir.hhendian.hherr.hhexport.hhfile.hhlog.hhloop.hhmain.hhmap.hhmath.hhmutex.hhobjectpool.hhpath.hhplatform.hhproc.hhscope.hhsocket.hhssl.hhstring.hhsysinfo.hhthread.hhthreadpool.hhtime.hhttp_content.hhttpdef.hhurl.hhv.hhversion.hifconfig.hiniparser.hjson.hppmd5.hnlog.hrequests.hsha1.hsingleton.hwsdef.h
lib
windows
nlohmann
56
vendor/libhv/include/hv/Status.h
vendored
Normal file
56
vendor/libhv/include/hv/Status.h
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
#ifndef HV_STATUS_HPP_
|
||||
#define HV_STATUS_HPP_
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace hv {
|
||||
|
||||
class Status {
|
||||
public:
|
||||
enum KStatus {
|
||||
kNull = 0,
|
||||
kInitializing = 1,
|
||||
kInitialized = 2,
|
||||
kStarting = 3,
|
||||
kStarted = 4,
|
||||
kRunning = 5,
|
||||
kPause = 6,
|
||||
kStopping = 7,
|
||||
kStopped = 8,
|
||||
kDestroyed = 9,
|
||||
};
|
||||
|
||||
Status() {
|
||||
status_ = kNull;
|
||||
}
|
||||
~Status() {
|
||||
status_ = kDestroyed;
|
||||
}
|
||||
|
||||
KStatus status() {
|
||||
return status_;
|
||||
}
|
||||
|
||||
void setStatus(KStatus status) {
|
||||
status_ = status;
|
||||
}
|
||||
|
||||
bool isRunning() {
|
||||
return status_ == kRunning;
|
||||
}
|
||||
|
||||
bool isPause() {
|
||||
return status_ == kPause;
|
||||
}
|
||||
|
||||
bool isStopped() {
|
||||
return status_ == kStopped;
|
||||
}
|
||||
|
||||
private:
|
||||
std::atomic<KStatus> status_;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // HV_STATUS_HPP_
|
Reference in New Issue
Block a user