xtd 0.2.0
Loading...
Searching...
No Matches

Definition

Contains generic collections definitions.

Modules

 helpers
 Contains helpers generic collections definitions.
 

Classes

class  xtd::collections::generic::comparer< type_t >
 Provides a base class for implementations of the xtd::collections::generic::icomparer <type_t> generic interface. More...
 
class  xtd::collections::generic::empty_comparer< type_t >
 Provides an empty comparer class. More...
 
class  xtd::collections::generic::enumerable_iterators< type_t, enumerable_t >
 Internal enumarable iterators definition. More...
 
class  xtd::collections::generic::enumerator< type_t >
 Supports a simple iteration over a generic collection. More...
 
class  xtd::collections::generic::icollection< type_t >
 Defines methods to manipulate generic collections. More...
 
class  xtd::collections::generic::icomparer< type_t >
 Exposes a method that compares two objects. More...
 
class  xtd::collections::generic::ienumerable< type_t >
 Exposes the enumerator, which supports a simple iteration over a collection of a specified type. More...
 
class  xtd::collections::generic::ienumerator< type_t >
 Supports a simple iteration over a generic collection. More...
 
class  xtd::collections::generic::iequality_comparer< type_t >
 Defines methods to support the comparison of objects for equality. More...
 
class  xtd::collections::generic::ilist< type_t >
 Represents a collection of objects that can be individually accessed by index. More...
 
class  xtd::collections::generic::list< type_t, allocator_t >
 Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists. More...
 

Typedefs

template<typename key_t , typename value_t >
using xtd::collections::generic::dictionary = std::unordered_map< key_t, value_t, helpers::hasher< key_t >, helpers::equator< key_t >, helpers::allocator< std::pair< const key_t, value_t > > >
 Represents a collection of keys and values.
 
template<typename type_t >
using xtd::collections::generic::hash_set = std::unordered_set< type_t, helpers::hasher< type_t >, helpers::equator< type_t >, helpers::allocator< type_t > >
 Represents a set of values.
 
template<typename key_t , typename value_t >
using xtd::collections::generic::key_value_pair = std::pair< key_t, value_t >
 Defines a key/value pair that can be set or retrieved.
 
template<typename key_t , typename value_t >
using xtd::collections::generic::sorted_dictionary = std::map< key_t, value_t, helpers::comparer< key_t >, helpers::allocator< std::pair< const key_t, value_t > > >
 Represents a collection of key/value pairs that are sorted on the key.
 
template<typename type_t >
using xtd::collections::generic::sorted_set = std::set< type_t, helpers::comparer< type_t >, helpers::allocator< type_t > >
 Represents a collection of objects that is maintained in sorted order.
 

Typedef Documentation

◆ dictionary

template<typename key_t , typename value_t >
using xtd::collections::generic::dictionary = typedef std::unordered_map<key_t, value_t, helpers::hasher<key_t>, helpers::equator<key_t>, helpers::allocator<std::pair<const key_t, value_t> >>

#include <xtd.core/include/xtd/collections/generic/dictionary.hpp>

Represents a collection of keys and values.

Definition
template<typename key_t, typename value_t>
using dictionary = std::unordered_map<key_t, value_t, helpers::hasher<key_t>, helpers::equator<key_t>, helpers::allocator<std::pair<const key_t, value_t>>>;
std::unordered_map< key_t, value_t, helpers::hasher< key_t >, helpers::equator< key_t >, helpers::allocator< std::pair< const key_t, value_t > > > dictionary
Represents a collection of keys and values.
Definition dictionary.hpp:36
std::allocator< type_t > allocator
Represent an allocator alias.
Definition allocator.hpp:35
Implements a function object for performing comparisons. Unless specialised, invokes operator== on ty...
Definition equator.hpp:37
Header
#include <xtd/collections/dictionary
Namespace
xtd::collections::generic
Library
xtd.core
Remarks
The xtd::collections::generic::dictionary class is same as std::unordered_map.
Examples
The following shows how to use xtd::collections::generic::dictionary.

◆ hash_set

template<typename type_t >
using xtd::collections::generic::hash_set = typedef std::unordered_set<type_t, helpers::hasher<type_t>, helpers::equator<type_t>, helpers::allocator<type_t> >

