├── .gitignore
├── LICENSE
├── Makefile
├── README.md
├── client
├── php
│ └── client.php
└── python
│ ├── bench.py
│ └── client.py
├── config
├── main.ini
└── workflow.xml
├── engine
├── Context.h
├── Plugin.h
├── PluginHelper.cpp
├── PluginHelper.h
├── Work.cpp
├── Work.h
├── Workflow.cpp
└── Workflow.h
├── json
├── Json.cpp
├── Json.h
├── Parser.cpp
└── Parser.h
├── kill.sh
├── main.cpp
├── plugin
├── EchoPlugin.cpp
├── EchoPlugin.h
├── TestPlugin.cpp
├── TestPlugin.h
├── UserPlugin.cpp
└── UserPlugin.h
├── server
├── Server.cpp
└── Server.h
├── socket
├── ClientSocket.cpp
├── ClientSocket.h
├── EventPoller.cpp
├── EventPoller.h
├── ServerSocket.cpp
├── ServerSocket.h
├── Socket.cpp
├── Socket.h
├── SocketHandler.cpp
└── SocketHandler.h
├── task
├── EchoTask.cpp
├── EchoTask.h
├── PingTask.cpp
├── PingTask.h
├── TaskFactory.h
├── WorkTask.cpp
└── WorkTask.h
├── thread
├── AutoLock.cpp
├── AutoLock.h
├── Condition.cpp
├── Condition.h
├── Mutex.cpp
├── Mutex.h
├── Task.cpp
├── Task.h
├── TaskDispatcher.cpp
├── TaskDispatcher.h
├── Thread.cpp
├── Thread.h
├── ThreadPool.cpp
├── ThreadPool.h
├── WorkerThread.cpp
└── WorkerThread.h
├── utility
├── IniFile.cpp
├── IniFile.h
├── Logger.cpp
├── Logger.h
├── ObjectPool.h
├── Singleton.h
├── System.cpp
└── System.h
└── xml
├── Document.cpp
├── Document.h
├── Element.cpp
└── Element.h
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Log
5 | *.log
6 |
7 | # pyenv
8 | .idea/
9 |
10 | # vscode
11 | .vscode
12 |
13 | # Compiled Object files
14 | *.slo
15 | *.lo
16 | *.o
17 | *.obj
18 |
19 | # Precompiled Headers
20 | *.gch
21 | *.pch
22 |
23 | # Compiled Dynamic libraries
24 | *.so
25 | *.dylib
26 | *.dll
27 |
28 | # Fortran module files
29 | *.mod
30 | *.smod
31 |
32 | # Compiled Static libraries
33 | *.lai
34 | *.la
35 | *.a
36 | *.lib
37 |
38 | # Executables
39 | *.exe
40 | *.out
41 | *.app
42 | main
43 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 oldjun
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | #指定编译器
2 | CC = g++
3 |
4 | #找出当前目录下,所有的源文件(以.cpp结尾)
5 | SRCS := $(shell find ./* -type f | grep '\.cpp' | grep -v '\.svn' | grep -v '\./plugin' | grep -v '\./log' | grep -v 'main\.cpp')
6 | $(warning SRCS is ${SRCS})
7 |
8 | #确定cpp源文件对应的目标文件
9 | OBJS := $(patsubst %.cpp, %.o, $(filter %.cpp, $(SRCS)))
10 | $(warning OBJS is ${OBJS})
11 |
12 | #编译选项
13 | CFLAGS = -g -O2 -Wall -Werror -Wno-unused -ldl -fPIC
14 | $(warning CFLAGS is ${CFLAGS})
15 |
16 | #找出当前目录下所有头文件
17 | INCLUDE_TEMP = $(shell find ./* -type d | grep -v '\.svn' | grep -v '\./plugin' | grep -v '\./client' | grep -v '\./config' | grep -v '\./log')
18 | INCLUDE = $(patsubst %,-I %, $(INCLUDE_TEMP))
19 | $(warning INCLUDE is ${INCLUDE})
20 |
21 | LDFLAG = -lpthread -std=c++11
22 |
23 | #主程序
24 | SRC_MAIN = main.cpp
25 | OBJ_MAIN = ${SRC_MAIN:%.cpp=%.o}
26 | EXE_MAIN = main
27 |
28 | target: ${EXE_MAIN}
29 | $(EXE_MAIN): $(OBJ_MAIN) $(OBJS)
30 | $(CC) -o $@ $^ $(CFLAGS) $(INCLUDE) $(LDFLAG)
31 |
32 | %.o: %.cpp
33 | ${CC} ${CFLAGS} ${INCLUDE} -c $< -o $@
34 |
35 | # test 插件
36 | PULGIN_TEST = plugin/testplugin.so
37 | SRC_PLUGIN_TEST = plugin/TestPlugin.cpp json/Parser.cpp json/Json.cpp
38 |
39 | # user 插件
40 | PLUGIN_USER = plugin/userplugin.so
41 | SRC_PLUGIN_USER = plugin/UserPlugin.cpp json/Parser.cpp json/Json.cpp
42 |
43 | # echo 插件
44 | PLUGIN_ECHO = plugin/echoplugin.so
45 | SRC_PLUGIN_ECHO = plugin/EchoPlugin.cpp utility/Logger.cpp utility/System.cpp
46 |
47 | ${PULGIN_TEST}:
48 | ${CC} -shared -fPIC ${INCLUDE} ${SRC_PLUGIN_TEST} -o ${PULGIN_TEST}
49 |
50 | ${PLUGIN_USER}:
51 | ${CC} -shared -fPIC ${INCLUDE} ${SRC_PLUGIN_USER} -o ${PLUGIN_USER}
52 |
53 | ${PLUGIN_ECHO}:
54 | ${CC} -shared -fPIC ${INCLUDE} ${SRC_PLUGIN_ECHO} -o ${PLUGIN_ECHO}
55 |
56 | plugin: ${PULGIN_TEST} ${PLUGIN_USER} ${PLUGIN_ECHO}
57 |
58 | clean:
59 | rm -f ${OBJS} ${OBJ_MAIN} ${EXE_MAIN}
60 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # yazi
2 | c++ framework
3 |
--------------------------------------------------------------------------------
/client/php/client.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/engine/Context.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | using std::string;
4 |
5 | #include