GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing dlib.net — dlib C++ Library - Containers The Library
Help/Info
Current Release Download dlib ver.20.0
Last Modified: Sep 17, 2023 Containers Many of these containers were inspired by the work of the Reusable Software Research Group at Ohio State. As such, many of the objects do not support copying in any form, only swapping is allowed. That is, when objects are added or removed from most of these containers they are swapped in and out, not copied. This allows you to do things like have containers of containers of containers without encountering the overhead of the massive copying that would likely result if you did the same thing with the STL. It also means you can store objects that are not copyable inside these containers, which is not something you can do with the STL prior to C++11. Note that it is assumed by these containers that swap() and operator< do not throw. They may not function correctly if this assumption is broken. Also note that the built in types (int, long, char, etc.) and std::string will not cause operator< or swap() to throw. Note also that most of the containers inherit from the enumerable interface. Thus, all the member functions inherited from enumerable are defined in the enumerable class and their documentation is not repeated in each container's documentation. This includes the size() member function in each container. Objects
Type Erasure
Interfaces anyThis object is basically a type-safe version of a void*. In particular, it is a container which can contain only one object but the object may be of any type. It is somewhat like the type_safe_union except you don't have to declare the set of possible content types beforehand. So in some sense this is like a less type-strict version of the type_safe_union. More Details... #include <dlib/any.h> any_decision_functionThis object is a version of dlib::any that is restricted to containing elements which are some kind of function object with an operator() with the following signature: result_type operator()(const sample_type&) const It is intended to be used to contain dlib::decision_function objects and other types which represent learned decision functions. It allows you to write code which contains and processes these decision functions without needing to know the specific types of decision functions used. More Details... #include <dlib/any.h> any_functionThis object is a version of dlib::any that is restricted to containing elements which are some kind of function or function object. More Details... #include <dlib/any.h> any_trainerThis object is a version of dlib::any that is restricted to containing elements which are some kind of object with a .train() method compatible with the following signature: decision_function train(
const std::vector<sample_type>& samples,
const std::vector<scalar_type>& labels
) const
Where decision_function is a type capable of being stored in an
any_decision_function object.
any_trainer is intended to be used to contain objects such as the svm_nu_trainer and other similar types which represent supervised machine learning algorithms. It allows you to write code which contains and processes these trainer objects without needing to know the specific types of trainer objects used. More Details... #include <dlib/any.h> arrayThis object represents a 1-Dimensional array of objects. More Details... #include <dlib/array.h> array2dThis object represents a 2-Dimensional array of objects. C++ Example Programs: image_ex.cpp More Details... #include <dlib/array2d.h> binary_search_treeThis object represents a data dictionary that is built on top of some kind of binary search tree. More Details... #include <dlib/binary_search_tree.h> Implementations: binary_search_tree_kernel_1: binary_search_tree_kernel_2: circular_bufferThis object represents a simple sliding buffer which can contain and arbitrary number of elements. More Details... #include <dlib/sliding_buffer.h> directed_graphThis object represents a directed graph which is a set of nodes with directed edges connecting various nodes. More Details... #include <dlib/directed_graph.h> Implementations: directed_graph_kernel_1: enumerableThis object is an abstract class which represents an interface for iterating over all the elements of a container. More Details... #include <dlib/interfaces/enumerable.h> graphThis object represents a graph which is a set of nodes with undirected edges connecting various nodes. More Details... #include <dlib/graph.h> Implementations: graph_kernel_1: hash_mapThis object represents a hashed mapping of items of type domain onto items of type range. More Details... #include <dlib/hash_map.h> Implementations: hash_map_kernel_1: hash_setThis object represents a hashed unordered and unaddressed collection of unique items. More Details... #include <dlib/hash_set.h> Implementations: hash_set_kernel_1: hash_tableThis object represents a data dictionary that is built on top of some kind of hash table. More Details... #include <dlib/hash_table.h> Implementations: hash_table_kernel_1: hash_table_kernel_2: mapThis object represents a mapping of items of type domain onto items of type range. More Details... #include <dlib/map.h> Implementations: map_kernel_1: map_pairThis object is an abstract class which represents an interface for accessing a pair from a container such as the map, hash_table, etc. More Details... #include <dlib/interfaces/map_pair.h> optionalThis is a standard's compliant backport of std::optional that works with C++14. It includes C++23 monadic interfaces More Details... #include <dlib/optional.h> queueThis object represents a first in first out queue. C++ Example Programs: queue_ex.cpp More Details... #include <dlib/queue.h> Implementations: queue_kernel_1: queue_kernel_2: Extensions to queuequeue_sort This extension gives a queue the ability to sort its contents. More Details... Implementations: queue_sort_1: reference_counterThis object represents a container for an object and provides reference counting capabilities for the object it contains. More Details... #include <dlib/reference_counter.h> Implementations: reference_counter_kernel_1: reference_wrapperThis is a simple object that just holds a reference to another object. It is useful because it can serve as a kind of "copyable reference". C++ Example Programs: thread_function_ex.cpp More Details... #include <dlib/ref.h> removerThis is a set of interfaces which gives the ability to remove all the items in a container without actually knowing what kind of container contains them. More Details... #include <dlib/interfaces/remover.h> sequenceThis object represents an ordered sequence of items, each item is associated with an integer value. The items are numbered from 0 to the number of items in the sequence minus 1. More Details... #include <dlib/sequence.h> Implementations: sequence_kernel_1: sequence_kernel_2: Extensions to sequencesequence_compare This extension gives sequences the ability to compare themselves using operator< and operator==. Thus they can be used in the other container classes that require this ability. (maps, sets, etc.) More Details... Implementations: sequence_compare_1: sequence_sort This extension gives a sequence the ability to sort its contents. More Details... Implementations: sequence_sort_1: sequence_sort_2: setThis object represents an unordered and unaddressed collection of unique items. More Details... #include <dlib/set.h> Implementations: set_kernel_1: Extensions to setset_compare This extension gives sets the ability to compare themselves using operator< and operator==. Thus they can be used in the other container classes that require this ability. (maps, sets, etc.) More Details... Implementations: set_compare_1: sliding_bufferThis object represents an array with the ability to rotate its contents left or right. Note that the size of this object is always a power of two. If you need arbitrary sized objects then use a circular_buffer. More Details... #include <dlib/sliding_buffer.h> Implementations: sliding_buffer_kernel_1: stackThis object represents a last in first out stack. More Details... #include <dlib/stack.h> Implementations: stack_kernel_1: static_mapThis object represents a mapping of items of type domain onto items of type range. The difference between this object and the normal map object is that it does not support adding or removing individual objects from itself. This allows implementations to focus on using less memory and achieving faster searching. More Details... #include <dlib/static_map.h> Implementations: static_map_kernel_1: static_setThis object represents an unordered and unaddressed collection of items. The difference between this object and the normal set object is that it does not support adding or removing individual objects from itself. This allows implementations to focus on using less memory and achieving faster searching. More Details... #include <dlib/static_set.h> Implementations: static_set_kernel_1: Extensions to static_setstatic_set_compare This extension gives static_sets the ability to compare themselves using operator< and operator==. Thus they can be used in the other container classes that require this ability. (maps, static_sets, etc.) More Details... Implementations: static_set_compare_1: std_vector_cThis object is a simple wrapper around the std::vector object. It provides an identical interface but also checks the preconditions of each member function. That is, if you violate a requires clause the dlib::fatal_error exception is thrown. More Details... #include <dlib/stl_checked.h> storage_heapThis object is basically a type-safe version of a void*. In particular, it is a container which can contain only one object but the object may be of any type. Importantly, this container stores the object on the heap. This class is meant to be a lower level tool used to implement other higher level containers or APIs that depend on type erasure. More Details... #include <dlib/any.h> storage_sboThis object is basically a type-safe version of a void*. In particular, it is a container which can contain only one object but the object may be of any type. This container uses the small buffer optimization to store small objects on the stack, but larger objects on the heap. This class is meant to be a lower level tool used to implement other higher level containers or APIs that depend on type erasure. More Details... #include <dlib/any.h> storage_sharedThis object is basically a type-safe version of a void*. In particular, it is a container which can contain only one object but the object may be of any type. This container stores the object it contains in a std::shared_ptr, and therefore has reference rather than value semantics, as well as storage on the heap. This class is meant to be a lower level tool used to implement other higher level containers or APIs that depend on type erasure. More Details... #include <dlib/any.h> storage_stackThis object is basically a type-safe version of a void*. In particular, it is a container which can contain only one object but the object may be of any type. Importantly, this container stores the object on the stack. This class is meant to be a lower level tool used to implement other higher level containers or APIs that depend on type erasure. More Details... #include <dlib/any.h> storage_viewThis object is basically a type-safe version of a void*. In particular, it is a container which can contain only one object but the object may be of any type. This container doesn't actually store the object it contains, rather, it is a non-owning view of that object. It therefore has reference semantics just as a void* would. This class is meant to be a lower level tool used to implement other higher level containers or APIs that depend on type erasure. More Details... #include <dlib/any.h> tupleThis is an implementation of a very simple templated container object. It contains between 0 and 31 objects where each object is listed explicitly in the tuple's template arguments. Note that there is only one implementation of this object so there aren't any different kernels to choose from when you create instances of the tuple object. So for example, you could declare a tuple of 3 ints using the following statement: dlib::tuple<int,int,int> t; More Details... #include <dlib/tuple.h> type_safe_unionThis object is a type safe analogue of the classic C union object. The type_safe_union, unlike a union, can contain non-POD types such as std::string. It is also implemented without performing any heap memory allocations and instead it stores everything on the stack. C++ Example Programs: pipe_ex_2.cpp, bridge_ex.cpp More Details... #include <dlib/type_safe_union.h> unordered_pairThis object is very similar to the std::pair struct except unordered_pair is only capable of representing an unordered set of two items rather than an ordered list of two items like std::pair. More Details... #include <dlib/unordered_pair.h> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |