πŸ“œ ⬆️ ⬇️

Portable Components, cross-platform library for C ++

"The system must be designed so that
to stay as simple as possible
after a series of changes to it
Bjarne Stroustrup - programmer, author of C ++

Preamble


In this article I would like to tell you about the Portable Components library (abbr. POCO), which is quite popular but so rarely covered in HabrΓ©. It will be useful both to developers of business logic of a software product, and in solving most applied problems. With all the abundant cross-platform libraries for C ++, more and more people are confronted with POCO face to face and do not know where to start. In this article I will try to describe the technologies incorporated in the library and give the simplest examples of solving some problems. I would also like to note that the library has many successful open source and commercial projects.

Description


POCO is a collection of classes that simplify the process of developing, debugging and testing a software product. The library is based on the principle of a modular system with a small degree of connectivity. Like its colleague, Boost, POCO is divided into modules, each of which performs its role in the system, but does not use the paradigm of generalized programming as Boost, so carefully using patterned magic , thus avoiding some of the problems associated with searching for errors. Another significant advantage is the size of the final distribution - the POCO core size (Poco Foundation) takes about one and a half megabytes of memory (version 1.4.3.0, MSVC v100), the remaining modules range from 50 to 800 KB, which in the modern world is not much even for embedded systems . Applied Informatics Software Engineering GmbH - the developer of POCO even declares support for such tiny devices as Digi Connect ME 9210 , made in the form factor of an RJ-45 connector, having only 2 or 4 MB of flash and 8 MB of RAM on board.

POCO is mainly focused on network development and is ported to popular operating systems: Windows, Unix, Linux, eLinux, Mac OS X, Solaris, QNX Neutrino, Vxworks, Openvms, Tru64, HP-UX, Android . This list is expanding rather quickly, since all platform-dependent modules are separated from logic. In fact, on any operating system for which there is a modern compiler for the C ++ language, you can port POCO.
')
The library can be used as a basis for any development, be it server or client software, while the application is guaranteed to run on any of the available architectures (I confess, sometimes not without special magic). Moreover, POCO has such powerful tools as the TCP Server Framework, Reactor Framework, which make it very easy to create high-performance WEB servers, allowing us to save development time. Also in the library there is a snap-in for creating console applications, Unix daemons, and Windows services. Parallel work with such libraries as Qt, wxWidget, GTK + is possible.

The concepts of some parts of the library are borrowed from the Java Class Library, MS .NET Framework and Apple Cocoa . These are mainly high-level things, such as flow control or timers.

Poco is written with strict adherence to the ANSI / ISO C ++ 2003 standard using the C ++ standard library and STL. Available under the β€œ Boost Software License ”, allowing both commercial and non-commercial use.

How to learn POCO



Most of the examples can be found in source codes, in the SDK Reference and in presentations.

Basic modules and examples of use


Core library


Data compression



Cryptography



Database


File system


Work with logs


Multithreading


Network technologies


Processes


Streaming operations


Text encoding


Utility


Configuration


XML



Conclusion


In conclusion, I would like to note that the description of some modules was omitted because these modules deserve special attention and require separate articles. I sincerely believe that this library has a bright future. I would also like to see in POCO some of the buns from the new standard C ++ 11 .
The next article I would like to talk about specific things in the POCO. I will be glad to objective comments and objections.
Thanks for reading.

Source: https://habr.com/ru/post/148173/


All Articles