Skip to content

Latest commit

 

History

History
56 lines (53 loc) · 4.97 KB

README.en.md

File metadata and controls

56 lines (53 loc) · 4.97 KB

Cpp-Examples

Code structure

  1. Algorithm
    1. Search——Implementation of various search algorithms, as well as unit testing and performance testing based on Google benchmark;
      1. std_search_examples——Example of search algorithm in stl;
    2. Sort——Implementation of various sorting algorithms, as well as unit testing and performance testing based on Google benchmark;
      1. std_sort_examples——Example of sorting algorithm in stl;
  2. BinaryTree——Related operations of binary trees, insert, remove, find, and print;
  3. Breakpad——A simple package of google breakpad;
  4. Byte order——Judge the endianness of the system;
  5. Client——A simple Linux select socket client;
  6. CountDownLatch——Simple countdown latch (std::latch c++20) implemented using std::mutex and std::condition_variable;
  7. Crashpad——Simple encapsulation of google crashpad;
  8. Curl——Simple use of curl;
  9. TcpClient——Simple tcp client implemented using curl;
  10. HttpClient——Simple http synchronization client implemented using curl;
  11. HttpClientAsync——Simple http asynchronous client implemented using curl;
  12. Design pattern——Some examples of design patterns;
  13. Factory——Factory model;
  14. MVC——MVC mode;
  15. Observer——Observer mode;
  16. Singleton——Singleton mode;
  17. GlobMatch——Simple implementation of glob pattern matching;
  18. Hawthorn——Google glog example;
  19. Icmp——Simple encapsulation of linux icmp protocol;
  20. LinkedList——Related operations of linked lists, insert, remove, invert, and print;
  21. Memcpy——memcpyFunction implementation;
  22. Is a monitor——windows(ReadDirectoryChangesW),macos(FSEvents) and linux(fanotifyandinotify) Simple examples of directory monitoring;
    1. fanotifyUsed inglobalMode, infanotify_markJoinFAN_MARK_FILESYSTEM(needCAP_SYS_ADMINability, that is, root permissions)flag, All events on the specified file system can be monitored, and then the required events can be filtered according to the specified monitored folder directory. This function is moreinotifyMore powerful;
      1. Get the upper path where the event file is located, usingopen_by_handle_atThis method will appear under ordinary usersOperation not permittedError, also requiredCAP_SYS_ADMINAbility, that is, root permissions;
      2. It is recommended to use root permissions to run. If you must run it under normal users, it is recommended to use it.inotifyInsteadfanotify, open a monitoring file descriptor (fd) cannot be achievedsubtreemonitor;
  23. MonitorDir_EFSW——A simple example of directory monitoring implemented using efsw;
  24. OpenSSL——Some examples of openssl;
    1. aes——Aes encryption and decryption example;
    2. base64——Example of base64 encoding and decoding;
    3. hash——Sha256 example;
    4. hmac——The example of hmac;
    5. pem——Example of pem format;
    6. rsa——Example of rsa encryption and decryption;
    7. SM4——Example of sm4 encryption and decryption;
    8. Dirt 09——Example of x509 certificate;
    9. bash——Example of the openssl command line;
  25. SafeCallback——Implementation of life cycle safe callback function, referencemuduo WeakCallback
  26. Server——Some examples of linux server;
    1. server_epoll——The example of epoll;
    2. server_poll——A example of poll;
    3. server_select——Select example;
  27. SpinMutex——Simple mutex and spin lock implemented using std::atomic_flag;
  28. Thread——Thread class based on std::thread implementation, including thread pool;
    1. Thread——Thread class;
    2. ThreadPool——Thread pool;