Threads and synchronization primitives solve the vital problem of diversity of the threading API's on different platforms. The library also offers message queues and job queues as additional methods of thread synchronization and maintenance.
IP socket classes and utilities provide complete IP-based framework for both client-side and server-side programming. Combined with PTypes multithreading, these classes can be used for designing complex non-visual applications, such like network daemons or web robots.
Dynamic strings, variants, character sets, date/time type and various kinds of dynamic and associative arrays: Delphi programmers will find them very similar to the ones in their favorite language. The collection of these basic data types may be useful, among other things, for building compilers and interpreters for higher-level languages.
Streaming interfaces provide buffered I/O with simple and powerful text parsing methods. A strictly defined syntax for a given text format or a formal language can be represented by calls to PTypes token extraction methods. The unified streaming interface is applicable to files, named pipes and network sockets.
Special thread class with enhanced functionality called unit. Units have their own main() and input/output 'plugs'; they can be connected to each other within one application to form pipes, like processes in the UNIX shell.
Finally, everything above is portable: all platform-dependent details are hidden inside.
Why use PTypes?
PTypes is yet another generic class library among tens and hundreds of others. To find its own niche in this variety of generic programming tools we decided to emphasis on simplicity of the interfaces and readability of the resulting code (i.e. the code that uses the library). The library focuses only on most widely used data types and functional interfaces. We think that like programming languages themselves, low-level libraries, too, should use the minimal set of notions for covering most programming patterns.
Some data types in the library (strings, character sets and variants) use algebraic notation rather than object-oriented, i.e. you write length(s) for a string object instead of s.length(). We believe that traditional notation better fits to a class that represents some fundamental notion and is not supposed to produce subclasses with overridden methods. In other words, if there is no inheritance and polymorphism, there is no need for method calls as well.
PTypes uses old-fashioned all-lowercase naming style, since it can peacefully co-exist with other styles in one program. Whether you are a `unixoid' or you are using modern writing styles (Hungarian, Borland, etc.) you can combine your favorite style with PTypes with no or very little harm to your source code.
And finally, in order to achieve better readability of the resulting code we use clean class naming, i.e. the string type is called string, thread is thread, etc.
We designed this library in the hope that PTypes with its conciseness and intuitiveness could find its own 'target audience'.
Versions and availability
Version 2.1 of PTypes is the eleventh public release. The third number in the version indicates insignificant improvements or bug fixes. You might want to take a look at the Changes page if you are familiar with one of the previous versions.
The latest source code and both on-line and out-of-line documentation can be found at
You can receive announcements about new releases through one of the following services:
Subscribe to the project at freshmeat.net
Monitor the project at SourceForge.net
The development version of PTypes is available at SourceForge.net's CVS server. If you are willing to join the development of the library, please become a SourceForge.net user and then contact me to get full access to the CVS repository. The file TODO in the development branch contains the immediate development plan for the library.
Bugs and known problems
The list of problems encountered in the latest version along with their solutions, if available, can be found at PTypes project management page (at SourceForge.net):
PTypes project management page
We would like to thank:
Pierre-Frederic Caillaud <peufeu at free dot fr>
Ralph Siemsen <ralphs at netwinder dot org>
Marco Geri <m.geri at list dot it>
Philippe Le Rohellec <plerohel at hotmail dot com>
Mark Lentczner <markl at glyphic dot com>
Jordan Ritter <jpr5 at darkridge dot com>
Sergey Matveychuk <sem at ciam dot ru>
PTypes is open and free, which also means it is open to your comments and suggestions. Please, submit bug reports and feature requests through PTypes project management page at sf.net. There is a public discussion forum for general questions.
The author would be grateful if you let him know that you use the library in your project. The author's email address is:
Hovik Melikyan <h at melikyan dot com>
See also: Compiling and Porting, Changes, Resources