STAPL API Reference |
Modules Classes |
STAPL utility files shared by multiple components. More...
Classes | |
struct | stapl::utility::identity< T > |
Helper unary function object that returns input value. More... | |
struct | stapl::empty_class |
Empty class. More... | |
struct | stapl::hash< T > |
Default hash function for sequential hash containers. More... | |
class | stapl::hash_map< _Key, _Tp, _HashFcn, _EqualKey, _Alloc > |
Container that stores key-value pairs by hashing the key to determine the position in the container where the elements will be stored. More... | |
struct | stapl::_Hashtable_iterator< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc > |
Iterator over the hashtable. More... | |
struct | stapl::_Hashtable_const_iterator< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc > |
Iterator over the hashtable. More... | |
class | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc > |
The Hashtable containing all the elements. More... | |
struct | stapl::integer_sequence< T, Ints > |
A compile-time sequence of integers. More... | |
struct | stapl::make_index_sequence_impl< N, Ints > |
Implementation of make_index_sequence. More... | |
struct | stapl::is_index_sequence< T > |
Metafunction to compute whether or not a type is an index_sequence. More... | |
struct | stapl::invoke_arg< Arg > |
Wrapper used to specify the argument type during a function call declaration. More... | |
struct | stapl::memory_used< T > |
Returns an estimation of size of the passed object. More... | |
struct | stapl::memory_used< std::map< Key, T > > |
Specialization used when the type is an std::map<>. More... | |
struct | stapl::memory_used< std::list< T > > |
Specialization used when the type is an std::list<>. More... | |
struct | stapl::stream_impl::stream_wrapper_impl< Stream > |
A wrapper around a stream that is a p_object. A pointer to an instance is stored in stapl::stream instances provided to work functions to allow access to the stream on the location. More... | |
struct | stapl::stream< Stream > |
A wrapper around a stream whose instances can be kept as data members of work functions. The wrapper allows work functions to access to the stream any location to which they may be sent via RMI invocation. More... | |
struct | stapl::type_printer< T > |
Prints the given type through the apply(std::ostream&) function. More... | |
struct | stapl::typelist_printer< T > |
Prints the given list of types to the std::ostream . More... | |
struct | stapl::vs_map_helper< Map, Size, bool > |
Helper method for vs_map that does most of the actual work. Is passed the size of the tuples and this is used by the preprocessing below to create size specific specialization of this class template. Each specialization defines a static function with corresponding arity and repetition of operations. More... | |
Modules | |
Directory | |
The directory used for message routing in the PARAGRAPH and pContainers. | |
Boost/C++11 Tuple Wrapper | |
Macros | |
#define | STAPL_HAS_MEMBER_FUNCTION(func, name) |
Macro which creates a type metafunction that deduces whether a given struct/class defines a member function with a specified name and signature. More... | |
#define | STAPL_VERSION 20140905 |
STAPL version number based on date of release. More... | |
#define | STAPL_LIB_VERSION "2014_09_05" |
STAPL version number as a string. More... | |
Typedefs | |
template<std::size_t... Ints> | |
using | stapl::index_sequence = integer_sequence< std::size_t, Ints... > |
Helper alias template for integer_sequence for std::size_t . | |
template<std::size_t N> | |
using | stapl::make_index_sequence = typename make_index_sequence_impl< N >::type |
Creates an index_sequence with the values 0, 1, ..., N-1 . | |
Functions | |
template<typename F , typename... Args> | |
auto | stapl::do_once (F &&f, Args &&... args) -> decltype(f(std::forward< Args >(args)...)) |
When called in SPMD code section, invokes specified function once globally (i.e., on one and only one location of computation). More... | |
template<typename DerivedPtr , typename Base > | |
DerivedPtr | stapl::down_cast (Base *const base_ptr) |
Perform downcast of a pointer from a base class to a derived class. In debug mode, use dynamic_cast and test with assertion. Otherwise, use static_cast<>(). | |
template<typename Derived , typename Base > | |
Derived & | stapl::down_cast (Base &base_ref) |
Perform downcast of a reference from a base class to a derived class. In debug mode, use dynamic_cast and test with assertion. Otherwise, use static_cast<>(). | |
template<typename Derived , typename Base > | |
Derived const & | stapl::down_cast (Base const &base_ref) |
Perform downcast of a const reference from a base class to a derived class In debug mode, use dynamic_cast and test with assertion. Otherwise, use static_cast<>(). | |
template<class _Key , class _Tp , class _HashFn , class _EqKey , class _Alloc > | |
bool | stapl::operator== (const hash_map< _Key, _Tp, _HashFn, _EqKey, _Alloc > &, const hash_map< _Key, _Tp, _HashFn, _EqKey, _Alloc > &) |
template<class _Key , class _Tp , class _HashFcn , class _EqlKey , class _Alloc > | |
void | stapl::swap (hash_map< _Key, _Tp, _HashFcn, _EqlKey, _Alloc > &__hm1, hash_map< _Key, _Tp, _HashFcn, _EqlKey, _Alloc > &__hm2) |
Swaps the content of two hash_map. More... | |
unsigned long | stapl::__stl_next_prime (unsigned long __n) |
Returns the next prime number from a list of prime numbers. More... | |
template<class _Val , class _Key , class _HF , class _Ex , class _Eq , class _All > | |
bool | stapl::operator== (const hashtable< _Val, _Key, _HF, _Ex, _Eq, _All > &__ht1, const hashtable< _Val, _Key, _HF, _Ex, _Eq, _All > &__ht2) |
template<class _Val , class _Key , class _HF , class _ExK , class _EqK , class _All > | |
_Val * | stapl::value_type (const _Hashtable_iterator< _Val, _Key, _HF, _ExK, _EqK, _All > &) |
Converts an iterator to a null pointer of pointer-to-value_type. | |
template<class _Val , class _Key , class _HF , class _ExK , class _EqK , class _All > | |
hashtable< _Val, _Key, _HF, _ExK, _EqK, _All >::difference_type * | stapl::distance_type (const _Hashtable_iterator< _Val, _Key, _HF, _ExK, _EqK, _All > &) |
Converts an iterator to a null pointer of pointer-to-difference_type. | |
template<class _Val , class _Key , class _HF , class _ExK , class _EqK , class _All > | |
std::bidirectional_iterator_tag | stapl::iterator_category (const _Hashtable_const_iterator< _Val, _Key, _HF, _ExK, _EqK, _All > &) |
Returns the iterator category tag of the hashtable : std::bidirectional_iterator_tag. | |
template<class _Val , class _Key , class _HF , class _ExK , class _EqK , class _All > | |
_Val * | stapl::value_type (const _Hashtable_const_iterator< _Val, _Key, _HF, _ExK, _EqK, _All > &) |
Converts an iterator to a null pointer of pointer-to-value_type. | |
template<class _Val , class _Key , class _HF , class _ExK , class _EqK , class _All > | |
hashtable< _Val, _Key, _HF, _ExK, _EqK, _All >::difference_type * | stapl::distance_type (const _Hashtable_const_iterator< _Val, _Key, _HF, _ExK, _EqK, _All > &) |
Converts an iterator to a null pointer of pointer-to-difference_type. | |
template<class _Val , class _Key , class _HF , class _Extract , class _EqKey , class _All > | |
void | stapl::swap (hashtable< _Val, _Key, _HF, _Extract, _EqKey, _All > &__ht1, hashtable< _Val, _Key, _HF, _Extract, _EqKey, _All > &__ht2) |
Swaps the content of two hashtable. More... | |
std::ostream & | stapl::operator<< (std::ostream &s, const loc_qual q) |
Output operator overload for the location qualifier enum loc_qual. | |
template<typename Map > | |
std::size_t | stapl::memory_size_impl::helper_map_size (Map const &map) |
Estimate the size of the given std::map<> object. More... | |
template<typename Set > | |
std::size_t | stapl::memory_size_impl::helper_set_size (Set const &set) |
Estimate the size of the given std::set<> object. More... | |
template<typename Map , typename VS0 , typename ... ViewSets> | |
auto | stapl::vs_map (Map const &fmap, VS0 &&vs0, ViewSets &... viewsets) -> decltype(vs_map_helper< Map, tuple_size< typename std::decay< VS0 >::type >::value >()(fmap, std::forward< VS0 >(vs0), viewsets...)) |
Invokes the input functor tuple_size<VS0> times, using the ith element of each viewset as argument. More... | |
template<typename Map , typename Reduce , typename... VS> | |
Reduce::result_type | stapl::vs_map_reduce (Map const &fmap, Reduce const &freduce, typename Reduce::result_type const &init, VS... vs) |
Invokes fmap tuple_size<ViewSet0> times, using the ith element of each viewset as argument. The return values of these invocations are then reduced to a single value using freduce and returned from the function. More... | |
iterator & | stapl::_Hashtable_iterator< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::operator-- () |
const_iterator & | stapl::_Hashtable_const_iterator< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::operator-- () |
std::pair< iterator, bool > | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::insert_unique_noresize (const value_type &__obj) |
Inserts a new element in the container without resizing the buckets. More... | |
iterator | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::insert_equal_noresize (const value_type &__obj) |
Inserts a new element in the container without resizing the buckets. If other elements with the same key already are in the container, it inserts the new element after the first element with the same key. More... | |
reference | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::find_or_insert (const value_type &__obj) |
Returns a reference to a searched object. If the object was not found, inserts the object in the hashtable. More... | |
std::pair< iterator, iterator > | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::equal_range (const key_type &__key) |
Return a range that includes all the elements with a specific key. More... | |
std::pair< const_iterator, const_iterator > | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::equal_range (const key_type &__key) const |
Return a range that includes all the elements with a specific key. More... | |
size_type | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::erase (const key_type &__key) |
Removes all elements with the specified key from the container. More... | |
void | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::erase (const iterator &__it) |
Removes an element pointed by an iterator from the container. More... | |
void | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::erase (iterator __first, iterator __last) |
Removes some elements pointed by an iterator from the container. More... | |
void | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::erase (const_iterator __first, const_iterator __last) |
Removes some elements pointed by an iterator from the container. More... | |
void | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::erase (const const_iterator &__it) |
Removes an element pointed by an iterator from the container. More... | |
void | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::resize (size_type __num_elements_hint) |
Increases the bucket count to at least __hint. | |
void | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::_M_erase_bucket (const size_type __n, _Node_base *__first, _Node_base *__last) |
Removes all the elements in a range from a specific bucket. More... | |
void | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::_M_erase_bucket (const size_type __n, _Node_base *__last) |
Removes all the elements in a range from a specific bucket. More... | |
void | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::clear () |
Removes all the elements from the container. | |
void | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::_M_copy_from (const hashtable &__ht) |
Copy all the elements from another hashtable. More... | |
size_type | stapl::hashtable< _Val, _Key, _HashFcn, _ExtractKey, _EqualKey, _Alloc >::memory_size (void) const |
Returns the size in the memory used by the container. | |
Variables | |
template<typename... U> | |
typelist_printer< U... > | object_type_printer (U...) |
Creates a typelist_printer from the list of objects. | |
STAPL utility files shared by multiple components.
#define STAPL_HAS_MEMBER_FUNCTION | ( | func, | |
name | |||
) |
Macro which creates a type metafunction that deduces whether a given struct/class defines a member function with a specified name and signature.
func | Name of member function to detect. |
name | Name of created metafunction. |
T | Class type to inspect for existence of func . |
Sign | The type signature of func . |
#define STAPL_VERSION 20140905 |
STAPL version number based on date of release.
STAPL_VERSION % 100
is the day of the release.STAPL_VERSION / 100 % 100
is the month of the release.STAPL_VERSION / 10000
is the year of the release. #define STAPL_LIB_VERSION "2014_09_05" |
STAPL version number as a string.
STAPL_LIB_VERSION is the same as STAPL_VERSION in the form year_month_day
.
auto stapl::do_once | ( | F && | f, |
Args &&... | args | ||
) | -> decltype(f(std::forward<Args>(args)...)) |
When called in SPMD code section, invokes specified function once globally (i.e., on one and only one location of computation).
f | Function object to be called once. |
args | List of arguments to pass to functor invocation. |
Right now, location 0 always invokes function. Primary template matches function objects.
bool stapl::operator== | ( | const hash_map< _Key, _Tp, _HashFn, _EqKey, _Alloc > & | , |
const hash_map< _Key, _Tp, _HashFn, _EqKey, _Alloc > & | |||
) |
unsigned long stapl::__stl_next_prime | ( | unsigned long | __n | ) |
Returns the next prime number from a list of prime numbers.
__n | The current prime number |
bool stapl::operator== | ( | const hashtable< _Val, _Key, _HF, _Ex, _Eq, _All > & | __ht1, |
const hashtable< _Val, _Key, _HF, _Ex, _Eq, _All > & | __ht2 | ||
) |
void stapl::swap | ( | hashtable< _Val, _Key, _HF, _Extract, _EqKey, _All > & | __ht1, |
hashtable< _Val, _Key, _HF, _Extract, _EqKey, _All > & | __ht2 | ||
) |
Swaps the content of two hashtable.
__ht1,__ht2 | The two hashtable. |
std::size_t stapl::memory_size_impl::helper_map_size | ( | Map const & | map | ) |
Estimate the size of the given std::map<> object.
map | the std::map<> object whose size needs to be estimated. |
std::size_t stapl::memory_size_impl::helper_set_size | ( | Set const & | set | ) |
Estimate the size of the given std::set<> object.
set | the std::set<> object whose size needs to be estimated. |
auto stapl::vs_map | ( | Map const & | fmap, |
VS0 && | vs0, | ||
ViewSets &... | viewsets | ||
) | -> decltype(vs_map_helper< Map, tuple_size<typename std::decay<VS0>::type>::value >()(fmap, std::forward<VS0>(vs0), viewsets...)) |
Invokes the input functor tuple_size<VS0> times, using the ith element of each viewset as argument.
fmap | Functor to apply. Arity defined by tuple_size of vs . |
vs0 | First tuple of arguments to be passed to incations of fmap . |
viewsets | Variadic number of tuples from which arguments to successive invocation of fmap are obtained. |
Example behavior for vs_map(MapFunctor, ViewSet0, ViewSet1): fmap(get<0>ViewSet0, get<0>ViewSet1); fmap(get<1>ViewSet0, get<1>ViewSet1);
Reduce::result_type stapl::vs_map_reduce | ( | Map const & | fmap, |
Reduce const & | freduce, | ||
typename Reduce::result_type const & | init, | ||
VS... | vs | ||
) |
Invokes fmap
tuple_size<ViewSet0> times, using the ith element of each viewset as argument. The return values of these invocations are then reduced to a single value using freduce
and returned from the function.
fmap | Functor to apply to tuple list. Arity defined by tuple_size of vs . |
freduce | Functor to apply to result of fmap applications. |
init | value with which the return is initialized before the reduction begins. |
vs | Variadic number of tuples from which arguments to successive invocation of fmap are obtained. |
Example behavior for vs_map_reduce(MapFunctor, ReduceFunctor, init, ViewSet0, ViewSet1):
init = freduce(init, fmap(get<0>ViewSet0, get<0>ViewSet1)); init = freduce(init, fmap(get<1>ViewSet0, get<1>ViewSet1)); ... return init;
_Hashtable_iterator< _Val, _Key, _HF, _ExK, _EqK, _All > & stapl::_Hashtable_iterator< _Val, _Key, _HF, _ExK, _EqK, _All >::operator-- | ( | ) |
_Hashtable_const_iterator< _Val, _Key, _HF, _ExK, _EqK, _All > & stapl::_Hashtable_const_iterator< _Val, _Key, _HF, _ExK, _EqK, _All >::operator-- | ( | ) |
std::pair< typename hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::iterator, bool > stapl::hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::insert_unique_noresize | ( | const value_type & | __obj | ) |
Inserts a new element in the container without resizing the buckets.
__obj | The element to be inserted. |
hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::iterator stapl::hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::insert_equal_noresize | ( | const value_type & | __obj | ) |
Inserts a new element in the container without resizing the buckets. If other elements with the same key already are in the container, it inserts the new element after the first element with the same key.
__obj | The element to be inserted. |
hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::reference stapl::hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::find_or_insert | ( | const value_type & | __obj | ) |
Returns a reference to a searched object. If the object was not found, inserts the object in the hashtable.
__obj | The element to be found or inserted. |
std::pair< typename hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::iterator, typename hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::iterator > stapl::hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::equal_range | ( | const key_type & | __key | ) |
Return a range that includes all the elements with a specific key.
__key | The key indexing the element. |
std::pair< typename hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::const_iterator, typename hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::const_iterator > stapl::hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::equal_range | ( | const key_type & | __key | ) | const |
Return a range that includes all the elements with a specific key.
__key | The key indexing the element. |
hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::size_type stapl::hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::erase | ( | const key_type & | __key | ) |
Removes all elements with the specified key from the container.
__key | The key indexing the element. |
void stapl::hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::erase | ( | const iterator & | __it | ) |
Removes an element pointed by an iterator from the container.
__it | The iterator over the element to delete. |
void stapl::hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::erase | ( | iterator | __first, |
iterator | __last | ||
) |
Removes some elements pointed by an iterator from the container.
__first,__last | Input iterators delimiting a range of elements to delete. The range of elements is [__first,__last). |
void stapl::hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::erase | ( | const_iterator | __first, |
const_iterator | __last | ||
) |
Removes some elements pointed by an iterator from the container.
__first,__last | Input iterators delimiting a range of elements to delete. The range of elements is [__first,__last). |
void stapl::hashtable< _Val, _Key, _HF, _Ex, _Eq, _All >::erase | ( | const const_iterator & | __it | ) |
Removes an element pointed by an iterator from the container.
__it | The iterator over the element to delete. |
|
protected |
Removes all the elements in a range from a specific bucket.
__n | The index of the bucket where the deletions will occur. |
__first,__last | Pointers delimiting a range of elements to delete. The range of elements is [__first,__last). |
|
protected |
Removes all the elements in a range from a specific bucket.
__n | The index of the bucket where the deletions will occur. |
__last | Pointer delimiting the end of the range of elements to delete. The range of elements is [begin of the hashtable,__last). |
|
protected |
Copy all the elements from another hashtable.
__ht | The hashtable to copy from. |