- Algorithm
- Search——各种查找算法的实现,以及单元测试和基于google benchmark的性能测试;
- std_search_examples——Examples of search algorithms in stl;
- Sort——Implementation of various sorting algorithms, as well as unit testing and performance testing based on Google benchmark;
- std_sort_examples——Examples of sorting algorithms in stl;
- Search——各种查找算法的实现,以及单元测试和基于google benchmark的性能测试;
- BinaryTree——Binary tree related operations, including insertion, removal, search, and printing;
- Breakpad——Simple encapsulation of google breakpad;
- Exchange Order——Determine the byte order of the system;
- Client——A simple Linux select socket client;
- CountDownLatch——A simple countdown latch implemented using std::mutex and std::condition_variable (std::latch c++20);
- Crashpad——Simple encapsulation of google crashpad;
- Curl——Simple use of curl;
- TcpClient——Simple tcp client implemented using curl;
- HttpClient——Simple http synchronization client implemented using curl;
- HttpClientAsync——Simple http asynchronous client implemented using curl;
- Design patterns——Some examples of design patterns;
- Factory——Factory mode;
- MVC——mvc mode;
- Observer——Observer mode;
- Singleton——Single case mode;
- GlobMatch——Simple implementation of glob pattern matching;
- Hawthorn——Google glog example;
- Icmp——Simple encapsulation of linux icmp protocol;
- LinkedList——Related operations of linked lists, including insertion, removal, reversal, and printing;
- Memcpy——
memcpy
function implementation; - MonitorDir——windows(
ReadDirectoryChangesW
),macos(FSEvents
) and linux(fanotify
andinotify
) Simple example of directory monitoring;fanotify
used inglobal
mode, infanotify_mark
Join inFAN_MARK_FILESYSTEM
(needCAP_SYS_ADMIN
ability, that is, root permissions) thisflag
, all events on the specified file system will be monitored, and then the required events can be filtered according to the specified monitored folder directory. This function is better thaninotify
more powerful;- To obtain the upper-level path where the event file is located, use
open_by_handle_at
This method will appear under ordinary usersOperation not permitted
Error, also neededCAP_SYS_ADMIN
Ability, that is, root authority; - It is recommended to run with root privileges. If you must run it under an ordinary user, it is still recommended to use
inotify
instead offanotify
, anyway, opening a monitoring file descriptor (fd
), it is impossible to achievesubtree
monitor;
- To obtain the upper-level path where the event file is located, use
- MonitorDir_EFSW——A simple example of directory monitoring using efsw;
- Mutex——Simple mutex lock and spin lock implemented using std::atomic_flag;
- OpenSSL——Some examples of openssl;
- aes——AES encryption and decryption examples;
- base64——Examples of base64 encoding and decoding;
- hash——Example of sha256;
- hmac——Example of hmac;
- pem——Example of pem format;
- rsa——Examples of rsa encryption and decryption;
- sm4——Examples of sm4 encryption and decryption;
- Kskh09——Example of x509 certificate;
- bash——openssl command line example;
- SafeCallback——Implementation of life cycle safe callback function, referencemuduo WeakCallback;
- Server——Some examples of linux server;
- server_epoll——epoll example;
- server_poll——Poll example;
- server_select——Example of select;
- Thread——Thread class implemented based on std::thread, including thread pool;
- Thread——Thread class;
- ThreadPool——Thread pool;