Modern Examples
Every example program of DataReel 6.4 has a modern C++ equivalent in examples_modern. Client and server pairs are one modern program that runs both ends, so 93 legacy source files map to 82 modern programs. Each page shows the legacy and modern sources side by side.
Oldest standard needed: C++11: 11 programs, C++14: 1 programs, C++17: 32 programs, C++20: 38 programs.
Thread Examples
| Program | Legacy files | Standard | Libraries | What it shows |
|---|---|---|---|---|
| threads_cancel | testprog.cpp | C++20 | C++ standard library only | Modern equivalent of the cancel example. |
| threads_condition | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of the condition variable example. |
| threads_deadlock1 | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of deadlock1. |
| threads_deadlock2 | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of deadlock2, where the application recovers a mutex whose owner died (gxMUTEX_OWNERDEAD_ERROR, MakeConsistent()). |
| threads_deadlock_posix_testing | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of the POSIX robust mutex test. |
| threads_destroy | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of the destroy example. |
| threads_detach | testprog.cpp | C++20 | C++ standard library only | Modern equivalent of the detach example. |
| threads_exiting | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of the exiting example. |
| threads_joined | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of the joined example. |
| threads_message | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of the message example. |
| threads_mutex | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the mutex example. |
| threads_priority | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the priority example. |
| threads_simple | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of the simple gxThread example. |
| threads_specific | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of the thread-specific data example. |
| threads_stack | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of the stack size example. |
| threads_suspend | testprog.cpp | C++20 | C++ standard library only | Modern equivalent of the suspend example. |
| threads_template | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the template example. |
| threads_thread_pool | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the thread pool example. |
| threads_thread_security | testprog.cpp | C++20 | C++ standard library only | Modern equivalent of the 6.4.1 thread checks. |
| threads_timed | testprog.cpp | C++14 | C++ standard library only | Modern equivalent of the timed example. |
General Examples
| Program | Legacy files | Standard | Libraries | What it shows |
|---|---|---|---|---|
| general_binary_search_tree | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the binary search tree test. |
| general_config_class | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the gxConfig test program. |
| general_device_cache | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the device cache test, which copies a file through gxDeviceBucketCache buckets. |
| general_disk_file_class | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the DiskFileB test program. |
| general_doubly_linked_list | testprog.cpp | C++11 | C++ standard library only | Modern equivalent of the doubly linked list test. |
| general_file_utils | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the file utilities test. |
| general_fuzz_fuzz_parsers | fuzz_parsers.cpp | C++17 | C++ standard library only | Modern equivalent of the libFuzzer targets for the 6.x parsers (HTML, XML, dates, IP and MAC addresses, CSV lines, wildcard matches). |
| general_fuzz_fuzz_text | fuzz_text.cpp | C++17 | C++ standard library only | Modern equivalent of the libFuzzer targets for the 6.x text code (gxConfig, gxString, Base64). |
| general_html_parser | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the gxsHTML test. |
| general_logfile | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the LogFile test. |
| general_memory_buffer | testprog.cpp | C++20 | C++ standard library only | Modern equivalent of the MemoryBuffer test program. |
| general_print_security | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the 6.3.1 print driver checks. |
| general_security_sweep | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the 6.3 security sweep checks. |
| general_string_class | testprog.cpp | C++20 | C++ standard library only | Modern equivalent of the gxString (UString) test program. |
| general_support_security | testprog.cpp | C++20 | C++ standard library only | Modern equivalent of the 6.3 support code checks (gxConfig, LogFile, the debug manager, thread messages, SysTime). |
| general_url_parser | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the gxsURL test. |
| general_xml_parser | testprog.cpp | C++17 | C++ standard library only | Modern equivalent of the gxsXML DOM test: build a tree, write it to a file, load the file back and write it again. |
Database Examples
| Program | Legacy files | Standard | Libraries | What it shows |
|---|---|---|---|---|
| database_btree | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the gxBtree test. |
| database_btree_cached | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the cached B-tree test. |
| database_btree_node | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the B-tree node test. |
| database_damaged | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the damaged database file tests. |
| database_database | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the 32-bit/64-bit engine comparison. |
| database_database_cache | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the database file cache test. |
| database_defrag | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the defrag test: allocate objects of growing size, delete them, undelete every other one, and allocate again with the best fit and the first fit methods, showing how deleted blocks are reused. |
| database_fuzz_fuzz_db | fuzz_db.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the libFuzzer targets for the object database (the .gxd data file target; the legacy file also has .btx and journal targets built the same way). |
| database_fuzz_gen_seeds | gen_seeds.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the seed file generator for the database fuzz targets: a data file, an index and a journal with two committed batches, copied into gxd/, btx/ and jnl/ folders. |
| database_infohog | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the InfoHog contact database demo. |
| database_journal | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the page cache and journal tests, as an example of the modern way to use gxdJournal. |
| database_journal_salt | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the journal salt test: 20 processes forked from one parent each start a journal, and every journal header must get a different salt (a salt copied into every child would let one process's journal records pass as another's). |
| database_layout | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the 6.4 on-disk layout test. |
| database_pod | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the POD (Persistent Object Database) test. |
| database_reclaim | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the reclaim test (best fit and first fit reuse of freed blocks). |
| database_replication_6x | repl6_writer.cpp repl6_check.cpp | C++20 | DataReel 6.4.3 + 7.x features | Modern equivalent of repl6_writer (primary) and repl6_check (copy): a 6.x program replicating its records with the DataReel 7.x object replication (gxv7ObjRepl, dr7features.h). |
| database_simple | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the simple gxDatabase demo. |
| database_vector_index | testprog.cpp | C++20 | DataReel 6.4.3 + 7.x features | Modern equivalent of the 6.4 vector index example: records in a 6.x gxDatabase file, found by vector similarity with the DataReel 7.x vector index (gxv7VectorIndex, dr7features.h). |
Socket Examples
| Program | Legacy files | Standard | Libraries | What it shows |
|---|---|---|---|---|
| socket_broadcast | client.cpp server.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the UDP broadcast client and server. |
| socket_comm_security | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the serial port, telnet and ping checks. |
| socket_echo_server | client.cpp server.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the TCP echo client and server. |
| socket_ftp_client | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the FTP client example. |
| socket_fuzz_fuzz_proto | fuzz_proto.cpp | C++20 | C++ standard library only | Modern equivalent of the libFuzzer targets for the 6.x HTTP, URL, SMTP, POP3 and FTP readers, aimed at the modern parsers in common/proto_parse.h: every input must give a value or a refusal, never a crash or a read out of bounds. |
| socket_hostinfo | testprog.cpp | C++17 | DataReel 6.4.3 | Modern equivalent of the host name information example. |
| socket_http_client | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the HTTP client example. |
| socket_http_server | httpserv.cpp server.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the multi-threaded HTTP server framework. |
| socket_https_client | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the HTTPS client example. |
| socket_imap_client | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the IMAP client example (6.4). |
| socket_multi_threaded_server | client.cpp m_thread.cpp server.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the multi-threaded client and server. |
| socket_multicast | client.cpp server.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the UDP multicast client and server. |
| socket_ping | testprog.cpp | C++20 | C++ standard library only | Modern equivalent of the ping example. |
| socket_pop3_client | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the POP3 client example. |
| socket_proto_security | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the 6.3.1 protocol parser checks. |
| socket_simple | client.cpp server.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the simple TCP client and server, in one program. |
| socket_smtp_client | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the SMTP client example. |
| socket_socket_cache | client.cpp gxsfile.cpp server.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the device cache client and server, which move a file through cache buckets over a gxStream connection. |
| socket_socket_security | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the gxSocket security checks. |
| socket_ssl_security | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the 6.3.1 gxSSL checks. |
| socket_ssl_server | m_thread.cpp server.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the multi-threaded HTTPS server. |
| socket_ssl_verify_cert | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the client side certificate check. |
| socket_stream_fuzz_fuzz_stream | fuzz_stream.cpp | C++20 | C++ standard library only | Modern equivalent of the libFuzzer target for the gxStream peer data: the fuzz input is what a peer sends over a socket pair (closed after the input), and the reader in common/block_frame.h must return good blocks or nothing, never crash, hang or allocate more than its maximum. |
| socket_stream_security | testprog.cpp | C++20 | C++ standard library only | Modern equivalent of the gxStream data path checks, applied to the modern block code in common/block_frame.h over a socket pair: request A peer that announces a 4 GB block gets nothing back and nothing is allocated (the length is checked first). |
| socket_tcp_send_file | tcp_send_file.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of tcp_send_file: send a file over a TCP stream. |
| socket_telnet_client | testprog.cpp | C++20 | DataReel 6.4.3 | Modern equivalent of the telnet client example. |
| socket_vector_client | testprog.cpp | C++20 | DataReel 6.4.3 + 7.x features | Modern equivalent of the vector client example: VECTOR_INFO and VECTOR_SEARCH on a DataReel 7.x object server over mutual TLS (gxv7ObjectClient, dr7features.h). |