#include <xtd.core/include/xtd/collections/generic/hash_set.hpp>

Represents a set of values.

Definition
template<typename type_t>
using hash_set = std::unordered_set<type_t, helpers::hasher<type_t>, helpers::equator<type_t>, helpers::allocator<type_t>>;
std::unordered_set< type_t, helpers::hasher< type_t >, helpers::equator< type_t >, helpers::allocator< type_t > > hash_set
Represents a set of values.
Definition hash_set.hpp:33
Header
#include <xtd/collections/hash_set
Namespace
xtd::collections::generic
Library
xtd.core
Remarks
The xtd::collections::generic::hash_set class is same as std::unordered_set.

◆ key_value_pair

template<typename key_t , typename value_t >
using xtd::collections::generic::key_value_pair = typedef std::pair<key_t, value_t>

#include <xtd.core/include/xtd/collections/generic/key_value_pair.hpp>

Defines a key/value pair that can be set or retrieved.

template<typename key_t, typename value_t>
using key_value_pair = std::pair<key_t, value_t>;
std::pair< key_t, value_t > key_value_pair
Defines a key/value pair that can be set or retrieved.
Definition key_value_pair.hpp:29
Header
#include <xtd/collections/key_value_pair>
Namespace
xtd::collections::generic
Library
xtd.core
Remarks
xtd::collections::generic::key_value_pair is an alias of std::pair.

◆ sorted_dictionary

template<typename key_t , typename value_t >
using xtd::collections::generic::sorted_dictionary = typedef std::map<key_t, value_t, helpers::comparer<key_t>, helpers::allocator<std::pair<const key_t, value_t> >>

#include <xtd.core/include/xtd/collections/generic/sorted_dictionary.hpp>

Represents a collection of key/value pairs that are sorted on the key.

Definition
template<typename key_t, typename value_t>
using sorted_dictionary = std::map<key_t, value_t, helpers::comparer<key_t>, helpers::allocator<std::pair<const key_t, value_t>>>;
std::map< key_t, value_t, helpers::comparer< key_t >, helpers::allocator< std::pair< const key_t, value_t > > > sorted_dictionary
Represents a collection of key/value pairs that are sorted on the key.
Definition sorted_dictionary.hpp:36
Header
#include <xtd/collections/sorted_dictionary
Namespace
xtd::collections::generic
Library
xtd.core
Remarks
The xtd::collections::generic::sorted_dictionary class is same as std::map.
A xtd::collections::generic::sorted_dictionary object maintains a sorted order without affecting performance as elements are inserted and deleted. Duplicate elements are ! allowed. Changing the sort values of existing items is ! supported and may lead to unexpected behavior.
Examples
The following shows how to use xtd::collections::generic::sorted_dictionary.

◆ sorted_set

template<typename type_t >
using xtd::collections::generic::sorted_set = typedef std::set<type_t, helpers::comparer<type_t>, helpers::allocator<type_t> >

#include <xtd.core/include/xtd/collections/generic/sorted_set.hpp>

Represents a collection of objects that is maintained in sorted order.

Definition
template<typename type_t>
using sorted_set = std::set<type_t, helpers::comparer<type_t>, helpers::allocator<type_t>>;
std::set< type_t, helpers::comparer< type_t >, helpers::allocator< type_t > > sorted_set
Represents a collection of objects that is maintained in sorted order.
Definition sorted_set.hpp:36
Header
#include <xtd/collections/sorted_set
Namespace
xtd::collections::generic
Library
xtd.core
Remarks
The xtd::collections::generic::sorted_set class is same as std::set.
A xtd::collections::generic::sorted_set object maintains a sorted order without affecting performance as elements are inserted and deleted. Duplicate elements are ! allowed. Changing the sort values of existing items is ! supported and may lead to unexpected behavior.
Examples
The following example demonstrates how to merge two disparate sets. This example creates two xtd::collections::generic::sorted_set objects, and populates them with even and odd numbers, respectively. A third xtd::collections::generic::sorted_set object is created from the set that contains the even numbers. The example then calls the UnionWith method, which adds the odd number set to the third set.