Zcelib-one cplusplus C + + Crossplatform library use for develop server,similar to ACE.

Source: Internet
Author: User
Tags posix

Zcelib-one cplusplus C + + Crossplatform library use for develop server,similar to ACE.
OS adaptation layer, in order to adapt to the Windows and Linux two environments code added layer, while there are some extensions, basically can replace ACE. This part actually uses a lot of interesting code, the main idea is to simulate POSIX code under Windows. Let my code be debugged directly under Windows. This part of the code is named after the beginning of zce_os_adapt_xxx. The code is basically ported under the Zce_lib namespace, followed by the function name and the POSIX function name: Features that compare chunks include, network, time, file system, Getopt,c string functions, threads, various synchronization locks, shared memory processing, process and thread monitoring.
Log logs and debug libraries, as well as some debugging macros encapsulation, for logging, you can define how to split the log (size, date), the log can be rated output, output points include files, stdout,stderr,windows under the Trace, Debug library, provide a perfect debugging method, VC in this area is strong, stole a few. Debugging can also output current stack information, and so on. The early morning log class is actually the encapsulation of the Ace log, but its own code to be independent of the time or the original of the transformation took out the use. Also provides a fully-modeled log output interface
Time and timer, originally intended to use only timeval, the results found that time in the network programming everywhere, or have a own package is relatively easy to control, the result has zce_time_value this very low class, he is timeval inside, Fortunately, he also has in Visual C + +, in the OS adaptation has, encapsulated a variety of systems time to timeval conversion, with the timing of course there will be timers, our timers are 2 kinds of packages, one is more common timerheap timer heap, one is Timerwheel Timer time wheel, in contrast, Timerwheel has more powerful performance.
NET network encapsulation, including network functions, OO encapsulation includes network address, UDP,TCP encapsulation, including blocking and non-blocking send, receive interface. Connector connector and receiver acceptor. Can be greatly facilitated by your development. (originally this part completely uses the ACE, but finally removed the ace's part code, therefore still was forced to implement a network layer.) )
Reactor reactors, including select reactors, can be used under Windows and Linux, Epoll reactors,
Thread wrapper, threading includes OS layer encapsulation, OO encapsulation includes thread object, thread Manager,
MMAP STL A set of useful STL in shared memory (most interfaces are similar, but implementations are completely different.) For some code of MMAP STL, I encapsulate them purely helpless, in fact I do not think the use of mmap has much advantage. I like threads and normal memory, but if you use a multi-process model and you want to have a persistent storage, you have to use shared memory. And almost all container templates (including ACE) All use pointers, and pointers are natural predators for shared memory. However, you can write these things and thoroughly understand the STL. (although I believe that multithreaded code can be beautiful and elegant, never inferior to the various models of multi-process, but persistent storage that is a wall), and persistent storage may be a good-looking but not very useful things, recovery site may have countless problems. Be careful.
MySQL interface encapsulation, complete and convenient is the biggest benefit of this library. I even encapsulated the stmt in 2005 years. The avant-garde. The encapsulation interface is similar to the native interface, and the native API is good, but there are still a lot of details that are not masked. OO package is divided into several parts of Connect,cmd,result package, package packaging of the re-connected, automatic release and other functions. There is also a set of practical packages for stmt. But MySQL's stmt in the case of multiple tables is not convenient, you must save a Stmt object per table. (less than Oracle) so there are not many people who would like to be practical.
Sqlite
Add decryption
Hash algorithm
Fast compression algorithm
INI xml ini and XML Config file reads, the configuration will be read to a configuration tree, in addition, there is a and Win32 API similar to the INI file read and write, (but also because it is similar to his API, the code is complicated), this code is estimated to be the oldest code here, Originally there is my work number, 9527, this is your lifetime number.
INotify this has a simple package that can even be used on Windows and Linux two platforms.
MMAP Operations Library, including some STL-like templates,
Serverkit Server's tool class, currently provides a status statistics class using Mmap.
Pidfile the PID file class that prevents the server from starting multiple times, it is interesting to find that UNIX communication Volume 2 also talked about these things. Earth, or Earth.
Radom the package of random numbers, this code actually does not matter with boost. Was slowly deducted from the GNU Math class, and I added a thin template package. Thus making the utility more convenient.
The encapsulation of the Lua interface,
Https://github.com/sailzeng/zcelib

Zcelib-one cplusplus C + + Crossplatform library use for develop server,similar to ACE.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.