<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html xmlns:gcse="googleCustomSearch"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><link rel="shortcut icon" href="dlib-icon.ico"><meta name="verify-v1" content="02MiiaFNVzS5/u0eQhsy3/knioFHsia1X3DXRpHkE6I="><meta name="google-site-verification" content="DGSSJMKDomaDaDTIRJ8jDkv0YMx9Cz7OESbXHjjr6Jw"><title>dlib C++ Library - Miscellaneous</title><script type="text/javascript" src="dlib.js"></script><link rel="stylesheet" type="text/css" href="dlib.css"></head><body><a name="top"></a><div id="page_header"><a href="http://dlib.net"><img src="dlib-logo.png"></a></div><div id="top_content"><div id="main_menu" class="menu"><div class="menu_top"><b>The Library</b><ul class="tree"><li><a href="algorithms.html" class="menu">Algorithms</a></li><li><a href="api.html" class="menu">API Wrappers</a></li><li><a href="bayes.html" class="menu">Bayesian Nets</a></li><li><a href="compression.html" class="menu">Compression</a></li><li><a href="containers.html" class="menu">Containers</a></li><li><a href="graph_tools.html" class="menu">Graph Tools</a></li><li><a href="imaging.html" class="menu">Image Processing</a></li><li><a href="linear_algebra.html" class="menu">Linear Algebra</a></li><li><a href="ml.html" class="menu">Machine Learning</a></li><li><a href="metaprogramming.html" class="menu">Metaprogramming</a></li><li><a href="other.html" class="menu">Miscellaneous</a></li><li><a href="network.html" class="menu">Networking</a></li><li><a href="optimization.html" class="menu">Optimization</a></li><li><a href="parsing.html" class="menu">Parsing</a></li></ul><br><b>Help/Info</b><ul class="tree"><li><a href="http://blog.dlib.net" class="menu">Dlib Blog</a></li><li><a onclick="Toggle(this)" class="sub menu"><img src="plus.gif">Examples: C++</a><ul style="display:none;"><li><a href="3d_point_cloud_ex.cpp.html" class="menu">3D Point Cloud</a></li><li><a href="assignment_learning_ex.cpp.html" class="menu">Assignment Learning</a></li><li><a href="file_to_code_ex.cpp.html" class="menu">Base64 Encoder</a></li><li><a href="bayes_net_from_disk_ex.cpp.html" class="menu">Bayesian Network From Disk</a></li><li><a href="bayes_net_gui_ex.cpp.html" class="menu">Bayesian Network GUI</a></li><li><a href="bayes_net_ex.cpp.html" class="menu">Bayesian Network</a></li><li><a href="bridge_ex.cpp.html" class="menu">Bridge</a></li><li><a href="bsp_ex.cpp.html" class="menu">BSP</a></li><li><a href="svm_c_ex.cpp.html" class="menu">C-Support Vector Machine</a></li><li><a href="compress_stream_ex.cpp.html#_top" class="menu">Cmd Line Parser</a></li><li><a href="compress_stream_ex.cpp.html" class="menu">Compress Stream</a></li><li><a href="config_reader_ex.cpp.html" class="menu">Config File Reader</a></li><li><a href="custom_trainer_ex.cpp.html" class="menu">Custom Trainers</a></li><li><a href="dnn_face_recognition_ex.cpp.html" class="menu">Deep Face Recognition</a></li><li><a href="dnn_dcgan_train_ex.cpp.html" class="menu">Deep Learning DCGAN</a></li><li><a href="dnn_mmod_dog_hipsterizer.cpp.html" class="menu">Deep Learning Dog Hipsterizer</a></li><li><a href="dnn_mmod_face_detection_ex.cpp.html" class="menu">Deep Learning Face Detection</a></li><li><a href="dnn_imagenet_ex.cpp.html" class="menu">Deep Learning Imagenet Classifier</a></li><li><a href="dnn_imagenet_train_ex.cpp.html" class="menu">Deep Learning Imagenet Trainer </a></li><li><a href="dnn_inception_ex.cpp.html" class="menu">Deep Learning Inception</a></li><li><a href="dnn_instance_segmentation_train_ex.cpp.html" class="menu">Deep Learning Instance Segmentation Trainer</a></li><li><a href="dnn_instance_segmentation_ex.cpp.html" class="menu">Deep Learning Instance Segmentation</a></li><li><a href="dnn_introduction_ex.cpp.html" class="menu">Deep Learning Introduction Part 1</a></li><li><a href="dnn_introduction2_ex.cpp.html" class="menu">Deep Learning Introduction Part 2</a></li><li><a href="dnn_introduction3_ex.cpp.html" class="menu">Deep Learning Introduction Part 3</a></li><li><a href="dnn_mmod_ex.cpp.html" class="menu">Deep Learning Max-Margin Object Detection</a></li><li><a href="dnn_mmod_find_cars2_ex.cpp.html" class="menu">Deep Learning Multi-Class Vehicle Detection</a></li><li><a href="dnn_semantic_segmentation_train_ex.cpp.html" class="menu">Deep Learning Semantic Segmentation Trainer</a></li><li><a href="dnn_semantic_segmentation_ex.cpp.html" class="menu">Deep Learning Semantic Segmentation</a></li><li><a href="dnn_mmod_train_find_cars_ex.cpp.html" class="menu">Deep Learning Vehicle Detection Trainer</a></li><li><a href="dnn_mmod_find_cars_ex.cpp.html" class="menu">Deep Learning Vehicle Detection</a></li><li><a href="dnn_metric_learning_ex.cpp.html" class="menu">Deep Metric Learning Introduction</a></li><li><a href="dnn_metric_learning_on_images_ex.cpp.html" class="menu">Deep Metric Learning on Images</a></li><li><a href="dir_nav_ex.cpp.html" class="menu">Directory Navigation</a></li><li><a href="empirical_kernel_map_ex.cpp.html" class="menu">Empirical Kernel Map</a></li><li><a href="face_detection_ex.cpp.html" class="menu">Face Detection</a></li><li><a href="face_landmark_detection_ex.cpp.html" class="menu">Face Landmark Detection</a></li><li><a href="fhog_ex.cpp.html" class="menu">FHOG Feature Extraction</a></li><li><a href="fhog_object_detector_ex.cpp.html" class="menu">FHOG Object Detection</a></li><li><a href="graph_labeling_ex.cpp.html" class="menu">Graph Labeling</a></li><li><a href="gui_api_ex.cpp.html" class="menu">GUI</a></li><li><a href="hough_transform_ex.cpp.html" class="menu">Hough Transform</a></li><li><a href="server_http_ex.cpp.html" class="menu">HTTP Server</a></li><li><a href="image_ex.cpp.html" class="menu">Image</a></li><li><a href="iosockstream_ex.cpp.html" class="menu">IO Socket Streams</a></li><li><a href="server_iostream_ex.cpp.html" class="menu">IO Streams Server</a></li><li><a href="kcentroid_ex.cpp.html" class="menu">Kernel Centroid</a></li><li><a href="kkmeans_ex.cpp.html" class="menu">Kernel K-Means Clustering</a></li><li><a href="krr_regression_ex.cpp.html" class="menu">Kernel Ridge Regression</a></li><li><a href="krls_filter_ex.cpp.html" class="menu">Kernel RLS Filtering</a></li><li><a href="krls_ex.cpp.html" class="menu">Kernel RLS Regression</a></li><li><a href="krr_classification_ex.cpp.html" class="menu">KRR Classification</a></li><li><a href="learning_to_track_ex.cpp.html" class="menu">Learning to Track</a></li><li><a href="max_cost_assignment_ex.cpp.html" class="menu">Linear Assignment Problems</a></li><li><a href="linear_manifold_regularizer_ex.cpp.html" class="menu">Linear Manifold Regularizer</a></li><li><a href="mpc_ex.cpp.html" class="menu">Linear Model Predictive Control</a></li><li><a href="logger_ex_2.cpp.html" class="menu">Logger Advanced</a></li><li><a href="logger_custom_output_ex.cpp.html" class="menu">Logger Custom Output</a></li><li><a href="logger_ex.cpp.html" class="menu">Logger</a></li><li><a href="matrix_expressions_ex.cpp.html" class="menu">Matrix Expressions</a></li><li><a href="matrix_ex.cpp.html" class="menu">Matrix</a></li><li><a href="member_function_pointer_ex.cpp.html" class="menu">Member Function Pointer</a></li><li><a href="model_selection_ex.cpp.html" class="menu">Model Selection</a></li><li><a href="multiclass_classification_ex.cpp.html" class="menu">Multiclass Classification</a></li><li><a href="multithreaded_object_ex.cpp.html" class="menu">Multithreaded Object</a></li><li><a href="mlp_ex.cpp.html" class="menu">Neural Network</a></li><li><a href="least_squares_ex.cpp.html" class="menu">Non-Linear Least Squares</a></li><li><a href="svm_ex.cpp.html" class="menu">Nu-Support Vector Machine</a></li><li><a href="integrate_function_adapt_simp_ex.cpp.html" class="menu">Numerical Integration</a></li><li><a href="object_detector_advanced_ex.cpp.html" class="menu">Object Detector Advanced</a></li><li><a href="object_detector_ex.cpp.html" class="menu">Object Detector</a></li><li><a href="one_class_classifiers_ex.cpp.html" class="menu">One Class Classifiers</a></li><li><a href="svm_pegasos_ex.cpp.html" class="menu">Online SVM</a></li><li><a href="optimization_ex.cpp.html" class="menu">Optimization</a></li><li><a href="parallel_for_ex.cpp.html" class="menu">Parallel For Loops</a></li><li><a href="pipe_ex_2.cpp.html" class="menu">Pipe 2</a></li><li><a href="pipe_ex.cpp.html" class="menu">Pipe</a></li><li><a href="quantum_computing_ex.cpp.html" class="menu">Quantum Computing</a></li><li><a href="queue_ex.cpp.html" class="menu">Queue</a></li><li><a href="random_cropper_ex.cpp.html" class="menu">Random Cropper</a></li><li><a href="rank_features_ex.cpp.html" class="menu">Rank Features</a></li><li><a href="rvm_ex.cpp.html" class="menu">Relevance Vector Classification</a></li><li><a href="rvm_regression_ex.cpp.html" class="menu">Relevance Vector Regression</a></li><li><a href="running_stats_ex.cpp.html" class="menu">Running Stats</a></li><li><a href="sequence_labeler_ex.cpp.html" class="menu">Sequence Labeling</a></li><li><a href="sequence_segmenter_ex.cpp.html" class="menu">Sequence Segmentation</a></li><li><a href="sockets_ex.cpp.html" class="menu">Sockets</a></li><li><a href="sockstreambuf_ex.cpp.html" class="menu">Sockstreambuf</a></li><li><a href="svm_sparse_ex.cpp.html" class="menu">Sparse Vectors</a></li><li><a href="sqlite_ex.cpp.html" class="menu">SQLite</a></li><li><a href="std_allocator_ex.cpp.html" class="menu">Std C++ Allocator</a></li><li><a href="svm_struct_ex.cpp.html" class="menu">Structural Support Vector Machines</a></li><li><a href="svr_ex.cpp.html" class="menu">Support Vector Regression</a></li><li><a href="surf_ex.cpp.html" class="menu">SURF</a></li><li><a href="svm_rank_ex.cpp.html" class="menu">SVM-Rank</a></li><li><a href="thread_function_ex.cpp.html" class="menu">Thread Function</a></li><li><a href="thread_pool_ex.cpp.html" class="menu">Thread Pool</a></li><li><a href="threaded_object_ex.cpp.html" class="menu">Threaded Object</a></li><li><a href="threads_ex.cpp.html" class="menu">Threads</a></li><li><a href="timer_ex.cpp.html" class="menu">Timer</a></li><li><a href="train_object_detector.cpp.html" class="menu">Train Object Detector</a></li><li><a href="train_shape_predictor_ex.cpp.html" class="menu">Train Shape Predictor</a></li><li><a href="using_custom_kernels_ex.cpp.html" class="menu">Using Custom Kernels</a></li><li><a href="video_tracking_ex.cpp.html" class="menu">Video Object Tracking</a></li><li><a href="webcam_face_pose_ex.cpp.html" class="menu">Webcam Face Pose Estimation</a></li><li><a href="xml_parser_ex.cpp.html" class="menu">XML Parser</a></li></ul></li><li><a onclick="Toggle(this)" class="sub menu"><img src="plus.gif">Examples: Python</a><ul style="display:none;"><li><a href="svm_binary_classifier.py.html" class="menu">Binary Classification</a></li><li><a href="cnn_face_detector.py.html" class="menu">CNN Face Detector</a></li><li><a href="face_alignment.py.html" class="menu">Face Alignment</a></li><li><a href="face_clustering.py.html" class="menu">Face Clustering</a></li><li><a href="face_detector.py.html" class="menu">Face Detector</a></li><li><a href="face_jitter.py.html" class="menu">Face Jittering/Augmentation</a></li><li><a href="face_landmark_detection.py.html" class="menu">Face Landmark Detection</a></li><li><a href="face_recognition.py.html" class="menu">Face Recognition</a></li><li><a href="find_candidate_object_locations.py.html" class="menu">Find Candidate Object Locations</a></li><li><a href="global_optimization.py.html" class="menu">Global Optimization</a></li><li><a href="max_cost_assignment.py.html" class="menu">Linear Assignment Problems</a></li><li><a href="sequence_segmenter.py.html" class="menu">Sequence Segmenter</a></li><li><a href="svm_struct.py.html" class="menu">Structural Support Vector Machines</a></li><li><a href="svm_rank.py.html" class="menu">SVM-Rank</a></li><li><a href="train_object_detector.py.html" class="menu">Train Object Detector</a></li><li><a href="train_shape_predictor.py.html" class="menu">Train Shape Predictor</a></li><li><a href="correlation_tracker.py.html" class="menu">Video Object Tracking</a></li></ul></li><li><a href="faq.html" class="menu">FAQ</a></li><li><a href="index.html" class="menu">Home</a></li><li><a href="compile.html" class="menu">How to compile</a></li><li><a href="howto_contribute.html" class="menu">How to contribute</a></li><li><a href="term_index.html" class="menu">Index</a></li><li><a href="intro.html" class="menu">Introduction</a></li><li><a href="license.html" class="menu">License</a></li><li><a href="python/index.html" class="menu">Python API</a></li><li><a href="books.html" class="menu">Suggested Books</a></li><li><a href="http://sourceforge.net/p/dclib/wiki/Known_users/" class="menu">Who uses dlib?</a></li></ul><br><b>Current Release</b><ul class="tree"><li><a href="change_log.html" class="menu">Change Log</a></li><li><a href="release_notes.html" class="menu">Release Notes</a></li><li>Version: 19.22</li></ul><br></div><div class="menu_footer"> Last Modified:<br>Mar 18, 2018</div></div><div id="main_text"><div id="main_text_title">Miscellaneous</div><div id="main_text_body"><p> This page documents library components that don't really fit in anywhere else. They all follow the same conventions as the rest of the library. </p></div></div><div id="right_menu" class="menu"><div class="menu_top"><b>Objects</b><ul class="tree"><li><a href="#bit_stream" class="menu">bit_stream</a></li><li><a href="#bound_function_pointer" class="menu">bound_function_pointer</a></li><li><a href="#byte_orderer" class="menu">byte_orderer</a></li><li><a href="#console_progress_indicator" class="menu">console_progress_indicator</a></li><li><a href="#copy_functor" class="menu">copy_functor</a></li><li><a href="#default_memory_manager" class="menu">default_memory_manager</a></li><li><a href="#error" class="menu">error</a></li><li><a onclick="Toggle(this)" class="sub menu"><img src="plus.gif">Fixed_width_integers</a><ul style="display:none;"><li><a href="#int16" class="menu">int16</a></li><li><a href="#int32" class="menu">int32</a></li><li><a href="#int64" class="menu">int64</a></li><li><a href="#int8" class="menu">int8</a></li><li><a href="#uint16" class="menu">uint16</a></li><li><a href="#uint32" class="menu">uint32</a></li><li><a href="#uint64" class="menu">uint64</a></li><li><a href="#uint8" class="menu">uint8</a></li></ul></li><li><a href="#logger" class="menu">logger</a></li><li><a href="#member_function_pointer" class="menu">member_function_pointer</a></li><li><a href="#memory_manager" class="menu">memory_manager</a></li><li><a href="#memory_manager_global" class="menu">memory_manager_global</a></li><li><a href="#memory_manager_stateless" class="menu">memory_manager_stateless</a></li><li><a href="#pipe" class="menu">pipe</a></li><li><a href="#std_allocator" class="menu">std_allocator</a></li><li><a href="#sync_extension" class="menu">sync_extension</a></li><li><a href="#timeout" class="menu">timeout</a></li><li><a href="#timer" class="menu">timer</a></li><li><a href="#unserialize" class="menu">unserialize</a></li><li><a href="#vectorstream" class="menu">vectorstream</a></li></ul><br><b>Global Functions</b><ul class="tree"><li><a href="#check_serialized_version" class="menu">check_serialized_version</a></li><li><a href="#deserialize" class="menu">deserialize</a></li><li><a href="#make_mfp" class="menu">make_mfp</a></li><li><a href="#ramdump" class="menu">ramdump</a></li><li><a href="#serialize" class="menu">serialize</a></li><li><a href="#TIME_THIS" class="menu">TIME_THIS</a></li><li><a href="#timing%20code%20blocks" class="menu">timing code blocks</a></li><li><a href="#zero_extend_cast" class="menu">zero_extend_cast</a></li></ul><br><b>SQLite</b><ul class="tree"><li><a href="#database" class="menu">database</a></li><li><a onclick="Toggle(this)" class="sub menu"><img src="plus.gif">simple_queries</a><ul style="display:none;"><li><a href="dlib/sqlite/sqlite_tools_abstract.h.html#query_blob" class="menu">query_blob</a></li><li><a href="dlib/sqlite/sqlite_tools_abstract.h.html#query_double" class="menu">query_double</a></li><li><a href="dlib/sqlite/sqlite_tools_abstract.h.html#query_int64" class="menu">query_int64</a></li><li><a href="dlib/sqlite/sqlite_tools_abstract.h.html#query_int" class="menu">query_int</a></li><li><a href="dlib/sqlite/sqlite_tools_abstract.h.html#query_object" class="menu">query_object</a></li><li><a href="dlib/sqlite/sqlite_tools_abstract.h.html#query_text" class="menu">query_text</a></li></ul></li><li><a href="#statement" class="menu">statement</a></li><li><a href="#transaction" class="menu">transaction</a></li></ul><br><b>Other</b><ul class="tree"><li><a href="#dlib_testing_suite" class="menu">dlib_testing_suite</a></li><li><a href="#Java" class="menu">Java</a></li><li><a href="#MATLAB" class="menu">MATLAB</a></li></ul><br></div><div class="menu_footer"></div></div></div><div id="bottom_content"><a name="bit_stream"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">bit_stream</h1><BR><BR> This object represents a middle man between a user and the iostream classes that allows single bits to be read/written easily from/to the iostream classes <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/bit_stream/bit_stream_kernel_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/bit_stream.h></div></div><BR><BR><B>Implementations:</B><blockquote><a href="dlib/bit_stream/bit_stream_kernel_1.h.html">bit_stream_kernel_1</a>: <br> This implementation is done by buffering single bits in the obvious way. <div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_1a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for bit_stream_kernel_1</td></tr><tr><td valign="top"><div class="tdn">kernel_1a_c</div></td><td width="100%"> is a typedef for kernel_1a that checks its preconditions. </td></tr></table></div></blockquote><br><center><h1>Extensions to bit_stream</h1></center><div class="extension"><a name="bit_stream_multi"><B><font size="5">bit_stream_multi</font></B></a><Br><BR>This extension gives a bit_stream object the ability to read/write multiple bits at a time.<BR><BR><a class="more_details_extension" href="dlib/bit_stream/bit_stream_multi_abstract.h.html">More Details...</a><BR><BR><B>Implementations:</B><blockquote><a href="dlib/bit_stream/bit_stream_multi_1.h.html">bit_stream_multi_1</a>: <br>This implementation is done by calling the read/write functions in the bit_stream kernel.<div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">multi_1a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for bit_stream_kernel_1 extended by bit_stream_multi_1</td></tr><tr><td valign="top"><div class="tdn">multi_1a_c</div></td><td width="100%"> is a typedef for multi_1a that checks its preconditions. </td></tr></table></div></blockquote></div></div><a name="bound_function_pointer"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">bound_function_pointer</h1><BR><BR> This object represents a function with all its arguments bound to specific objects. <p> This implementation is done using type erasure and placement new. This means that it never allocates memory on the heap and instead stores everything on the stack. </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/bound_function_pointer/bound_function_pointer_kernel_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/bound_function_pointer.h></div></div></div><a name="byte_orderer"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">byte_orderer</h1><BR><BR> This object provides a simple type safe mechanism to convert data to and from network and host byte orders. I.e. to convert things between big and little endian byte ordering. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/byte_orderer/byte_orderer_kernel_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/byte_orderer.h></div></div></div><a name="check_serialized_version"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">check_serialized_version</h1><BR><BR> This function deserializes a string and checks if it matches a user supplied string (the version). If they don't match then dlib::serialization_error is thrown. The point of this function is to make checking version strings in serialized files a little more convenient. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/serialize.h.html#check_serialized_version">More Details...</a><div class="include_file">#include <dlib/serialize.h></div></div></div><a name="console_progress_indicator"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">console_progress_indicator</h1><BR><BR> This object is a tool for reporting how long a task will take to complete. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/console_progress_indicator.h.html#console_progress_indicator">More Details...</a><div class="include_file">#include <dlib/console_progress_indicator.h></div></div></div><a name="copy_functor"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">copy_functor</h1><BR><BR> This is a templated function object that makes copies of something. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#copy_functor">More Details...</a><div class="include_file">#include <dlib/algs.h></div></div></div><a name="database"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">database</h1><BR><BR> This object is a C++ wrapper around a SQLite database connection handle and therefore represents a <a href="http://www.sqlite.org">SQLite</a> database file. <p> Note that this wrapper is targeted at SQLite Version 3. To use it you must make sure you link your application with SQLite. However, if you use CMake and dlib's default CMakeLists.txt file then it will get setup automatically. This is assuming sqlite3 is properly installed on your system. On ubuntu you can get it by installing the libsqlite3-dev package. Or you can always download the <a href="http://www.sqlite.org/download.html">SQLite source</a> and compile it straight into your application (download the amalgamation). </p><BR><BR>C++ Example Programs: <a href="sqlite_ex.cpp.html">sqlite_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/sqlite/sqlite_abstract.h.html#database">More Details...</a><div class="include_file">#include <dlib/sqlite.h></div></div></div><a name="default_memory_manager"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">default_memory_manager</h1><BR><BR> This is a memory manager object which simply calls new and delete directly (i.e. it doesn't really do anything). It is the default memory manager used by most of the objects in dlib. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/algs.h.html#default_memory_manager">More Details...</a><div class="include_file">#include <dlib/algs.h></div></div></div><a name="deserialize"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">deserialize</h1><BR><BR> This is actually a set of overloaded functions which provide the ability to restore an object's state from an input stream. Currently all dlib container classes, non pointer C++ intrinsics, std::string, std::vector, std::map, std::set, std::complex, dlib::bigint, dlib::uint64, dlib::int64, C style arrays, and dlib::vector objects are serializable. <p> You can also use serialize() and deserialize() to read/write Google protocol buffer objects. However, note that dlib::serialize() writes additional delimiting bytes at the start of each protocol buffer message. We do this because Google protocol buffers are not <a href="https://developers.google.com/protocol-buffers/docs/techniques#streaming">self-delimiting</a> on their own. This means that you can't write more than one protocol buffer object to an output stream unless you include some kind of delimiter between the messages. So dlib takes care of this for you by prefixing each message with its length in bytes. In particular, the number of bytes is encoded as a 32bit little endian integer. </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/serialize.h.html">More Details...</a><div class="include_file">#include <dlib/serialize.h></div></div></div><a name="dlib_testing_suite"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">dlib_testing_suite</h1><BR><BR><p> This library comes with a command line driven regression test suite. All the testing code is located in the dlib/test folder. If you want to build it and test the library on your system you can use the makefile at <a href="dlib/test/makefile">dlib/test/makefile</a> (you may have to edit it to make it work on your system) or use the CMake CMakeLists.txt file at <a href="dlib/test/CMakeLists.txt.html">dlib/test/CMakeLists.txt</a> to build it. </p><p> What you may find more useful however is the testing framework itself. It uses a fairly simple and modular design. Each test is contained in its own cpp file and when compiled into the program it automatically shows up in the list of tests to run. If you want to use the testing framework all you need to do is add the files <a href="dlib/test/tester.h.html">dlib/test/tester.h</a>, <a href="dlib/test/tester.cpp.html">dlib/test/tester.cpp</a>, and <a href="dlib/test/main.cpp.html">dlib/test/main.cpp</a> to your project and then add cpp files that contain your tests (see <a href="dlib/test/example.cpp.html">dlib/test/example.cpp</a> and <a href="dlib/test/example_args.cpp.html">dlib/test/example_args.cpp</a> for some examples). </p><p> From the command line you can choose to run all the installed tests, enable or disable the loggers, set various logging levels, specify how many times to run the tests, or pick just one or two tests to run at a time rather than the entire suite. The output of the program, that is, its return value from main() is the number of failed tests. So if every test succeeds then it returns 0. </p><BR><div class="include_file_more_details_wrapper"></div></div><a name="error"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">error</h1><BR><BR> This is the base exception class from which all exceptions in this library inherit. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/error.h.html#error">More Details...</a><div class="include_file">#include <dlib/error.h></div></div></div><a name="int16"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">int16</h1><BR><BR> This is just a typedef for a 16 bit integer. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/uintn.h.html#int16">More Details...</a><div class="include_file">#include <dlib/uintn.h></div></div></div><a name="int32"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">int32</h1><BR><BR> This is just a typedef for a 32 bit integer. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/uintn.h.html#int32">More Details...</a><div class="include_file">#include <dlib/uintn.h></div></div></div><a name="int64"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">int64</h1><BR><BR> This is just a typedef for a 64 bit integer. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/uintn.h.html#int64">More Details...</a><div class="include_file">#include <dlib/uintn.h></div></div></div><a name="int8"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">int8</h1><BR><BR> This is just a typedef for an 8 bit integer. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/uintn.h.html#int8">More Details...</a><div class="include_file">#include <dlib/uintn.h></div></div></div><a name="Java"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">Java</h1><BR><BR> dlib contains some CMake scripts and related tools that make calling C++ code from Java easy. If you look in the <a href="https://github.com/davisking/dlib/tree/master/dlib/java">dlib/java</a> folder you can find a CMake project that uses SWIG to build some C++ code and then call it from Java. In particular, if you run the run_test.sh script it will build and run the code, calling it from java. <p> The dlib/java folder also contains some SWIG aware C++ classes that make interacting with java arrays (e.g. double[]) from C++ efficient and easy. See the documentation at the top of the <a href="dlib/java/java_array.h.html">java_array.h</a> file for details. </p><BR><div class="include_file_more_details_wrapper"></div></div><a name="logger"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">logger</h1><BR><BR> This component is a logging output stream in the style of the log4j logger available for Java. <BR><BR>C++ Example Programs: <a href="logger_ex.cpp.html">logger_ex.cpp</a>, <a href="logger_ex_2.cpp.html">logger_ex_2.cpp</a>, <a href="logger_custom_output_ex.cpp.html">logger_custom_output_ex.cpp</a>, <a href="pipe_ex.cpp.html">pipe_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/logger/logger_kernel_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/logger.h></div></div><br><center><h1>Extensions to logger</h1></center><div class="extension"><a name="config_file"><B><font size="5">config_file</font></B></a><Br><BR>This extension provides the configure_loggers_from_file() function which reads a configuration file from disk that sets up all your loggers.<BR><BR><a class="more_details_extension" href="dlib/logger/logger_config_file.h.html">More Details...</a></div><div class="extension"><a name="extra_logger_headers"><B><font size="5">extra_logger_headers</font></B></a><Br><BR>This extension contains additional logger headers you may chose to use instead of the default one. <BR><BR><a class="more_details_extension" href="dlib/logger/extra_logger_headers.h.html">More Details...</a></div></div><a name="make_mfp"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">make_mfp</h1><BR><BR> This function is a simple factory for creating <a href="#member_function_pointer">member_function_pointer</a> objects without needing to know the necessary template arguments for the member_function_pointer. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/member_function_pointer/make_mfp_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/member_function_pointer.h></div></div></div><a name="MATLAB"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">MATLAB</h1><BR><BR> dlib contains a tool that makes it easy to call C++ code from MATLAB. It's documented in the examples in the dlib/matlab folder. In particular, the <a href="dlib/matlab/example_mex_function.cpp.html">dlib/matlab/example_mex_function.cpp</a>, <a href="dlib/matlab/example_mex_callback.cpp.html">dlib/matlab/example_mex_callback.cpp</a>, and <a href="dlib/matlab/example_mex_struct.cpp.html">dlib/matlab/example_mex_struct.cpp</a> examples. You can also easily compile these files using CMake. See the instructions in the README file in the dlib/matlab folder for further details. <BR><div class="include_file_more_details_wrapper"></div></div><a name="member_function_pointer"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">member_function_pointer</h1><BR><BR> This object represents a member function pointer. It is useful because instances of this object can be created without needing to know the type of object whose member function we will be calling. <p> The implementation of this object is done using type erasure and placement new. This means that it never allocates memory on the heap and instead stores everything on the stack. </p><BR><BR>C++ Example Programs: <a href="member_function_pointer_ex.cpp.html">member_function_pointer_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/member_function_pointer/member_function_pointer_kernel_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/member_function_pointer.h></div></div></div><a name="memory_manager"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">memory_manager</h1><BR><BR> This object represents a memory pool. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/memory_manager/memory_manager_kernel_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/memory_manager.h></div></div><BR><BR><B>Implementations:</B><blockquote><a href="dlib/memory_manager/memory_manager_kernel_1.h.html">memory_manager_kernel_1</a>: <br> This memory manager implementation allocates objects one at a time when there are allocation requests. Then when there is a deallocate request the returning object is placed into a list of free blocks if that list has less than max_pool_size blocks in it. Subsequent allocation requests will be serviced by drawing from the free list whenever it isn't empty. Array allocations, on the other hand, are not managed at all but are passed directly on to new and delete. <p> When this object's max_pool_size template parameter is set to 0 it simply calls new and delete directly and doesn't function as a memory pool. </p><div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_1a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_kernel_1 with a max_pool_size of 0</td></tr><tr><td valign="top"><div class="tdn">kernel_1b</div></td><td width="100%">is a typedef for memory_manager_kernel_1 with a max_pool_size of 10</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_1c</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_kernel_1 with a max_pool_size of 100</td></tr><tr><td valign="top"><div class="tdn">kernel_1d</div></td><td width="100%">is a typedef for memory_manager_kernel_1 with a max_pool_size of 1000</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_1e</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_kernel_1 with a max_pool_size of 10000</td></tr><tr><td valign="top"><div class="tdn">kernel_1f</div></td><td width="100%">is a typedef for memory_manager_kernel_1 with a max_pool_size of 100000</td></tr></table></div></blockquote><blockquote><a href="dlib/memory_manager/memory_manager_kernel_2.h.html">memory_manager_kernel_2</a>: <br> This memory manager implementation allocates memory in blocks of chunk_size*sizeof(T) bytes. All the sizeof(T) sub-blocks are kept in a linked list of free memory blocks and are given out whenever an allocation request occurs. Also, memory is not freed until this object is destructed. Also note that array allocations are not managed at all but are passed directly on to new and delete. <div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_kernel_2 with a chunk_size of 10</td></tr><tr><td valign="top"><div class="tdn">kernel_2b</div></td><td width="100%">is a typedef for memory_manager_kernel_2 with a chunk_size of 100</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2c</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_kernel_2 with a chunk_size of 1000</td></tr><tr><td valign="top"><div class="tdn">kernel_2d</div></td><td width="100%">is a typedef for memory_manager_kernel_2 with a chunk_size of 10000</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2e</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_kernel_2 with a chunk_size of 100000</td></tr></table></div></blockquote><blockquote><a href="dlib/memory_manager/memory_manager_kernel_3.h.html">memory_manager_kernel_3</a>: <br> This memory manager implementation allocates memory in blocks of chunk_size*sizeof(T) bytes. All the sizeof(T) sub-blocks are kept in a linked list of free memory blocks and are given out whenever an allocation request occurs. Note that array allocations are managed. So this object is just like kernel_2 but it also pools memory from array allocations (chunk_size has no effect with respect to array allocations, each array is allocated one at a time). Also, memory is not freed until this object is destructed. <div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_3a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_kernel_3 with a chunk_size of 10</td></tr><tr><td valign="top"><div class="tdn">kernel_3b</div></td><td width="100%">is a typedef for memory_manager_kernel_3 with a chunk_size of 100</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_3c</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_kernel_3 with a chunk_size of 1000</td></tr><tr><td valign="top"><div class="tdn">kernel_3d</div></td><td width="100%">is a typedef for memory_manager_kernel_3 with a chunk_size of 10000</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_3e</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_kernel_3 with a chunk_size of 100000</td></tr></table></div></blockquote></div><a name="memory_manager_global"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">memory_manager_global</h1><BR><BR> This object represents some kind of global memory manager or memory pool. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/memory_manager_global/memory_manager_global_kernel_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/memory_manager_global.h></div></div><BR><BR><B>Implementations:</B><blockquote><a href="dlib/memory_manager_global/memory_manager_global_kernel_1.h.html">memory_manager_global_kernel_1</a>: <br> This is implemented in the obvious way. See the code for details. <div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_1a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_global_kernel_1</td></tr></table></div></blockquote></div><a name="memory_manager_stateless"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">memory_manager_stateless</h1><BR><BR> This object represents some kind of stateless memory manager or memory pool. Stateless means that all instances (instances of the same type that is) of this object are identical and can be used interchangeably. Note that implementations are allowed to have some shared global state such as a global memory pool. This object is also thread safe. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/memory_manager_stateless/memory_manager_stateless_kernel_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/memory_manager_stateless.h></div></div><BR><BR><B>Implementations:</B><blockquote><a href="dlib/memory_manager_stateless/memory_manager_stateless_kernel_1.h.html">memory_manager_stateless_kernel_1</a>: <br> This implementation just calls new and delete. So it doesn't do anything special. <div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_1a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_stateless_kernel_1</td></tr></table></div></blockquote><blockquote><a href="dlib/memory_manager_stateless/memory_manager_stateless_kernel_2.h.html">memory_manager_stateless_kernel_2</a>: <br> This implementation uses a global instance of a <a href="#memory_manager">memory_manager</a> object guarded by a mutex as its implementation. <div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2_1a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_1a</td></tr><tr><td valign="top"><div class="tdn">kernel_2_1b</div></td><td width="100%">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_1b</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2_1c</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_1c</td></tr><tr><td valign="top"><div class="tdn">kernel_2_1d</div></td><td width="100%">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_1d</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2_1e</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_1e</td></tr><tr><td valign="top"><div class="tdn">kernel_2_1f</div></td><td width="100%">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_1f</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2_2a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_2a</td></tr><tr><td valign="top"><div class="tdn">kernel_2_2b</div></td><td width="100%">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_2b</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2_2c</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_2c</td></tr><tr><td valign="top"><div class="tdn">kernel_2_2d</div></td><td width="100%">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_2d</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2_2e</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_2e</td></tr><tr><td valign="top"><div class="tdn">kernel_2_3a</div></td><td width="100%">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_3a</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2_3b</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_3b</td></tr><tr><td valign="top"><div class="tdn">kernel_2_3c</div></td><td width="100%">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_3c</td></tr><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_2_3d</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_3d</td></tr><tr><td valign="top"><div class="tdn">kernel_2_3e</div></td><td width="100%">is a typedef for memory_manager_stateless_kernel_2 that uses memory_manager_3e</td></tr></table></div></blockquote></div><a name="pipe"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">pipe</h1><BR><BR> This is a first in first out queue with a fixed maximum size. It is suitable for passing objects between threads. <p> This object is optimized for speed, therefore, it uses global <tt>swap()</tt> to create a zero-copy method for moving objects around. For example, on a computer running Ubuntu 12.04 with a 2.67GHz Intel i7 920 CPU it is possible to pass over 4.4 million <tt>std::vector<int></tt> objects a second between two threads. This is regardless of the number of ints in the <tt>std::vector</tt> objects. In particular, this test was done with 100,000 ints in each <tt>std::vector</tt>. </p><p> Finally, note that you can use the pipe as an efficient method to pass messages between two networked computers by using the <a href="network.html#bridge">bridge</a>. </p><BR><BR>C++ Example Programs: <a href="pipe_ex.cpp.html">pipe_ex.cpp</a>, <a href="pipe_ex_2.cpp.html">pipe_ex_2.cpp</a>, <a href="bridge_ex.cpp.html">bridge_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/pipe/pipe_kernel_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/pipe.h></div></div></div><a name="ramdump"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">ramdump</h1><BR><BR> This is a type decoration used to indicate that serialization should be done by simply dumping the memory of some object to disk as fast as possible without any sort of conversions. This means that the data written will be "non-portable" in the sense that the format output by a RAM dump may depend on things like the endianness of your CPU or settings of certain compiler switches. <p> You use this object like this: <pre class="code_box"> serialize("yourfile.dat") << ramdump(yourobject); deserialize("yourfile.dat") >> ramdump(yourobject); </pre> or <pre class="code_box"> serialize(ramdump(yourobject), out); deserialize(ramdump(yourobject), in); </pre> Also, not all objects have a ramdump mode. If you try to use ramdump on an object that does not define a serialization dump for ramdump you will get a compiler error. </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/serialize.h.html#ramdump">More Details...</a><div class="include_file">#include <dlib/serialize.h></div></div></div><a name="serialize"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">serialize</h1><BR><BR> This is actually a set of overloaded functions which provide the ability to save an object's state to an output stream. Currently all dlib container classes, non pointer C++ intrinsics, std::string, std::vector, std::map, std::set, std::complex, dlib::bigint, dlib::uint64, dlib::int64, C style arrays, and dlib::vector objects are serializable. <p> You can also use serialize() and deserialize() to read/write Google protocol buffer objects. However, note that dlib::serialize() writes additional delimiting bytes at the start of each protocol buffer message. We do this because Google protocol buffers are not <a href="https://developers.google.com/protocol-buffers/docs/techniques#streaming">self-delimiting</a> on their own. This means that you can't write more than one protocol buffer object to an output stream unless you include some kind of delimiter between the messages. So dlib takes care of this for you by prefixing each message with its length in bytes. In particular, the number of bytes is encoded as a 32bit little endian integer. </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/serialize.h.html">More Details...</a><div class="include_file">#include <dlib/serialize.h></div></div></div><a name="statement"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">statement</h1><BR><BR> This object represents a SQL statement which can be executed against a <a href="#database">database</a> object. In particular, this object is a C++ wrapper around a <a href="http://www.sqlite.org">SQLite</a> prepared statement. <p> Note that this wrapper is targeted at SQLite Version 3. To use it you must make sure you link your application with SQLite. </p><BR><BR>C++ Example Programs: <a href="sqlite_ex.cpp.html">sqlite_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/sqlite/sqlite_abstract.h.html#statement">More Details...</a><div class="include_file">#include <dlib/sqlite.h></div></div></div><a name="std_allocator"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">std_allocator</h1><BR><BR> This object is an implementation of an allocator that conforms to the C++ standard requirements for allocator objects. The M template argument is one of the dlib memory manager objects and this allocator implementation will do all of its memory allocations using whatever dlib memory manager you supply. <p> Thus, using this allocator object you can use any of the dlib memory manager objects with the containers in the STL or with any other object that requires an STL style allocator object. </p><BR><BR>C++ Example Programs: <a href="std_allocator_ex.cpp.html">std_allocator_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/std_allocator.h.html">More Details...</a><div class="include_file">#include <dlib/std_allocator.h></div></div></div><a name="sync_extension"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">sync_extension</h1><BR><BR> This object represents a general extension to any object. This object gives any object which it extends an integrated rmutex and rsignaler object. The extended object will then be able to be treated as if it was also a <a href="dlib/threads/rmutex_extension_abstract.h.html#rmutex">rmutex</a> and <a href="dlib/threads/rsignaler_extension_abstract.h.html#rsignaler">rsignaler</a>. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/sync_extension/sync_extension_kernel_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/sync_extension.h></div></div><BR><BR><B>Implementations:</B><blockquote><a href="dlib/sync_extension/sync_extension_kernel_1.h.html">sync_extension_kernel_1</a>: <br> This is implemented using a <a href="dlib/threads/rmutex_extension_abstract.h.html#rmutex">rmutex</a> and <a href="dlib/threads/rsignaler_extension_abstract.h.html#rsignaler">rsignaler</a> in the obvious way. <div class="typedefs"><table CELLSPACING="0" CELLPADDING="0" bgcolor="white"><tr><td bgcolor="#E3E3E3" valign="top"><div class="tdn">kernel_1a</div></td><td width="100%" bgcolor="#E3E3E3">is a typedef for sync_extension_kernel_1</td></tr></table></div></blockquote></div><a name="timeout"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">timeout</h1><BR><BR> This object provides a simple way to implement a timeout. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/timeout/timeout_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/timeout.h></div></div></div><a name="timer"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">timer</h1><BR><BR> This object represents a timer that will call a given member function repeatedly at regular intervals. <p> The implementation of this object has a single master thread that does all the waiting. This master thread creates and dispatches threads to specific timer objects when they need to run their action functions. When a timer object isn't executing its action function then it doesn't have any thread allocated to it at all. So it is fairly efficient. </p><BR><BR>C++ Example Programs: <a href="timer_ex.cpp.html">timer_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/timer/timer_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/timer.h></div></div></div><a name="TIME_THIS"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">TIME_THIS</h1><BR><BR><p> This is a macro function for timing blocks of code. Its form is <tt>TIME_THIS(whatever you want to time)</tt> It's pretty straight forward. It just prints the time it took to std::cout. </p><p> There is another version of this function called TIME_THIS_TO which takes as a parameter an ostream object to write its output to. Its form is <tt>TIME_THIS_TO(what you want to time, the output stream)</tt>; </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/time_this.h.html">More Details...</a><div class="include_file">#include <dlib/time_this.h></div></div></div><a name="timing%20code%20blocks"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">timing code blocks</h1><BR><BR> This is a set of set of functions for timing blocks of code. Unlike <a href="#TIME_THIS">TIME_THIS</a>, it can be used to find the cumulative time spent on a block which is executed multiple times. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/timing.h.html">More Details...</a><div class="include_file">#include <dlib/timing.h></div></div></div><a name="transaction"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">transaction</h1><BR><BR> This object is a tool for creating exception safe <a href="#database">database</a> transactions. <BR><BR>C++ Example Programs: <a href="sqlite_ex.cpp.html">sqlite_ex.cpp</a><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/sqlite/sqlite_tools_abstract.h.html#transaction">More Details...</a><div class="include_file">#include <dlib/sqlite.h></div></div></div><a name="uint16"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">uint16</h1><BR><BR> This is just a typedef for a 16 bit unsigned integer. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/uintn.h.html#uint16">More Details...</a><div class="include_file">#include <dlib/uintn.h></div></div></div><a name="uint32"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">uint32</h1><BR><BR> This is just a typedef for a 32 bit unsigned integer. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/uintn.h.html#uint32">More Details...</a><div class="include_file">#include <dlib/uintn.h></div></div></div><a name="uint64"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">uint64</h1><BR><BR> This is just a typedef for a 64 bit unsigned integer. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/uintn.h.html#uint64">More Details...</a><div class="include_file">#include <dlib/uintn.h></div></div></div><a name="uint8"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">uint8</h1><BR><BR> This is just a typedef for an 8 bit unsigned integer. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/uintn.h.html#uint8">More Details...</a><div class="include_file">#include <dlib/uintn.h></div></div></div><a name="unserialize"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">unserialize</h1><BR><BR> This object effectively allows you to peek at the next serialized object in an istream. It does this by allowing you to read an object and then put it back. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/vectorstream/unserialize_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/vectorstream.h></div></div></div><a name="vectorstream"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">vectorstream</h1><BR><BR> This is an iostream object that reads and writes from an in-memory buffer. It functions very much the same way as the std::stringstream object. However, while the std::stringstream holds its buffer internally and it can only be accessed by copying it out, the vectorstream uses an external std::vector<char> as its buffer. That is, it holds a reference to an external vector and does not contain any internal buffers of its own. <p> This object is useful as a slightly more efficient alternative to the std::stringstream since you can avoid the overhead of copying buffer contents to and from the stream. This is particularly useful when used as a source or target for <a href="#serialize">serialization</a> routines. </p><BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/vectorstream/vectorstream_abstract.h.html">More Details...</a><div class="include_file">#include <dlib/vectorstream.h></div></div></div><a name="zero_extend_cast"></a><div class="component"><a href="#top"><font size="2"><center>[top]</center></font></a><h1 style="margin:0px;">zero_extend_cast</h1><BR><BR> This is a global function that performs a zero extending cast from one integral type to another integral type. <BR><div class="include_file_more_details_wrapper"><a class="more_details" href="dlib/uintn.h.html#zero_extend_cast">More Details...</a><div class="include_file">#include <dlib/uintn.h></div></div></div></div></body></html>