![]() |
ATLAS Offline Software
|
Namespaces | |
| namespace | detail |
| namespace | fpcompare |
| namespace | fpcompare_fn |
| namespace | vecDetail |
Classes | |
| class | ArrayIterator |
Iterator class for Array<N>. More... | |
| class | WritableArray |
| Read-write multidimensional array. More... | |
| class | ArrayIteratorChooser |
Helper for defining iterators over Array's. More... | |
| class | ArrayIteratorChooser< 1 > |
Helper for defining iterators over Array's, specialized for N == 1. More... | |
| class | Array |
| Read-only multidimensional array. More... | |
| class | Array< 0 > |
Read-only multidimensional array, specialized for N=0. More... | |
| class | WritableArray< 0 > |
| class | WritableArrayData |
| class | ArrayScanner |
| Helper class for converting strings to Array's. More... | |
| class | BitPacker |
| Pack a set of values bitwise into a stream. More... | |
| class | BitPacker8 |
| Pack a set of values bitwise into a stream. More... | |
| class | BitPacker16 |
| Pack a set of values bitwise into a stream. More... | |
| class | BitUnpacker |
| Helper to unpack a set of values bitwise from a stream. More... | |
| class | BitUnpacker8 |
| Helper to unpack a set of values bitwise from a stream. More... | |
| class | BitUnpacker16 |
| Helper to unpack a set of values bitwise from a stream. More... | |
| union | CachedPointer |
| Cached pointer with atomic update. More... | |
| class | CachedUniquePtrT |
| Cached pointer with atomic update. More... | |
| class | CachedValue |
| Cached value with atomic update. More... | |
| class | ExcBadClassName |
| Recursively separate out template arguments in a C++ class name. More... | |
| class | ExcMissingVariable |
| Exception to signal a missing variable. More... | |
| class | Rules |
A set of transformation rules to use with ClassName. More... | |
| class | reference |
| A reference to one bit in a set. More... | |
| class | const_iterator |
| Iterator over all 1 bits in the set. More... | |
| class | Impl |
| Implementation object. More... | |
| class | ConcurrentPtrSet |
| A set of pointers, allowing concurrent, lockless queries. More... | |
| class | IRangeMapPayloadDeleter |
| Helper to delete payload objects for ConcurrentRangeMap. More... | |
| struct | DeletePayload |
| Map from range to payload object, allowing concurrent, lockless reads. More... | |
| class | ConcurrentStrMap |
| Hash map from strings allowing concurrent, lockless reads. More... | |
| class | ConcurrentStrToValMap |
| Hash map from strings to arbitrary objects allowing concurrent, lockless reads. More... | |
| class | iterator |
| Iterator class. More... | |
| class | FloatCompressor |
| Class implementing a lossy float compression. More... | |
| class | FloatPacker |
| Pack/unpack floating-point data from/to a given number of bits. More... | |
| class | iterator_range |
| Simple range from a pair of iterators. More... | |
| class | LockedPointer |
| A pointer together with a movable lock. More... | |
| class | CMurmurHash2A |
| class | PackedArray |
| An array of unsigned values of some bit size, packed tightly. More... | |
| class | pointer_list_base |
| A fast way to store a variable-sized collection of pointers. More... | |
| class | pointer_list |
| A fast way to store a variable-sized collection of pointers. More... | |
| class | range_with_at |
| Add at() methods to a range class. More... | |
| class | range_with_conv |
| Add to a range class conversions to containers. More... | |
| class | RefCountedPtr |
| Simple smart pointer for Gaudi-style refcounted objects. More... | |
| class | releasing_iterator |
| Adapter to retrieve elements from a unique_ptr iterator via release(). More... | |
| class | reverse_wrapper |
| Adapter for a container-like class to be used in a range-for so as to iterate in the reverse direction. More... | |
| class | Ring |
| A very simple ring buffer. More... | |
| class | SimpleUpdater |
| Simple (non-deleting) Updater implementation. More... | |
| struct | sincos |
| Helper to simultaneously calculate sin and cos of the same angle. More... | |
| class | span |
| Simplified version of the C++20 std::span. More... | |
| struct | vec_fb |
| class | CRCTable |
| Precomputed tables and constants for the CRC calculation. More... | |
| class | RedirStderr |
| struct | extrace_init |
| class | Arrayrep |
| Representation class for Array's. More... | |
Concepts | |
| concept | FromArrayrep |
Concept testing whether a type may be used with FromArrayrep. | |
| concept | InputRangeOverT |
| Concept for an input range over a given type. | |
| concept | Numeric |
Typedefs | |
| template<class T, size_t Alignment = 1> | |
| using | aligned_vector = std::vector<T, boost::alignment::aligned_allocator<T, Alignment> > |
A std::vector with extra alignment. | |
| template<class T> | |
| using | vec_aligned_vector = aligned_vector<T, 64> |
A std::vector with alignment sufficient for any vector instructions on this platform. | |
| template<class T> | |
| using | CachedUniquePtr = CachedUniquePtrT<const T> |
| typedef std::map< std::string, ClassName > | match_t |
| Map used to hold variable assignments from matching. | |
| using | const_iterator_value = std::pair<const key_type, mapped_type> |
| Value structure for iterators. | |
| using | const_iterator_range = CxxUtils::iterator_range<const_iterator> |
| A range defined by two iterators. | |
| using | payload_unique_ptr = std::unique_ptr<T, DeletePayload> |
unique_ptr holding a payload object. | |
| using | const_iterator = const value_type* |
| using | Updater_t = UPDATER<Impl> |
| using | IPayloadDeleter = CxxUtils::IRangeMapPayloadDeleter<T, typename Updater_t::Context_t> |
| using | iterator_value = std::pair<const key_type, mapped_type&> |
| using | iterator_range = CxxUtils::iterator_range<iterator> |
| template<class KEY, class COMPARE = std::less<KEY>, class KEYCONTAINER = void> | |
| using | flat_set = boost::container::flat_set<KEY, COMPARE, KEYCONTANER> |
| template<class T, size_t N> | |
| using | inplace_vector = boost::container::small_vector<T, N> |
| template<std::ranges::input_range SPAN, class XFORM> | |
| using | transform_view_with_at |
| Helper to add at() methods to a transform_view. | |
| template<typename T, size_t N> | |
| using | vec = typename vecDetail::vec_typedef<T,N>::type |
| Define a nice alias for the vectorized type. | |
| template<class VEC> | |
| using | vec_type_t = typename vecDetail::vec_type<VEC>::type |
| Define a nice alias for the element type of a vectorized type. | |
| template<class VEC> | |
| using | vec_mask_type_t = typename vecDetail::vec_mask_type<VEC>::type |
| Define a nice alias for the mask type for a vectorized type. | |
| template<typename T, size_t N> | |
| using | ivec = vec_fb<typename boost::int_t<sizeof(T) * 8>::exact, N> |
| typedef float | Arrayelt |
The type of an element of an Array. | |
Enumerations | |
| enum | CacheState : unsigned char { INVALID = 0 , UPDATING = 1 , VALID = 2 } |
| State of the cached value; see below. More... | |
| enum class | EmplaceResult { SUCCESS , OVERLAP , DUPLICATE , EXTENDED } |
| Results returned from emplace(). More... | |
| enum | { CacheLineSize = 64 } |
| While it is possible to determine cache line size at run time (e.g. More... | |
Functions | |
| template<unsigned int N> | |
| std::ostream & | operator<< (std::ostream &s, const Array< N > &a) |
| template<class T> | |
| void | fromArrayrep (const CaloRec::Arrayrep &rep, T &x) |
| Helper to convert from an @x Arrayrep to a scalar type. | |
| template<unsigned int N> | |
| void | fromArrayrep (const CaloRec::Arrayrep &rep, CxxUtils::Array< N > &x) |
Helper to convert from an @x Arrayrep to an Array. | |
| template<class T> | |
| const T * | as_const_ptr (const T *p) |
| Helper for getting a const version of a pointer. | |
| template<class T> | |
| T | atomic_bounded_decrement (std::atomic< T > *a, T bound=0, T decr=1, std::memory_order memorder=std::memory_order_seq_cst) |
| Atomically decrement a value with a lower bound. | |
| template<class T> | |
| T | atomic_fetch_max (std::atomic< T > *a, T v, std::memory_order memorder=std::memory_order_seq_cst) |
| Atomically calculate maximum. | |
| template<class T> | |
| T | atomic_fetch_min (std::atomic< T > *a, T v, std::memory_order memorder=std::memory_order_seq_cst) |
| Atomically calculate minimum. | |
| std::string | base64_encode (const unsigned char *, unsigned int) |
| std::vector< unsigned char > | base64_decode (const std::string &) |
| template<class E> | |
| constexpr std::enable_if_t< is_bitmask_v< E >, E & > | set (E &lhs, E rhs) |
| Convenience function to set bits in a class enum bitmask. | |
| template<class E> | |
| constexpr std::enable_if_t< is_bitmask_v< E >, E & > | reset (E &lhs, E rhs) |
| Convenience function to clear bits in a class enum bitmask. | |
| template<class E> | |
| constexpr std::enable_if_t< is_bitmask_v< E >, bool > | test (E lhs, E rhs) |
| Convenience function to test bits in a class enum bitmask. | |
| template<std::integral T> | |
| constexpr T | byteswap (T value) noexcept |
| Reverse the bytes in n. | |
| ClassName () | |
| Default constructor. | |
| ClassName (const char *name) | |
| Parse a class name into component parts. | |
| ClassName (const std::string &name) | |
| Parse a class name into component parts. | |
| ClassName (const std::string &name, std::string::size_type &pos) | |
| Parse a class name into component parts. | |
| void | swap (ClassName &other) |
| Swap this expression with another one. | |
| bool | isConst () const |
| Get the const flag for this expression. | |
| void | setConst () |
| Set the const flag for this expression. | |
| const std::string & | name () const |
| Return the root name of the expression. | |
| std::string | qualifiedName () const |
| Return the namespace-qualified name of the expression. | |
| std::string | fullName () const |
| Return the full name of the expression. | |
| size_t | ntargs () const |
| Return number of template arguments. | |
| const ClassName & | targ (size_t i) const |
| Return one template argument. | |
| bool | operator== (const ClassName &other) const |
| Test two expressions for equality. | |
| bool | operator!= (const ClassName &other) const |
| Test two expressions for inequality. | |
| bool | match (const ClassName &pattern, match_t &matches) const |
| Match this expression against a pattern. | |
| void | subst (const match_t &matches) |
| Substitute variables into this expression. | |
| ClassName | substCopy (const match_t &matches) const |
| Return a copy of this expression with variables substituted. | |
| void | applyRules (const Rules &rules) |
| Apply a set of transformation rules to this object. | |
| static std::string | applyRules (const std::string &name, const Rules &rules) |
| Apply a set of transformation rules a class name. | |
| void | parse (const std::string &name, std::string::size_type &pos) |
Parse a string into a ClassName. | |
| std::string | parsePrimary (const std::string &name, std::string::size_type &pos) |
| Parse a primary part of the class name. | |
| void | parseNamespace (const std::string &name, std::string::size_type &pos) |
| Parse a namespace qualification. | |
| void | parseTemplateArgs (const std::string &name, std::string::size_type &pos) |
| Parse the template part of a name. | |
| void | skipSpaces (const std::string &name, std::string::size_type &pos) |
| Skip past spaces in a string. | |
| bool | match1 (const ClassName &pattern, bool topLevel, match_t &matches) const |
| Match this expression against a pattern. | |
| bool | applyRules1 (const Rules &rules) |
| Apply a set of transformation rules to this object. | |
| template<typename T> | |
| bool | close_to_zero (T value, T eps=std::numeric_limits< T >::epsilon()) |
| ConcurrentMap (Updater_t &&updater, size_type capacity=64, const Context_t &ctx=Updater_t::defaultContext()) | |
| Hash map from integers/pointers allowing concurrent, lockless reads. | |
| ConcurrentMap (const ConcurrentMap &other, Updater_t &&updater, size_t capacity=64, const Context_t &ctx=Updater_t::defaultContext()) | |
| Constructor from another map. | |
| template<class InputIterator> | |
| ConcurrentMap (InputIterator f, InputIterator l, Updater_t &&updater, size_type capacity=64, const Context_t &ctx=Updater_t::defaultContext()) | |
| Constructor from a range. | |
| ConcurrentMap (const ConcurrentMap &other)=delete | |
| Copy / move / assign not supported. | |
| ConcurrentMap (ConcurrentMap &&other)=delete | |
| ConcurrentMap & | operator= (const ConcurrentMap &other)=delete |
| ConcurrentMap & | operator= (ConcurrentMap &&other)=delete |
| ~ConcurrentMap ()=default | |
| Destructor. | |
| size_t | erased () const |
| The number of erased elements in the current table. | |
| const_iterator_range | range () const |
| Return an iterator range covering the entire map. | |
| const_iterator | cbegin () const |
| Iterator at the start of the map. | |
| const_iterator | cend () const |
| Iterator at the end of the map. | |
| bool | contains (key_type key) const |
| Test if a key is in the container. | |
| size_type | count (key_type key) const |
| Return the number of times a given key is in the container. | |
| const_iterator | find (key_type key) const |
| Look up an element in the map. | |
| mapped_type | at (key_type key) const |
| Look up an element in the map. | |
| std::pair< const_iterator, const_iterator > | equal_range (key_type key) const |
Return a range of iterators with entries matching key. | |
| Lock_t | lock () |
| Take a lock on the container. | |
| std::pair< const_iterator, bool > | emplace (key_type key, mapped_type val, const Context_t &ctx=Updater_t::defaultContext()) |
| Add an element to the map. | |
| std::pair< const_iterator, bool > | emplace (const Lock_t &lock, key_type key, mapped_type val, const Context_t &ctx=Updater_t::defaultContext()) |
| Add an element to the map, with external locking. | |
| std::pair< const_iterator, bool > | insert_or_assign (key_type key, mapped_type val, const Context_t &ctx=Updater_t::defaultContext()) |
| Add an element to the map, or overwrite an existing one. | |
| std::pair< const_iterator, bool > | insert_or_assign (const Lock_t &lock, key_type key, mapped_type val, const Context_t &ctx=Updater_t::defaultContext()) |
| Add an element to the map, or overwrite an existing one, with external locking. | |
| template<class PAIR> | |
| std::pair< const_iterator, bool > | insert (const PAIR &p) |
| Add an element to the map. | |
| template<class InputIterator> | |
| void | insert (InputIterator first, InputIterator last) |
| Insert a range of elements to the map. | |
| bool | erase (key_type key) |
| Erase an entry from the table. | |
| bool | erase (const Lock_t &lock, key_type key) |
| Erase an entry from the table, with external locking. | |
| void | reserve (size_type capacity, const Context_t &ctx=Updater_t::defaultContext()) |
| Increase the table capacity. | |
| void | rehash (size_type capacity) |
| Increase the table capacity. | |
| void | clear (size_t capacity, const Context_t &ctx=Updater_t::defaultContext()) |
| Erase the table and change the capacity. | |
| void | clear (const Context_t &ctx=Updater_t::defaultContext()) |
| Erase the table (don't change the capacity). | |
| void | forceClear () |
| Erase the table in-place. | |
| void | quiescent (const Context_t &ctx) |
| Called when this thread is no longer referencing anything from this container. | |
| void | swap (ConcurrentMap &other) |
| Swap this container with another. | |
| Updater_t & | updater () |
| Access the Updater instance. | |
| static key_type | keyAsKey (val_t val) |
| Convert an underlying key value to this type's key value. | |
| static val_t | keyAsVal (key_type k) |
| Convert this type's key value to an underlying key value. | |
| static mapped_type | mappedAsMapped (val_t val) |
| Convert an underlying mapped value to this type's mapped value. | |
| static val_t | mappedAsVal (mapped_type val) |
| Convert this type's mapped value to an underlying mapped value. | |
| Impl_t::const_iterator | get (key_type key) const |
| Do a lookup in the table. | |
| std::pair< const_iterator, bool > | put (key_type key, mapped_type val, bool overwrite=true, const Context_t &ctx=Updater_t::defaultContext()) |
| Insert / overwrite an entry in the table. | |
| std::pair< const_iterator, bool > | put (const Lock_t &lock, key_type key, mapped_type val, bool overwrite=true, const Context_t &ctx=Updater_t::defaultContext()) |
| Insert / overwrite an entry in the table, with external locking. | |
| ConcurrentRangeMap (Updater_t &&updater, std::shared_ptr< IPayloadDeleter > payloadDeleter, size_t capacity=16, const COMPARE &compare=COMPARE()) | |
| Constructor. | |
| ~ConcurrentRangeMap () | |
| Destructor. | |
| IPayloadDeleter & | deleter () |
| Return a reference to the payload deleter object. | |
| const_iterator | find (const key_query_type &key) const |
| Search for the first item less than or equal to KEY. | |
| EmplaceResult | emplace (const RANGE &range, payload_unique_ptr ptr, bool tryExtend=false, const typename Updater_t::Context_t &ctx=Updater_t::defaultContext()) |
| Add a new element to the map. | |
| void | erase (const key_query_type &key, const typename Updater_t::Context_t &ctx=Updater_t::defaultContext()) |
| Erase the first item less than or equal to KEY. | |
| int | extendLastRange (const RANGE &newRange, const typename Updater_t::Context_t &ctx=Updater_t::defaultContext()) |
| Extend the range of the last entry of the map. | |
| void | updateRanges (std::function< void(RANGE &)> rangeUpdater, const typename Updater_t::Context_t &ctx=Updater_t::defaultContext()) |
| Update all range objects. | |
| size_t | trim (const std::vector< key_query_type > &keys, bool trimall=false) |
| Remove unused entries from the front of the list. | |
| size_t | nInserts () const |
| Return the number times an item was inserted into the map. | |
| size_t | maxSize () const |
| Return the maximum size of the map. | |
| void | quiescent (const typename Updater_t::Context_t &ctx=Updater_t::defaultContext()) |
| Called when this thread is no longer referencing anything from this container. | |
| const_iterator | getBegin (const_iterator &last) const |
| Return the begin/last pointers. | |
| void | updatePointers (value_type *new_begin, value_type *new_end) |
| Consistently update both the begin and last pointers. | |
| bool | anyInRange (const key_type &r, const std::vector< key_query_type > &keys) const |
Test to see if any keys within keys match r. | |
| void | installImpl (std::unique_ptr< Impl > new_impl, value_type *new_begin, value_type *new_end, const typename Updater_t::Context_t &ctx) |
| Install a new implementation instance and make it visible. | |
| int | extendImpl (lock_t &lock, const RANGE &extendedRange, const typename Updater_t::Context_t &ctx) |
| Extend the range of the last entry of the map. | |
| ConcurrentToValMap (Updater_t &&updater, size_type capacity=64, const Context_t &ctx=Updater_t::defaultContext()) | |
| Hash map from pointers/integers to arbitrary objects allowing concurrent, lockless reads. | |
| ConcurrentToValMap (const ConcurrentToValMap &other, Updater_t &&updater, size_t capacity=64, const Context_t &ctx=Updater_t::defaultContext()) | |
| Constructor from another map. | |
| template<class InputIterator> | |
| ConcurrentToValMap (InputIterator f, InputIterator l, Updater_t &&updater, size_type capacity=64, const Context_t &ctx=Updater_t::defaultContext()) | |
| Constructor from a range. | |
| ConcurrentToValMap (const ConcurrentToValMap &other)=delete | |
| Copy / move / assign not supported. | |
| ConcurrentToValMap (ConcurrentToValMap &&other)=delete | |
| ConcurrentToValMap & | operator= (const ConcurrentToValMap &other)=delete |
| ConcurrentToValMap & | operator= (ConcurrentToValMap &&other)=delete |
| ~ConcurrentToValMap () | |
| Destructor. | |
| std::pair< const_iterator, bool > | emplace (key_type key, const mapped_type &val, const Context_t &ctx=Updater_t::defaultContext()) |
| Add an element to the map. | |
| std::pair< const_iterator, bool > | emplace (key_type key, mapped_type &&val, const Context_t &ctx=Updater_t::defaultContext()) |
| Add an element to the map. | |
| std::pair< const_iterator, bool > | emplace (key_type key, std::unique_ptr< mapped_type > val, const Context_t &ctx=Updater_t::defaultContext()) |
| Add an element to the map. | |
| template<class PAIR> | |
| std::pair< const_iterator, bool > | insert (const PAIR &p, const Context_t &ctx=Updater_t::defaultContext()) |
| Add an element to the map. | |
| template<class PAIR> | |
| std::pair< const_iterator, bool > | insert (PAIR &&p, const Context_t &ctx=Updater_t::defaultContext()) |
| Add an element to the map. | |
| template<class InputIterator> | |
| void | insert (InputIterator first, InputIterator last, const Context_t &ctx=Updater_t::defaultContext()) |
| Insert a range of elements to the map. | |
| void | swap (ConcurrentToValMap &other) |
| Swap this container with another. | |
| static key_type | keyAsKey (val_t val) |
| Convert an underlying key value to this type's key value. | |
| static val_t | keyAsVal (key_type k) |
| Convert this type's key value to an underlying key value. | |
| static mapped_type * | mappedAsMapped (val_t val) |
| Convert an underlying mapped value a pointer to this type's mapped value. | |
| static val_t | mappedAsVal (mapped_type *val) |
| Convert this type's mapped value to an underlying mapped value. | |
| std::pair< const_iterator, bool > | put (const key_type key, std::unique_ptr< mapped_type > val, const Context_t &ctx=Updater_t::defaultContext()) |
| Insert an entry in the table. | |
| template<class InputIterator, class OutputIterator, class InputTag, class OutputTag> | |
| OutputIterator | copy_bounded1 (InputIterator begi, InputIterator endi, OutputIterator bego, OutputIterator endo, const InputTag &, const OutputTag &) |
| Copy a range with bounds restriction; generic version. | |
| template<class InputIterator, class OutputIterator> | |
| OutputIterator | copy_bounded1 (InputIterator begi, InputIterator endi, OutputIterator bego, OutputIterator endo, const std::random_access_iterator_tag &, const std::random_access_iterator_tag &) |
| Copy a range with bounds restriction; random_access_iterator version. | |
| template<std::input_iterator InputIterator, std::output_iterator< typename std::iterator_traits< InputIterator >::value_type > OutputIterator> | |
| OutputIterator | copy_bounded (InputIterator begi, InputIterator endi, OutputIterator bego, OutputIterator endo) |
| Copy a range with bounds restriction. | |
| template<class InputRange, class OutputRange> | |
| auto | copy_bounded (const InputRange &input, OutputRange &output) -> decltype(std::begin(output)) |
| Copy a range with bounds restriction. | |
| template<class InputRange, class OutputRange> | |
| auto | copy_bounded (const InputRange &input, OutputRange &&output) -> decltype(std::begin(output)) |
| Copy a range with bounds restriction. | |
| void | deleteCRCTable (CxxUtils::CRCTable *table) |
| Delete a CRCTable object. | |
| std::unique_ptr< CRCTable > | makeCRCTable (uint64_t p, uint64_t initial=0xffffffffffffffff) |
| Initialize CRC tables and constants. | |
| uint64_t | crc64_bytewise (const CRCTable &table, const char *data, size_t data_len) |
| Find the CRC-64 of a string, using a byte-by-byte algorithm. | |
| uint64_t | crc64_bytewise (const char *data, size_t data_len) |
| Find the CRC-64 of a string, using a byte-by-byte algorithm, with the default CRC. | |
| uint64_t | crc64_bytewise (const std::string &s) |
| Find the CRC-64 of a string, using a byte-by-byte algorithm, with the default CRC. | |
| uint64_t | crc64 (const CRCTable &table, const char *data, size_t data_len) |
| Find the CRC-64 of a string,. | |
| uint64_t | crc64 (const char *data, size_t data_len) |
| Find the CRC-64 of a string, with the default CRC. | |
| uint64_t | crc64 (const std::string &s) |
| Find the CRC-64 of a string, using the default polynomial. | |
| uint64_t | crc64addint (uint64_t crc, uint64_t x) |
| Extend a previously-calculated CRC to include an int. | |
| std::string | crc64format (uint64_t crc) |
| Format a CRC-64 as a string. | |
| std::string | crc64digest (const std::string &str) |
| Return a CRC-64 digest of a string. | |
| void | exctrace (const std::exception &e, IOFD fd=IOFD_INVALID) |
| Print out information for the last exception. | |
| uint16_t | le16toh (uint16_t x) |
| uint32_t | le32toh (uint32_t x) |
| uint64_t | le64toh (uint64_t x) |
| uint16_t | get_unaligned16 (const uint8_t *ATH_RESTRICT &p) |
| Read a 2-byte little-endian value from a possibly unaligned pointer. | |
| uint32_t | get_unaligned32 (const uint8_t *ATH_RESTRICT &p) |
| Read a 4-byte little-endian value from a possibly unaligned pointer. | |
| uint64_t | get_unaligned64 (const uint8_t *ATH_RESTRICT &p) |
| Read an 8-byte little-endian value from a possibly unaligned pointer. | |
| float | get_unaligned_float (const uint8_t *ATH_RESTRICT &p) |
| Read a little-endian float value from a possibly unaligned pointer. | |
| double | get_unaligned_double (const uint8_t *ATH_RESTRICT &p) |
| Read a little-endian double value from a possibly unaligned pointer. | |
| template<class T> | |
| T | get_unaligned (const uint8_t *ATH_RESTRICT &p) |
| Define templated versions of the above functions. | |
| template<> | |
| uint8_t | get_unaligned< uint8_t > (const uint8_t *ATH_RESTRICT &p) |
| template<> | |
| uint16_t | get_unaligned< uint16_t > (const uint8_t *ATH_RESTRICT &p) |
| template<> | |
| uint32_t | get_unaligned< uint32_t > (const uint8_t *ATH_RESTRICT &p) |
| template<> | |
| uint64_t | get_unaligned< uint64_t > (const uint8_t *ATH_RESTRICT &p) |
| template<> | |
| float | get_unaligned< float > (const uint8_t *ATH_RESTRICT &p) |
| template<> | |
| double | get_unaligned< double > (const uint8_t *ATH_RESTRICT &p) |
| template<> | |
| int8_t | get_unaligned< int8_t > (const uint8_t *ATH_RESTRICT &p) |
| template<> | |
| int16_t | get_unaligned< int16_t > (const uint8_t *ATH_RESTRICT &p) |
| template<> | |
| int32_t | get_unaligned< int32_t > (const uint8_t *ATH_RESTRICT &p) |
| template<> | |
| int64_t | get_unaligned< int64_t > (const uint8_t *ATH_RESTRICT &p) |
| void | hexdump (std::ostream &s, const void *addr, size_t n, size_t offset=0) |
| Make a hex dump of memory. | |
| void | safeHexdump (std::ostream &s, const void *addr, size_t n, size_t offset=0) |
| Make a hex dump of memory, protected against bad reads. | |
| template<class RANGE, class FUNC> | |
| auto | min_transformed_element (RANGE &&r, FUNC &&f) |
| Find the minimum transformed element in a range. | |
| template<class RANGE, class FUNC> | |
| auto | max_transformed_element (RANGE &&r, FUNC &&f) |
| Find the maximum transformed element in a range. | |
| uint32_t | MurmurHash2 (const void *key, int len, uint32_t seed) |
| uint64_t | MurmurHash64A (const void *key, int len, uint64_t seed) |
| uint64_t | MurmurHash64B (const void *key, int len, uint64_t seed) |
| uint32_t | MurmurHash2A (const void *key, int len, uint32_t seed) |
| uint32_t | MurmurHashNeutral2 (const void *key, int len, uint32_t seed) |
| uint32_t | MurmurHashAligned2 (const void *key, int len, uint32_t seed) |
| std::string | normalizeFunctionName (const std::string &fname) |
| Normalize a pretty-printed C++ function name. | |
| template<class T> | |
| constexpr T | ones (unsigned int n) |
| Return a bit mask with the lower n bits set. | |
| template<typename T> | |
| T | wrapToPi (T phi) |
| Wrap angle in radians to [-pi, pi]. | |
| template<typename T> | |
| T | deltaPhi (T phiA, T phiB) |
| Return difference phiA - phiB in range [-pi, pi]. | |
| template<typename T> | |
| T | phiMean (T phiA, T phiB) |
| Calculate average of two angles. | |
| template<typename T> | |
| T | phiBisect (T phiA, T phiB) |
| Bisect (average) the angle spanned by phiA and phiB. | |
| void | prefetchOne (const void *address) |
| Generic prefetch method. | |
| template<size_t N> | |
| void | prefetchN (const void *ptr) |
| Prefetch an N-byte block of memory. | |
| template<typename T> | |
| void | prefetchObj (const T *ptr) |
| Generic prefetch of the object of specific types (sizes). | |
| template<typename Iter> | |
| void | prefetchNext (Iter iter, Iter endIter) |
| Prefetch next object in sequence. | |
| template<typename Iter> | |
| void | prefetchTwo (Iter iter, Iter endIter) |
| Prefetch two objects. | |
| template<class T> | |
| auto | begin (range_with_at< T > &s) |
| template<class T> | |
| auto | begin (const range_with_at< T > &s) |
| template<class T> | |
| auto | end (range_with_at< T > &s) |
| template<class T> | |
| auto | end (const range_with_at< T > &s) |
| template<class T> | |
| auto | begin (range_with_conv< T > &s) |
| template<class T> | |
| auto | begin (const range_with_conv< T > &s) |
| template<class T> | |
| auto | end (range_with_conv< T > &s) |
| template<class T> | |
| auto | end (const range_with_conv< T > &s) |
| template<class CONT, class RANGE> | |
| CONT | to (RANGE &&r) |
| template<class T> | |
| auto | make_reverse_wrapper (T &r) |
Make a reverse_wrapper for a given container-like object. | |
| uint16_t | htole16 (uint16_t x) |
| uint32_t | htole32 (uint32_t x) |
| uint64_t | htole64 (uint64_t x) |
| void | set_unaligned16 (uint8_t *ATH_RESTRICT &p, uint16_t val) |
| Write a 2-byte little-endian value to a possibly unaligned pointer. | |
| void | set_unaligned32 (uint8_t *ATH_RESTRICT &p, uint32_t val) |
| Write a 4-byte little-endian value to a possibly unaligned pointer. | |
| void | set_unaligned64 (uint8_t *ATH_RESTRICT &p, uint64_t val) |
| Write an 8-byte little-endian value to a possibly unaligned pointer. | |
| void | set_unaligned_float (uint8_t *ATH_RESTRICT &p, float val) |
| Write a little-endian float value to a possibly unaligned pointer. | |
| void | set_unaligned_double (uint8_t *ATH_RESTRICT &p, double val) |
| Write a little-endian double value to a possibly unaligned pointer. | |
| template<class T> | |
| void | set_unaligned (uint8_t *ATH_RESTRICT &p, T val) |
| Define templated versions of the above functions. | |
| template<> | |
| void | set_unaligned< uint8_t > (uint8_t *ATH_RESTRICT &p, uint8_t val) |
| template<> | |
| void | set_unaligned< uint16_t > (uint8_t *ATH_RESTRICT &p, uint16_t val) |
| template<> | |
| void | set_unaligned< uint32_t > (uint8_t *ATH_RESTRICT &p, uint32_t val) |
| template<> | |
| void | set_unaligned< uint64_t > (uint8_t *ATH_RESTRICT &p, uint64_t val) |
| template<> | |
| void | set_unaligned< float > (uint8_t *ATH_RESTRICT &p, float f) |
| template<> | |
| void | set_unaligned< double > (uint8_t *ATH_RESTRICT &p, double f) |
| template<> | |
| void | set_unaligned< int8_t > (uint8_t *ATH_RESTRICT &p, int8_t val) |
| template<> | |
| void | set_unaligned< int16_t > (uint8_t *ATH_RESTRICT &p, int16_t val) |
| template<> | |
| void | set_unaligned< int32_t > (uint8_t *ATH_RESTRICT &p, int32_t val) |
| template<> | |
| void | set_unaligned< int64_t > (uint8_t *ATH_RESTRICT &p, int64_t val) |
| template<class T> | |
| span (T *ptr, std::size_t sz) -> span< T > | |
| A couple needed deduction guides. | |
| template<class T> | |
| span (T *beg, T *end) -> span< T > | |
| template<detail::IsContiguousContainer CONTAINER> | |
| auto | make_span (CONTAINER &c) |
| Helper to make a span from a container. | |
| template<class T> | |
| auto | begin (span< T > &s) |
| template<class T> | |
| auto | begin (const span< T > &s) |
| template<class T> | |
| auto | end (span< T > &s) |
| template<class T> | |
| auto | end (const span< T > &s) |
| std::string | strformat (const char *fmt,...) |
| return a std::string according to a format fmt and varargs | |
| int | atoi (std::string_view str) |
| Helper functions to unpack numbers decoded in string into integers and doubles The strings are required to contain only digits, a floating point dot, the signs +- or a whitespace Exceptions are thrown otherwise. | |
| double | atof (std::string_view str) |
| Converts a string into a double / float. | |
| std::string_view | trimWhiteSpaces (std::string_view str) noexcept |
| Removes all trailing and starting whitespaces from a string. | |
| std::vector< std::string > | tokenize (std::string_view the_str, std::string_view delimiters) |
| Splits the string into smaller substrings. | |
| std::vector< std::string > | tokenize (std::string_view the_str, char delimiter) |
| std::vector< double > | tokenizeDouble (std::string_view the_str, std::string_view delimiter) |
| std::vector< int > | tokenizeInt (std::string_view str, std::string_view delimiter) |
| template<Numeric dType, bool silenceEmpty = true> | |
| void | convertToNumber (std::string_view str, dType &number) |
| template<typename T = std::string, typename X = std::string_view> | |
| std::vector< T > | tokenize (std::string_view str, X delimiters) |
| void | throw_out_of_range (const std::string &what, size_t index, size_t size, const void *obj) |
Throw an out_of_range exception. | |
| void | throw_out_of_range (const char *what, size_t index, size_t size, const void *obj) |
Throw an out_of_range exception. | |
| void | ubsan_suppress (void(*func)()) |
| Helper for suppressing ubsan warnings. | |
| template<class VEC> | |
| ATH_ALWAYS_INLINE constexpr size_t | vec_size () |
| Return the number of elements in a vectorized type. | |
| template<class VEC> | |
| ATH_ALWAYS_INLINE constexpr size_t | vec_size (const VEC &) |
| Return the number of elements in a vectorized type. | |
| template<typename VEC, typename T> | |
| ATH_ALWAYS_INLINE void | vbroadcast (VEC &v, T x) |
| Copy a scalar to each element of a vectorized type. | |
| template<typename VEC> | |
| ATH_ALWAYS_INLINE void | vload (VEC &dst, vec_type_t< VEC > const *src) |
| template<typename VEC> | |
| ATH_ALWAYS_INLINE void | vstore (vec_type_t< VEC > *dst, const VEC &src) |
| template<typename VEC> | |
| ATH_ALWAYS_INLINE void | vselect (VEC &dst, const VEC &a, const VEC &b, const vec_mask_type_t< VEC > &mask) |
| template<typename VEC> | |
| ATH_ALWAYS_INLINE void | vmin (VEC &dst, const VEC &a, const VEC &b) |
| template<typename VEC> | |
| ATH_ALWAYS_INLINE void | vmax (VEC &dst, const VEC &a, const VEC &b) |
| template<typename VEC> | |
| ATH_ALWAYS_INLINE bool | vany (const VEC &mask) |
| template<typename VEC> | |
| ATH_ALWAYS_INLINE bool | vnone (const VEC &mask) |
| template<typename VEC> | |
| ATH_ALWAYS_INLINE bool | vall (const VEC &mask) |
| template<typename VEC1, typename VEC2> | |
| ATH_ALWAYS_INLINE void | vconvert (VEC1 &dst, const VEC2 &src) |
| performs dst is the result of a static cast of each element of src | |
| template<size_t... Indices, typename VEC, typename VEC1> | |
| ATH_ALWAYS_INLINE void | vpermute (VEC1 &dst, const VEC &src) |
| vpermute function. | |
| template<size_t... Indices, typename VEC, typename VEC1> | |
| ATH_ALWAYS_INLINE void | vpermute2 (VEC1 &dst, const VEC &src1, const VEC &src2) |
| vpermute2 function. | |
| template<typename T, size_t N> | |
| ivec< T, N > | operator! (const vec_fb< T, N > &a) |
| Negation. | |
| template<typename T, size_t N> | |
| ivec< T, N > | operator&& (const vec_fb< T, N > &a, const vec_fb< T, N > &b) |
| V1 && V2. | |
| template<typename T, size_t N, class U> | |
| ivec< T, N > | operator&& (U a, const vec_fb< T, N > &b) |
| S && V. | |
| template<typename T, size_t N, class U> | |
| ivec< T, N > | operator&& (const vec_fb< T, N > &a, U b) |
| V && S. | |
| template<typename T, size_t N> | |
| ivec< T, N > | operator|| (const vec_fb< T, N > &a, const vec_fb< T, N > &b) |
| V1 || V2. | |
| void * | xmalloc (size_t size) |
| Trapping version of malloc. | |
| static bool | is_base64 (unsigned char c) |
Constructors, destructors, assignment. | |
Variable-sized bitset allowing (mostly) concurrent access. This class represents a set of bits. One can think of such an object as either like a std::bitset or like a std::set<unsigned>. This class provides basically the union of the two interfaces. In a few cases, the same method has different semantics in the two interfaces, most notably The size of the bitset is specified at runtime, to the constructor. Most operations do not change the size. However, the Most methods can execute completely concurrently. However, the methods which can change the size of the container, Some methods can operate on the entire set (e.g., An iterator is provided that iterates over all bits that are set (like iterating over a set<unsigned>). When the container is expanded, the internal representation needs to be reallocated. The old object is not, however, deleted immediately, as other threads may still be referencing it. If if some point you know that no threads can be referencing old versions any more, you can clean them up by calling Some notes on motivation: The use case that motivated this class was auxid_set_t, which tells which auxiliary variables are available for a given container. This is logically a relatively sparse set of relatively small integers. (Maximum value is ~2000, with a set having ~100 entries.) This had been implemented as a std::unordered_set<size_t>, but this was not entirely satisfactory. First, in some cases, there was a significant overhead in inserting and deleting items from the set. Second, unordered_set does not allow concurrent reading and writing. This meant that we ended up maintaining thread-local copies of each set, which adds extra overhead and complexity. The threading issue suggests that we would like to use a container that allows readers to run currently with at least one writer. The fact that the maximum value to be stored in these sets is not too large suggests that a bitmap might be a good representation, as long as the time required to iterate over the set doesn't blow up due to the sparseness of the map. To study this, a reconstruction job was instrumented to dump out all unique auxid_set_t values. This corpus was then used to run a set of timing tests for different set implementations. This test is built into the ConcurrentBitset unit test, and the corpus is available in the CxxUtils package. Run like: .../ConcurrentBitset_test.exe --perf .../CxxUtils/share/auxids.uniq
Definition aligned_vector.h:29 Set implementations that have been tested so far include:
Representative results (times in seconds; lower is better): |--------------------------+------+------+---------+--------|
| | fill | copy | iterate | lookup |
|--------------------------+------+------+---------+--------|
| set | 0.92 | 0.66 | 10.95 | 0.53 |
| unordered_set | 1.63 | 0.93 | 6.56 | 0.50 |
| concurrent_unordered_set | 1.79 | 1.70 | 9.55 | 1.20 |
| ck_hs | 0.78 | 0.83 | 18.92 | 0.88 |
| ck_bitmap | 0.13 | 0.21 | 5.52 | 0.05 |
| ConcurrentBitset | 0.31 | 0.06 | 4.48 | 0.08 |
|--------------------------+------+------+---------+--------|
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs) Convenience function to set bits in a class enum bitmask. Definition bitmask.h:232 For this workload, the bitmaps are the clear winner. Implementation notes: The implementation here is inspired by ck_bitmap from ConcurrencyKit (http://concurrencykit.org/), though the code is all new. ck_bitmap itself isn't suitable because it doesn't allow for the set to grow, and also because it's a pure C interface, while we want something with a C++ style interface (and in particular something which supports interfaces close to unordered_set<size_t> in order to ease migration). The bitset is stored as an array of std::atomic<Block_t> objects, where Block_t is the largest unsigned type for which atomic is lockless. This is stored in a separate implementation object in order to allow the container to grow. The implementation object has a fixed-size header followed by the variable-size array of blocks. To speed up iteration for the typical case of a sparse set, we maintain a `high-water' mark, m_hwm, which is the index of the highest block that might have a bit set. m_hwm can only increase unless the set is cleared. */ class ConcurrentBitset { private: Forward declaration of implementation class. class Impl; / Internal type used to hold the bitset data. / The bitset is an array of std::atomic<Block_t>. / This type should generally be the largest unsigned type for which / std::atomic is lockless. typedef unsigned long Block_t; / Size, in bits, of / Mask to select out the bit offset within one static_assert (std::atomic<Block_t>::is_always_lock_free); public: / A bit number. typedef size_t bit_t; /** | |
| ConcurrentBitset (bit_t nbits=0) | |
| Constructor. | |
| ConcurrentBitset (const ConcurrentBitset &other) | |
| Copy constructor. | |
| ConcurrentBitset (std::initializer_list< bit_t > l, bit_t nbits=0) | |
| Constructor from an initializer list. | |
| ConcurrentBitset (ConcurrentBitset &&other) | |
| Move constructor. | |
| ~ConcurrentBitset () | |
| Destructor. | |
| ConcurrentBitset & | operator= (const ConcurrentBitset &other) |
| Assignment. | |
| ConcurrentBitset & | operator= (ConcurrentBitset &&other) |
| Move. | |
| void | emptyGarbage () |
| Clean up old versions of the set. | |
Size, bit testing | |
| bit_t | capacity () const |
| The number of bits that this container can hold. | |
| bit_t | count () const |
| Count the number of 1 bits in the set. | |
| bit_t | size () const |
| Count the number of 1 bits in the set. | |
| bool | test (bit_t bit) const |
| Test to see if a bit is set. | |
| size_t | count (bit_t bit) const |
| Test to see if a bit is set. | |
| bool | empty () const |
| Return true if there are no 1 bits in the set. | |
| bool | none () const |
| Return true if there are no 1 bits in the set. | |
| bool | all () const |
| Return true if all bits in the set are 1. | |
| bool | any () const |
| Return true if there are any 1 bits in the set. | |
Single-bit manipulation. | |
| ConcurrentBitset & | set (bit_t bit) |
| Turn on one bit. | |
| ConcurrentBitset & | reset (bit_t bit) |
| Turn off one bit. | |
| ConcurrentBitset & | erase (bit_t bit) |
| Turn off one bit. | |
| ConcurrentBitset & | flip (bit_t bit) |
| Flip the value of one bit. | |
| ConcurrentBitset & | set (bit_t bit, bool val) |
| Set the value of one bit. | |
Set operations. | |
| ConcurrentBitset & | clear () |
| Clear all bits in the set. | |
| ConcurrentBitset & | reset () |
| Clear all bits in the set. | |
| ConcurrentBitset & | set () |
| Turn on all bits in the set. | |
| ConcurrentBitset & | flip () |
| Flip the state of all bits in the set. | |
| ConcurrentBitset & | operator&= (const ConcurrentBitset &other) |
| AND this set with another set. | |
| ConcurrentBitset & | operator|= (const ConcurrentBitset &other) |
| OR this set with another set. | |
| ConcurrentBitset & | operator^= (const ConcurrentBitset &other) |
| XOR this set with another set. | |
| ConcurrentBitset & | operator-= (const ConcurrentBitset &other) |
| Subtract another set from this set. | |
| ConcurrentBitset | operator~ () const |
| Return a new set that is the complement of this set. | |
Comparison. | |
| bool | operator== (const ConcurrentBitset &other) const |
| Test two sets for equality. | |
| bool | operator!= (const ConcurrentBitset &other) const |
| Test two sets for inequality. | |
Insert. | |
| ConcurrentBitset & | insert (bit_t bit, bit_t new_nbits=0) |
| Set a bit to 1. | |
| template<class ITERATOR, typename = typename std::enable_if< std::is_base_of< typename std::forward_iterator_tag, typename std::iterator_traits<ITERATOR>::iterator_category >::value>> | |
| ConcurrentBitset & | insert (ITERATOR beg, ITERATOR end, bit_t new_nbits=0) |
| Set several bits to 1. | |
| ConcurrentBitset & | insert (std::initializer_list< bit_t > l, bit_t new_nbits=0) |
| Set several bits to 1. | |
| ConcurrentBitset & | insert (const ConcurrentBitset &other) |
| Turn on bits listed in another set. | |
Array-like element access. | |
| bool | operator[] (bit_t bit) const |
| Return the value of one bit. | |
Iterator operations. | |
| const_iterator | begin () const |
| Return a begin iterator. | |
| const_iterator | end () const |
| Return an end iterator. | |
| const_iterator | find (bit_t bit) const |
If bit bit is set, return an iterator pointing to it. | |
Variables | |
| bool | m_const |
| Is this expression const? | |
| std::vector< ClassName > | m_namespace |
| The containing namespace. This vector is always either 0 or 1 elements long; this is a way of getting something sort of like a pointer but with completely automatic management. | |
| std::string | m_name |
| The primary name part of this expression. | |
| std::vector< ClassName > | m_targs |
| The template arguments for this name. | |
| Updater_t | m_updater |
| Updater object. This maintains ownership of the current implementation class and the older versions. | |
| COMPARE | m_compare |
| Comparison object. | |
| std::shared_ptr< IPayloadDeleter > | m_payloadDeleter |
| Payload deleter object. Important: do not discard an object while it's still reachable from the m_begin / m_last range — update the pointers first. Otherwise, the object may be deleted while another thread is still referencing it: thread 1: Discard object. Sets grace mask for both slots. thread 2: Call quiescent(). Clears grace mask for 2. Retrieve the discarded object. thread 1: Adjust pointers. Call quiescent. The discarded object may be deleted at this point while thread 2 is still reading it. | |
| std::atomic< value_type * > | m_begin |
| Pointers to the first and last elements of the container. m_last is not the usual end pointer; it points at the last element in the container. If the container is empty, then m_last will be null. If these are to both be updated together, it should be done in this order. First, m_begin should be set to null. This marks that there's an update in progress. Then m_last should be set, followed by m_begin. To read both pointers, we first fetch m_last. Then fetch m_begin. Then check that both m_begin is non-null and the previous value we fetched for last matches what's now in m_last. If either condition fails, then re-fetch both pointers. | |
| std::atomic< value_type * > | m_last |
| size_t | m_nInserts |
| Some basic statistics. | |
| size_t | m_maxSize |
| constexpr size_t | dynamic_extent = static_cast<size_t>(-1) |
| Used to specify a subrange of indefinite size in subspan(). | |
| template<class T, class U> | |
| constexpr bool | valid_span_type_v = std::is_convertible_v<U(*)[], T(*)[]> |
| Is U* a valid type to use to initialize a span<T>? | |
| static const std::string | base64_chars |
| const CRCTable | defaultCRCTable (0xad93d23594c935a9) |
| static const unsigned int | NMANTISSA = 23 |
| Total number of total mantissa bits. | |
| static extrace_init | initer |
Implementation. | |
| typedef std::mutex | mutex_t |
| Mutex used for synchronization when switching to a new implementation object. | |
| typedef std::lock_guard< mutex_t > | lock_t |
| std::atomic< Impl * > | m_impl |
| The current implementation object. | |
| std::vector< Impl * > | m_garbage |
| Old implementation objects, pending deletion. | |
| mutex_t | m_mutex |
| Mutex protecting the container. | |
| static bit_t | nBlocks (bit_t nbits) |
| Find number of blocks needed to hold a given number of bits. | |
| Impl * | newImpl (bit_t nbits) |
| Create a new, uninitialized implementation object. | |
| void | expand (bit_t new_nbits) |
| Expand the container. | |
| void | expandOol (bit_t new_nbits) |
| Expand the container: out-of-line portion. | |
| using CxxUtils::aligned_vector = std::vector<T, boost::alignment::aligned_allocator<T, Alignment> > |
A std::vector with extra alignment.
The alignment for the payload will be at least either that required by T or Alignment, whichever is greater.
Definition at line 39 of file aligned_vector.h.
| typedef float CaloRec::Arrayelt |
The type of an element of an Array.
Definition at line 26 of file Control/CxxUtils/CxxUtils/Arrayrep.h.
| using CxxUtils::CachedUniquePtr = CachedUniquePtrT<const T> |
Definition at line 114 of file CachedUniquePtr.h.
| using CxxUtils::const_iterator = const value_type* |
Definition at line 288 of file ConcurrentRangeMap.h.
| typedef CxxUtils::iterator_range< const_iterator > CxxUtils::const_iterator_range = CxxUtils::iterator_range<const_iterator> |
A range defined by two iterators.
Definition at line 305 of file ConcurrentMap.h.
| typedef std::pair< const key_type, const mapped_type & > CxxUtils::const_iterator_value = std::pair<const key_type, mapped_type> |
Value structure for iterators.
Value structures for iterators.
For a map from K to V, a STL-style iterator should dereference to a std::pair<const K, V>. However, we don't actually store an object like that anywhere. In order to be able to have STL-like iterators, we instead use a pair where the second element is a const reference to the mapped value. We will return this by value when we deference an iterator. (The compiler should be able to optimize out the redundant packing and unpacking of fields.)
Definition at line 236 of file ConcurrentMap.h.
| using CxxUtils::flat_set = boost::container::flat_set<KEY, COMPARE, KEYCONTANER> |
Definition at line 40 of file flat_set.h.
| using CxxUtils::inplace_vector = boost::container::small_vector<T, N> |
Definition at line 39 of file inplace_vector.h.
| using CxxUtils::IPayloadDeleter = CxxUtils::IRangeMapPayloadDeleter<T, typename Updater_t::Context_t> |
Definition at line 336 of file ConcurrentRangeMap.h.
| using CxxUtils::iterator_range = CxxUtils::iterator_range<iterator> |
Definition at line 400 of file ConcurrentToValMap.h.
| using CxxUtils::iterator_value = std::pair<const key_type, mapped_type&> |
Definition at line 237 of file ConcurrentToValMap.h.
| using CxxUtils::ivec = vec_fb<typename boost::int_t<sizeof(T) * 8>::exact, N> |
|
private |
Definition at line 1063 of file ConcurrentBitset.h.
| typedef std::map<std::string, ClassName> CxxUtils::match_t |
Map used to hold variable assignments from matching.
Definition at line 200 of file CxxUtils/CxxUtils/ClassName.h.
|
private |
Mutex used for synchronization when switching to a new implementation object.
Type of the mutex for this container.
Definition at line 1062 of file ConcurrentBitset.h.
| using CxxUtils::payload_unique_ptr = std::unique_ptr<T, DeletePayload> |
unique_ptr holding a payload object.
One may initialize an instance of this in one of two ways. First, from another std::unique_ptr:
where U* must be convertible to T*. In this case, the pointer will be deleted as a U*. Second, one can supply an explicit deletion function:
Definition at line 286 of file ConcurrentRangeMap.h.
| using CxxUtils::transform_view_with_at |
Helper to add at() methods to a transform_view.
Definition at line 58 of file range_with_at.h.
| using CxxUtils::Updater_t = UPDATER<Impl> |
Definition at line 335 of file ConcurrentRangeMap.h.
| using CxxUtils::vec = typename vecDetail::vec_typedef<T,N>::type |
| using CxxUtils::vec_aligned_vector = aligned_vector<T, 64> |
A std::vector with alignment sufficient for any vector instructions on this platform.
For now, just hard code 64, which is sufficient for a 512-bit vector, the largest supported by any x86 processors. We may want to make this platform-dependent in the future.
Definition at line 51 of file aligned_vector.h.
| using CxxUtils::vec_mask_type_t = typename vecDetail::vec_mask_type<VEC>::type |
| using CxxUtils::vec_type_t = typename vecDetail::vec_type<VEC>::type |
| anonymous enum |
While it is possible to determine cache line size at run time (e.g.
using sysconf(_SC_LEVEL1_DCACHE_LINESIZE) on Linux or sysctlbyname("hw.cachelinesize", ...) on Apple systems) that approach creates more problems: the location that stores cache line size will probably be out of cache when one needs to know it. This is why we use a compile time constant for cache line size. Cache line size is 64 for the current generation of Intel/AMD CPUs.
If an object spans multiple cache lines then prefetching whole object should be done by prefetching at least one address from each of the cache lines that object occupies. How many lines are needed depends on three things: object size, cache line size, and object starting address. If CacheLineSize is lower than the actual line size then more prefetches than necessary will be generated (2, 4, or more per cache line if cache line size is power of 2). This may be somewhat wasteful so this number may need to be adjusted in the far future when all CPUs have wider cache lines.
| Enumerator | |
|---|---|
| CacheLineSize | |
Definition at line 59 of file prefetch.h.
| enum CxxUtils::CacheState : unsigned char |
State of the cached value; see below.
| Enumerator | |
|---|---|
| INVALID | |
| UPDATING | |
| VALID | |
Definition at line 27 of file CachedValue.h.
|
strong |
Results returned from emplace().
| Enumerator | |
|---|---|
| SUCCESS | All ok. |
| OVERLAP | New object was added, but overlaps with an existing range. |
| DUPLICATE | New object duplicates an existing range, and was not added. |
| EXTENDED | |
Definition at line 383 of file ConcurrentRangeMap.h.
| bool CxxUtils::all | ( | ) | const |
Return true if all bits in the set are 1.
| bool CxxUtils::any | ( | ) | const |
Return true if there are any 1 bits in the set.
Apply a set of transformation rules to this object.
| rules | The set of rules to apply. |
Recursively walk this expression, trying to apply the transformation rules in rules. If any matches are found, this expression is modified in-place and the walk is repeated. This function terminates when no further matches are found.
Warning: An infinite loop is possible if the replacement for a pattern can always be matched by another pattern.
Definition at line 410 of file CxxUtils/Root/ClassName.cxx.
Apply a set of transformation rules a class name.
param The name of the class to transform.
| rules | The set of rules to apply. |
This is just shorthand for
Apply a set of transformation rules to this object.
| rules | The set of rules to apply. |
Recursively walk this expression, trying to apply the transformation rules in rules. If any matches are found, this expression is modified in-place.
Returns true if any matches were found.
Definition at line 674 of file CxxUtils/Root/ClassName.cxx.
Helper for getting a const version of a pointer.
| p | Pointer to convert. |
Given T* p, as_const_ptr(p) will return p as a const T*.
This is similar in spirit to std::as_const (which doesn't really do what you might expect for pointers).
Definition at line 32 of file as_const_ptr.h.
| mapped_type & CxxUtils::at | ( | key_type | key | ) | const |
Look up an element in the map.
| key | The element to find. |
Returns the value associated with the key. Throws std::out_of_range if the key does not exist in the map.
| key | The element to find. |
Returns the value associated with the key. Throws std::out_of_range if the key does not exist in the map.
This returns a non-const reference to the mapped object. The mapped object must be thread-safe itself in order to safely make any changes to it.
| double CxxUtils::atof | ( | std::string_view | str | ) |
Converts a string into a double / float.
Definition at line 46 of file Control/CxxUtils/Root/StringUtils.cxx.
| int CxxUtils::atoi | ( | std::string_view | str | ) |
Helper functions to unpack numbers decoded in string into integers and doubles The strings are required to contain only digits, a floating point dot, the signs +- or a whitespace Exceptions are thrown otherwise.
Converts a string into an integer
Definition at line 40 of file Control/CxxUtils/Root/StringUtils.cxx.
|
inline |
Atomically decrement a value with a lower bound.
| a | Pointer to the atomic value. |
| bound | Lower bound for a. |
| decr | The amount by which to decrement. |
| memorder | Memory ordering. |
Atomically decrement A by DECR, provided the result is not less than BOUND. I.e., the atomic equivalent of:
Returns in any case the original value of the atomic variable.
Definition at line 41 of file atomic_bounded_decrement.h.
|
inline |
Atomically calculate maximum.
| a | Pointer to the atomic value. |
| v | The other value. |
| memorder | Memory ordering. |
Computes max(*a, v) and stores it in *a. Returns the original value of *a.
Definition at line 42 of file atomic_fetch_minmax.h.
|
inline |
Atomically calculate minimum.
| a | Pointer to the atomic value. |
| v | The other value. |
| memorder | Memory ordering. |
Computes min(*a, v) and stores it in *a. Returns the original value of *a.
Definition at line 63 of file atomic_fetch_minmax.h.
| std::vector< unsigned char > CxxUtils::base64_decode | ( | const std::string & | encoded_string | ) |
Definition at line 97 of file base64.cxx.
| std::string CxxUtils::base64_encode | ( | const unsigned char * | bytes_to_encode, |
| unsigned int | in_len ) |
Definition at line 55 of file base64.cxx.
| iterator CxxUtils::begin | ( | ) | const |
Return a begin iterator.
Iterator at the start of the map.
The mapped objects must themselves be thread-safe in order to make any changes to them through the returned iterators.
| auto CxxUtils::begin | ( | const range_with_at< T > & | s | ) |
Definition at line 67 of file range_with_at.h.
| auto CxxUtils::begin | ( | const range_with_conv< T > & | s | ) |
Definition at line 61 of file range_with_conv.h.
| auto CxxUtils::begin | ( | range_with_at< T > & | s | ) |
Definition at line 65 of file range_with_at.h.
| auto CxxUtils::begin | ( | range_with_conv< T > & | s | ) |
Definition at line 59 of file range_with_conv.h.
| auto CxxUtils::begin | ( | span< T > & | s | ) |
|
constexprnoexcept |
Reverse the bytes in n.
Copied from the example implementation given in https://en.cppreference.com/w/cpp/numeric/byteswap
Definition at line 42 of file byteswap.h.
| size_t CxxUtils::capacity | ( | ) | const |
The number of bits that this container can hold.
Return the current capacity of the map.
Return the current size (capacity) of the hash table.
| const_iterator CxxUtils::cbegin | ( | ) | const |
Iterator at the start of the map.
| const_iterator CxxUtils::cend | ( | ) | const |
Iterator at the end of the map.
| ClassName< T >::ClassName | ( | ) |
Default constructor.
Needed for STL compatibility.
Definition at line 138 of file CxxUtils/Root/ClassName.cxx.
Parse a class name into component parts.
| name | The name to parse. |
Raises a BadClassName exception if the name isn't completely parsed.
| name | The name to parse. |
Raises a ExcBadClassName exception if the name isn't completely parsed.
Definition at line 150 of file CxxUtils/Root/ClassName.cxx.
Parse a class name into component parts.
| name | The name to parse. |
Raises a BadClassName exception if the name isn't completely parsed.
| name | The name to parse. |
Raises a ExcBadClassName exception if the name isn't completely parsed.
Definition at line 168 of file CxxUtils/Root/ClassName.cxx.
Parse a class name into component parts.
| name | String containing the name to parse. |
| pos | Position in the string at which parsing should start. |
pos is updated to point to past the point where parsing stopped.
Definition at line 186 of file CxxUtils/Root/ClassName.cxx.
| void CxxUtils::clear | ( | ) |
Clear all bits in the set.
Remove all entries in the container.
This operation is not necessarily atomic; a simultaneous read may be able to see the operation partially done.
Mostly for testing — should not normally be used.
| void CxxUtils::clear | ( | const Context_t & | ctx = Updater_t::defaultContext() | ) |
Erase the table (don't change the capacity).
| ctx | Execution context. |
| void CxxUtils::clear | ( | size_t | capacity, |
| const Context_t & | ctx = Updater_t::defaultContext() ) |
| bool CxxUtils::close_to_zero | ( | T | value, |
| T | eps = std::numeric_limits<T>::epsilon() ) |
Definition at line 48 of file close_to_zero.h.
| CxxUtils::ConcurrentBitset | ( | bit_t | nbits = 0 | ) |
Constructor.
| nbits | Initial number of bits to allocate for the map. |
| CxxUtils::ConcurrentBitset | ( | ConcurrentBitset && | other | ) |
Move constructor.
| other | Container to move. |
No concurrent access may be in progress on other. After this returns, other can only be deleted.
| CxxUtils::ConcurrentBitset | ( | const ConcurrentBitset & | other | ) |
Copy constructor.
| other | Container to copy. |
The copy is not atomic. If a non-atomic update is simultaneously made to other, then the copy may have this update only partially completed.
| CxxUtils::ConcurrentBitset | ( | std::initializer_list< bit_t > | l, |
| bit_t | nbits = 0 ) |
Constructor from an initializer list.
| List | of values to set. |
| nbits | Number of bits to allocate for the map. If 0, then set the size based on the maximum value in the list. |
This allows setting specific bits in the set, like
|
delete |
|
delete |
Copy / move / assign not supported.
| CxxUtils::ConcurrentMap | ( | InputIterator | f, |
| InputIterator | l, | ||
| Updater_t && | updater, | ||
| size_type | capacity = 64, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Constructor from a range.
| f | Start iterator for the range. |
| l | End iterator for the range. |
| updater | Object used to manage memory (see comments at the start of the class). |
| capacity | The initial table capacity of the new table. (Will be rounded up to a power of two.) |
| ctx | Execution context. |
Constructor from a range of pairs.
| CxxUtils::ConcurrentMap | ( | Updater_t && | updater, |
| size_type | capacity = 64, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Hash map from integers/pointers allowing concurrent, lockless reads.
This class implements a hash map. Both the key and mapped types may be pointers or any numeric type that can fit in a uintptr_t. (However, using floating types for the key is not recommended.) It allows for concurrent access from many threads. Reads can proceed without taking out a lock, while writes are serialized with each other. Thus, this is appropriate for maps which are read-mostly.
This is based on ConcurrentHashmapImpl.
Besides the mapped key and value types, this class is templated on an UPDATER class, which is used to manage the underlying memory. See IsUpdater.h for details. (AthenaKernel/RCUUpdater is a concrete version that should work in the context of Athena.)
The operations used for calculating the hash of the keys and comparing keys can be customized with the HASHER and MATCHER template arguments (though the defaults should usually be fine).
One value of the key must be reserved as a null value, which no real keys may take. By default this is `0', but it may be customized with the NULLVAL template argument. The map may optionally support erasures (via tombstones). To allow this, a second reserved key value must be identified and specified by the TOMBSTONE template argument. Note that the type of the NULLPTR and TOMBSTONE template arguments is a uintptr_t, not KEY.
This mostly supports the interface of std::unordered_map, with a few differences / omissions:
Performance: This is the result from running the test with –perf on my machine, with gcc 13.0.0
ConcurrentMap lookup: 0.843s wall, 0.840s user + 0.000s system = 0.840s CPU (99.6%) iterate: 0.551s wall, 0.540s user + 0.000s system = 0.540s CPU (97.9%) UnorderedMap lookup: 1.890s wall, 1.870s user + 0.000s system = 1.870s CPU (99.0%) iterate: 0.966s wall, 0.970s user + 0.000s system = 0.970s CPU (100.4%) concurrent_unordered_map lookup: 3.718s wall, 3.690s user + 0.010s system = 3.700s CPU (99.5%) iterate: 5.719s wall, 5.690s user + 0.000s system = 5.690s CPU (99.5%) ck_ht lookup: 1.471s wall, 1.460s user + 0.000s system = 1.460s CPU (99.2%) iterate: 1.519s wall, 1.500s user + 0.000s system = 1.500s CPU (98.7%)
The timing for the lookup test of UnorderedMap is probably overly-optimistic, since the test doesn't do any locking in that case. */ template <class KEY, class VALUE, template <class> class UPDATER, class HASHER = std::hash<KEY>, class MATCHER = std::equal_to<KEY>, detail::ConcurrentHashmapVal_t NULLVAL = 0, detail::ConcurrentHashmapVal_t TOMBSTONE = NULLVAL> requires (detail::IsConcurrentHashmapPayload<KEY> && detail::IsConcurrentHashmapPayload<VALUE> && detail::IsUpdater<UPDATER> && detail::IsHash<HASHER, KEY> && detail::IsBinaryPredicate<MATCHER, KEY>) class ConcurrentMap { private: / Representation type in the underlying map. using val_t = CxxUtils::detail::ConcurrentHashmapVal_t;
Translate between the Hasher/Matcher provided (which take KEY arguments) and what we need to give to the underlying implementation (which takes a uintptr_t). struct Hasher { size_t operator() (val_t k) const { return m_h (keyAsKey (k)); } HASHER m_h; }; struct Matcher { bool operator() (val_t a, val_t b) const { return m_m (keyAsKey (a), keyAsKey (b)); } MATCHER m_m; };
/ The underlying uint->uint hash table. using Impl_t = typename detail::ConcurrentHashmapImpl<UPDATER, Hasher, Matcher, NULLVAL, TOMBSTONE>;
public: / Standard STL types. using key_type = KEY; using mapped_type = VALUE; using size_type = size_t; / Updater object. using Updater_t = typename Impl_t::Updater_t; / Context type. using Context_t = typename Updater_t::Context_t; / Type for external locking. using Lock_t = typename Impl_t::Lock_t;
/ Ensure that the underlying map can store our types. static_assert( sizeof(typename Impl_t::val_t) >= sizeof(key_type) ); static_assert( sizeof(typename Impl_t::val_t) >= sizeof(mapped_type) );
/**
Constructor.
| CxxUtils::ConcurrentRangeMap | ( | Updater_t && | updater, |
| std::shared_ptr< IPayloadDeleter > | payloadDeleter, | ||
| size_t | capacity = 16, | ||
| const COMPARE & | compare = COMPARE() ) |
|
delete |
|
delete |
Copy / move / assign not supported.
| CxxUtils::ConcurrentToValMap | ( | InputIterator | f, |
| InputIterator | l, | ||
| Updater_t && | updater, | ||
| size_type | capacity = 64, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Constructor from a range.
| f | Start iterator for the range. |
| l | End iterator for the range. |
| updater | Object used to manage memory (see comments at the start of the class). |
| capacity | The initial table capacity of the new table. (Will be rounded up to a power of two.) |
| ctx | Execution context. |
Constructor from a range of pairs.
| CxxUtils::ConcurrentToValMap | ( | Updater_t && | updater, |
| size_type | capacity = 64, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Hash map from pointers/integers to arbitrary objects allowing concurrent, lockless reads.
This class implements a hash map, using keys that may be pointers or any integer type that can fit in an uintptr_t. The mapped type is arbitrary. It allows for concurrent access from many threads. Reads can proceed without taking out a lock, while writes are serialized with each other. Thus, this is appropriate for maps which are read-mostly.
This class includes non-const references that can be used to obtain non-const references to the mapped objects. Howeer, the mapped objects must themselves the thread-safe in order to safely modify them in a multithreaded context.
This is based on ConcurrentHashmapImpl.
Besides the key and mapped value types, this class is templated on an UPDATER class, which is used to manage the underlying memory. See IsUpdater.h for details. (AthenaKernel/RCUUpdater is a concrete version that should work in the context of Athena.)
The operations used for calculating the hash of the keys and comparing keys can be customized with the HASHER and MATCHER template arguments (though the defaults should usually be fine).
One value of the key must be reserved as a null value, which no real keys may take. By default this is `0', but it may be customized with the NULLVAL template argument. Note that the type of the NULLPTR template argument is a uintptr_t, not KEY.
This mostly supports the interface of std::unordered_map, with a few differences / omissions:
The mapped value can be given as any of:
I.e., any of these should work:
*
*/ template <class KEY, class VALUE, template <class> class UPDATER, class HASHER = std::hash<KEY>, class MATCHER = std::equal_to<KEY>, detail::ConcurrentHashmapVal_t NULLVAL = 0> requires (detail::IsConcurrentHashmapPayload<KEY> && detail::IsUpdater<UPDATER> && detail::IsHash<HASHER, KEY> && detail::IsBinaryPredicate<MATCHER, KEY>) class ConcurrentToValMap { private: / Representation type in the underlying map. using val_t = CxxUtils::detail::ConcurrentHashmapVal_t;
Translate between the Hasher/Matcher provided (which take KEY arguments) and what we need to give to the underlying implementation (which takes a uintptr_t). struct Hasher { size_t operator() (val_t k) const { return m_h (keyAsKey (k)); } HASHER m_h; }; struct Matcher { bool operator() (val_t a, val_t b) const { return m_m (keyAsKey (a), keyAsKey (b)); } MATCHER m_m; };
/ The underlying uint->uint hash table. using Impl_t = typename detail::ConcurrentHashmapImpl<UPDATER, Hasher, Matcher, NULLVAL>;
public: / Standard STL types. using key_type = KEY; using mapped_type = VALUE; using size_type = size_t; / Updater object. using Updater_t = typename Impl_t::Updater_t; / Context type. using Context_t = typename Updater_t::Context_t;
/**
Constructor.
| bool CxxUtils::contains | ( | key_type | key | ) | const |
Test if a key is in the container.
| key | The key to test. |
| void CxxUtils::convertToNumber | ( | std::string_view | str, |
| dType & | number ) |
Definition at line 20 of file StringUtilsTemplates.h.
|
inline |
Copy a range with bounds restriction.
| input | Input range |
| output | Output range |
copy_bounded written in terms of iterator ranges.
We have this as a distinct overload in order to be able to pass a CxxUtils::span temporary as the second argument.
Definition at line 121 of file copy_bounded.h.
|
inline |
Copy a range with bounds restriction.
| input | Input range |
| output | Output range |
copy_bounded written in terms of iterator ranges.
Definition at line 99 of file copy_bounded.h.
|
inline |
Copy a range with bounds restriction.
| begi | Start of input range. |
| endi | End of input range. |
| bego | Start of output range. |
| endo | End of output range. |
Like std::copy(begi, endi, bego), except that it will not copy more than std::distance(bego, endo) elements.
Copies exactly n = std::min (std::distance(begi,endi), std::distance(bego,endo)) elements. Returns bego + n.
Definition at line 79 of file copy_bounded.h.
|
inline |
Copy a range with bounds restriction; generic version.
Definition at line 31 of file copy_bounded.h.
|
inline |
Copy a range with bounds restriction; random_access_iterator version.
Definition at line 51 of file copy_bounded.h.
| bit_t CxxUtils::count | ( | ) | const |
Count the number of 1 bits in the set.
| size_t CxxUtils::count | ( | bit_t | bit | ) | const |
Test to see if a bit is set.
| bit | Number of the bit to test. |
Returns 0 if bit is beyond the end of the set.
| size_type CxxUtils::count | ( | key_type | key | ) | const |
Return the number of times a given key is in the container.
| key | The key to test. |
Returns either 0 or 1, depending on whether or not the key is in the map.
| uint64_t CxxUtils::crc64 | ( | const char * | data, |
| size_t | data_len ) |
Find the CRC-64 of a string, with the default CRC.
| data | Pointer to the string to hash. |
| data_len | Length of the string to hash, in bytes. |
Definition at line 709 of file crc64.cxx.
Find the CRC-64 of a string,.
| table | Precomputed CRC tables and constants. |
| data | Pointer to the string to hash. |
| data_len | Length of the string to hash, in bytes. |
This is the default implementation, used on platforms without pclmul.
Definition at line 696 of file crc64.cxx.
| uint64_t CxxUtils::crc64 | ( | const std::string & | s | ) |
Find the CRC-64 of a string, using the default polynomial.
| str | The string to hash. |
| uint64_t CxxUtils::crc64_bytewise | ( | const char * | data, |
| size_t | data_len ) |
Find the CRC-64 of a string, using a byte-by-byte algorithm, with the default CRC.
| table | Precomputed CRC tables and constants. |
| data | Pointer to the string to hash. |
| data_len | Length of the string to hash, in bytes. |
Find the CRC-64 of a string, using a byte-by-byte algorithm.
| table | Precomputed CRC tables and constants. |
| data | Pointer to the string to hash. |
| data_len | Length of the string to hash, in bytes. |
Definition at line 560 of file crc64.cxx.
| uint64_t CxxUtils::crc64_bytewise | ( | const std::string & | s | ) |
Find the CRC-64 of a string, using a byte-by-byte algorithm, with the default CRC.
| table | Precomputed CRC tables and constants. |
| s | String to hash. |
| uint64_t CxxUtils::crc64addint | ( | uint64_t | crc, |
| uint64_t | x ) |
| std::string CxxUtils::crc64digest | ( | const std::string & | str | ) |
Return a CRC-64 digest of a string.
| str | The string to hash. |
| std::string CxxUtils::crc64format | ( | uint64_t | crc | ) |
| void CxxUtils::deleteCRCTable | ( | CxxUtils::CRCTable * | table | ) |
| const IPayloadDeleter & CxxUtils::deleter | ( | ) |
Return a reference to the payload deleter object.
|
inline |
Return difference phiA - phiB in range [-pi, pi].
Definition at line 42 of file phihelper.h.
| std::pair< const_iterator, bool > CxxUtils::emplace | ( | const Lock_t & | lock, |
| key_type | key, | ||
| mapped_type | val, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Add an element to the map, with external locking.
| lock | The lock object returned from lock(). |
| key | The key of the new item to add. |
| val | The value of the new item to add. |
| ctx | Execution context. |
This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
| EmplaceResult CxxUtils::emplace | ( | const RANGE & | range, |
| payload_unique_ptr | ptr, | ||
| bool | tryExtend = false, | ||
| const typename Updater_t::Context_t & | ctx = Updater_t::defaultContext() ) |
Add a new element to the map.
| range | Validity range for this element. |
| ptr | Payload for this element. |
| tryExtend | If true, then allow an existing range to be extended (see below). |
| ctx | Execution context. |
Returns SUCCESS if the new element was successfully inserted. Returns DUPLICATE if the range compared equal to an existing one. In that case, no new element is inserted (and ptr gets deleted). Returns EXTEND if the range of the last element was extended to range. This happens if tryExtend is true, range is equal to the range of the last element (according to m_compare), and the range can be extended according to extendRange. (This will generally mean that the start time of range matches the last range, and end time of range is after the end time of the last range.) In this case, again no new element is inserted and ptr is deleted. Returns OVERLAP if the range of the new element overlaps an existing element (the new element is still inserted).
| std::pair< const_iterator, bool > CxxUtils::emplace | ( | key_type | key, |
| const mapped_type & | val, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Add an element to the map.
| key | The key of the new item to add. |
| val | The value of the new item to add. |
| ctx | Execution context. |
This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
| std::pair< const_iterator, bool > CxxUtils::emplace | ( | key_type | key, |
| mapped_type && | val, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Add an element to the map.
| key | The key of the new item to add. |
| val | The value of the new item to add. |
| ctx | Execution context. |
This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
| std::pair< const_iterator, bool > CxxUtils::emplace | ( | key_type | key, |
| mapped_type | val, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Add an element to the map.
| key | The key of the new item to add. |
| val | The value of the new item to add. |
| ctx | Execution context. |
This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
| std::pair< const_iterator, bool > CxxUtils::emplace | ( | key_type | key, |
| std::unique_ptr< mapped_type > | val, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Add an element to the map.
| key | The key of the new item to add. |
| val | The value of the new item to add. |
| ctx | Execution context. |
This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
| bool CxxUtils::empty | ( | ) | const |
| void CxxUtils::ConcurrentBitset::emptyGarbage | ( | ) |
Clean up old versions of the set.
The insert and assignment operations may need to grow the set. The original version of the set is not deleted immediately, since other threads may still be accessing it. Call this when no other threads can be accessing old versions in order to clean them up.
Definition at line 153 of file ConcurrentBitset.cxx.
| iterator CxxUtils::end | ( | ) | const |
Return an end iterator.
Iterator at the end of the map.
The mapped objects must themselves be thread-safe in order to make any changes to them through the returned iterators.
| auto CxxUtils::end | ( | const range_with_at< T > & | s | ) |
Definition at line 71 of file range_with_at.h.
| auto CxxUtils::end | ( | const range_with_conv< T > & | s | ) |
Definition at line 65 of file range_with_conv.h.
| auto CxxUtils::end | ( | range_with_at< T > & | s | ) |
Definition at line 69 of file range_with_at.h.
| auto CxxUtils::end | ( | range_with_conv< T > & | s | ) |
Definition at line 63 of file range_with_conv.h.
| auto CxxUtils::end | ( | span< T > & | s | ) |
Return a range of iterators with entries matching key.
| key | The element to find. |
As keys are unique in this container, this is either a single-element range, or both iterators are equal to end().
| key | The element to find. |
As keys are unique in this container, this is either a single-element range, or both iterators are equal to end().
The mapped objects must themselves be thread-safe in order to make any changes to them through the returned iterators.
| ConcurrentBitset & CxxUtils::erase | ( | bit_t | bit | ) |
Turn off one bit.
| bit | The bit to turn off. |
Does nothing if bit beyond the end of the set.
| void CxxUtils::erase | ( | const key_query_type & | key, |
| const typename Updater_t::Context_t & | ctx = Updater_t::defaultContext() ) |
Erase the first item less than or equal to KEY.
| key | The key to search erase. |
| ctx | Execution context. |
| bool CxxUtils::erase | ( | const Lock_t & | lock, |
| key_type | key ) |
Erase an entry from the table, with external locking.
Mark the corresponding entry as deleted. Return true on success, false on failure (key not found).
The tombstone value must be different from the null value.
This may cause the key type returned by an iterator to change asynchronously to the tombstone value.
| bool CxxUtils::erase | ( | key_type | key | ) |
Erase an entry from the table.
| key | The key to erase. |
Mark the corresponding entry as deleted. Return true on success, false on failure (key not found).
The tombstone value must be different from the null value.
This may cause the key type returned by an iterator to change asynchronously to the tombstone value.
| size_t CxxUtils::erased | ( | ) | const |
The number of erased elements in the current table.
| void CxxUtils::exctrace | ( | const std::exception & | e, |
| IOFD | fd = IOFD_INVALID ) |
Print out information for the last exception.
Prints the supplied exception, plus the backtrace from the last exception, if available.
| e | The exception to print. |
| fd | The file descriptor to which to write. |
Definition at line 59 of file exctrace.cxx.
|
private |
Expand the container.
| new_nbits | The desired new size of the container. |
|
private |
Expand the container: out-of-line portion.
| new_nbits | The desired new size of the container. |
Definition at line 167 of file ConcurrentBitset.cxx.
|
private |
Extend the range of the last entry of the map.
| Lock | object. |
| extendedRange | New range to use for the last entry. |
| ctx | Execution context. |
Implementation of extendLastRange; see there for details. Must be called with the lock held.
| int CxxUtils::extendLastRange | ( | const RANGE & | newRange, |
| const typename Updater_t::Context_t & | ctx = Updater_t::defaultContext() ) |
Extend the range of the last entry of the map.
| newRange | New range to use for the last entry. |
| ctx | Execution context. |
The range of the last entry in the map is updated to newRange. Does nothing if the map is empty. This will make a new version of implementation data.
The semantics of what it means to extend a range are given by the extendRange method of the COMPARE object (see above).
Returns -1 if there was an error; 1 if the last range was extended; and 0 if nothing was changed.
| const_iterator CxxUtils::find | ( | bit_t | bit | ) | const |
If bit bit is set, return an iterator pointing to it.
Otherwise, return an end iterator.
| bit | Bit number to test. |
| const_iterator CxxUtils::find | ( | const key_query_type & | key | ) | const |
Search for the first item less than or equal to KEY.
| key | The key to search for. |
| iterator CxxUtils::find | ( | key_type | key | ) | const |
Look up an element in the map.
| key | The element to find. |
Returns either an iterator referencing the found element or end().
| key | The element to find. |
Returns either an iterator referencing the found element or end().
The mapped object must itself be thread-safe in order to make any changes to it through the returned iterator.
| ConcurrentBitset & CxxUtils::flip | ( | ) |
Flip the state of all bits in the set.
This operation is not necessarily atomic; a simultaneous read may be able to see the operation partially done.
| ConcurrentBitset & CxxUtils::flip | ( | bit_t | bit | ) |
Flip the value of one bit.
| bit | The bit to turn flip. |
Does nothing if bit beyond the end of the set.
| void CxxUtils::forceClear | ( | ) |
Erase the table in-place.
This method avoids allocating a new version of the table. However, it is not safe to use concurrently — no other threads may be accessing the container at the same time, either for read or write.
| void CxxUtils::fromArrayrep | ( | const CaloRec::Arrayrep & | rep, |
| CxxUtils::Array< N > & | x ) |
| void CxxUtils::fromArrayrep | ( | const CaloRec::Arrayrep & | rep, |
| T & | x ) |
| std::string CxxUtils::fullName | ( | ) | const |
Return the full name of the expression.
|
private |
Do a lookup in the table.
| key | The key to look up. |
Returns an iterator of the underlying map pointing at the found entry or end();
| T CxxUtils::get_unaligned | ( | const uint8_t *ATH_RESTRICT & | p | ) |
Define templated versions of the above functions.
|
inline |
Read a 2-byte little-endian value from a possibly unaligned pointer.
| p | Pointer from which to read. Advanced to the next value. |
Reads a little-endian value, regardless of the host byte ordering, and advances the pointer. Should not rely on undefined behavior, regardless of the alignment of p.
If used in a loop, you'll get better code with a restricted pointer.
Definition at line 63 of file get_unaligned.h.
|
inline |
Read a 4-byte little-endian value from a possibly unaligned pointer.
| p | Pointer from which to read. Advanced to the next value. |
Reads a little-endian value, regardless of the host byte ordering, and advances the pointer. Should not rely on undefined behavior, regardless of the alignment of p.
If used in a loop, you'll get better code with a restricted pointer.
Definition at line 83 of file get_unaligned.h.
|
inline |
Read an 8-byte little-endian value from a possibly unaligned pointer.
| p | Pointer from which to read. Advanced to the next value. |
Reads a little-endian value, regardless of the host byte ordering, and advances the pointer. Should not rely on undefined behavior, regardless of the alignment of p.
If used in a loop, you'll get better code with a restricted pointer.
Definition at line 103 of file get_unaligned.h.
|
inline |
Definition at line 195 of file get_unaligned.h.
|
inline |
Definition at line 187 of file get_unaligned.h.
|
inline |
Definition at line 211 of file get_unaligned.h.
|
inline |
Definition at line 219 of file get_unaligned.h.
|
inline |
Definition at line 227 of file get_unaligned.h.
|
inline |
Definition at line 203 of file get_unaligned.h.
|
inline |
Definition at line 163 of file get_unaligned.h.
|
inline |
Definition at line 171 of file get_unaligned.h.
|
inline |
Definition at line 179 of file get_unaligned.h.
|
inline |
Definition at line 155 of file get_unaligned.h.
|
inline |
Read a little-endian double value from a possibly unaligned pointer.
| p | Pointer from which to read. Advanced to the next value. |
Reads a little-endian value, regardless of the host byte ordering, and advances the pointer. Should not rely on undefined behavior, regardless of the alignment of p.
If used in a loop, you'll get better code with a restricted pointer.
Definition at line 140 of file get_unaligned.h.
|
inline |
Read a little-endian float value from a possibly unaligned pointer.
| p | Pointer from which to read. Advanced to the next value. |
Reads a little-endian value, regardless of the host byte ordering, and advances the pointer. Should not rely on undefined behavior, regardless of the alignment of p.
If used in a loop, you'll get better code with a restricted pointer.
Definition at line 123 of file get_unaligned.h.
|
private |
Return the begin/last pointers.
| [in,out] | last | Current value of last. |
Retrieve consistent values of the begin and last pointers. The last pointer should have already been fetched, and may be updated. Usage should be like this:
| void CxxUtils::hexdump | ( | std::ostream & | s, |
| const void * | addr, | ||
| size_t | n, | ||
| size_t | offset = 0 ) |
Make a hex dump of memory.
| s | Stream to which to write the output. |
| addr | Address at which to start dumping. |
| n | Number of byte to dump. |
| offset | Offset by which to shift the printed address (mostly for testing). |
Definition at line 37 of file hexdump.cxx.
|
inline |
Definition at line 42 of file set_unaligned.h.
|
inline |
Definition at line 43 of file set_unaligned.h.
|
inline |
Definition at line 44 of file set_unaligned.h.
| ConcurrentBitset & CxxUtils::insert | ( | bit_t | bit, |
| bit_t | new_nbits = 0 ) |
Set a bit to 1.
Expand the set if needed.
| bit | Number of the bit to set. |
| new_nbits | Hint for new size of set, if it needs to be expanded. |
If bit is past the end of the container, then the container will be expanded as needed.
This operation is incompatible with any other simultaneous writes to the same set (reads are ok).
| ConcurrentBitset & CxxUtils::insert | ( | const ConcurrentBitset & | other | ) |
Turn on bits listed in another set.
| other | Set of bits to turn on. |
This is the same as operator|=, except that if the size of other is larger than this set, then this set will be expanded to match other.
This operation is incompatible with any other simultaneous writes to the same set (reads are ok).
| std::pair< const_iterator, bool > CxxUtils::insert | ( | const PAIR & | p | ) |
Add an element to the map.
| p | The item to add. Should be a pair where first is the key and second is the integer value. |
This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
For external locking, use emplace().
| std::pair< const_iterator, bool > CxxUtils::insert | ( | const PAIR & | p, |
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Add an element to the map.
| p | The item to add. Should be a pair where first is the string key and second is the integer value. |
| ctx | Execution context. |
This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
| void CxxUtils::insert | ( | InputIterator | first, |
| InputIterator | last ) |
Insert a range of elements to the map.
| first | Start of the range. |
| last | End of the range. |
The range should be a sequence of pairs where first is the string key and second is the integer value.
| void CxxUtils::insert | ( | InputIterator | first, |
| InputIterator | last, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Insert a range of elements to the map.
| first | Start of the range. |
| last | End of the range. |
| ctx | Execution context. |
The range should be a sequence of pairs where first is the string key and second is the integer value.
| ConcurrentBitset & CxxUtils::insert | ( | ITERATOR | beg, |
| ITERATOR | end, | ||
| bit_t | new_nbits = 0 ) |
Set several bits to 1.
Expand the set if needed.
| beg | Start of range of bits to set. |
| end | End of range of bits to set. |
| new_nbits | Hint for new size of set, if it needs to be expanded. |
The iteration range should be over something convertible to bit_t. If any bit is past the end of the container, then the container will be expanded as needed.
This operation is incompatible with any other simultaneous writes to the same set (reads are ok).
Example:
| std::pair< const_iterator, bool > CxxUtils::insert | ( | PAIR && | p, |
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Add an element to the map.
| p | The item to add. Should be a pair where first is the string key and second is the integer value. |
| ctx | Execution context. |
This will not overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
| ConcurrentBitset & CxxUtils::insert | ( | std::initializer_list< bit_t > | l, |
| bit_t | new_nbits = 0 ) |
Set several bits to 1.
Expand the set if needed.
| l | List of bits to set. |
| new_nbits | Hint for new size of set, if it needs to be expanded. |
If any bit is past the end of the container, then the container will be expanded as needed.
This operation is incompatible with any other simultaneous writes to the same set (reads are ok).
Example:
| std::pair< const_iterator, bool > CxxUtils::insert_or_assign | ( | const Lock_t & | lock, |
| key_type | key, | ||
| mapped_type | val, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Add an element to the map, or overwrite an existing one, with external locking.
| lock | The lock object returned from lock(). |
| key | The key of the new item to add. |
| val | The value of the new item to add. |
| ctx | Execution context. |
This will overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
| std::pair< const_iterator, bool > CxxUtils::insert_or_assign | ( | key_type | key, |
| mapped_type | val, | ||
| const Context_t & | ctx = Updater_t::defaultContext() ) |
Add an element to the map, or overwrite an existing one.
| key | The key of the new item to add. |
| val | The value of the new item to add. |
| ctx | Execution context. |
This will overwrite an existing entry. The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
|
private |
Install a new implementation instance and make it visible.
| new_impl | The new instance. |
| new_begin | Begin pointer for the new instance. |
| new_end | End pointer for the new instance. (Usual STL meaning of end. If the instance is empty, then new_end should match new_begin.) |
| ctx | Execution context. |
|
inlinestatic |
Definition at line 51 of file base64.cxx.
| bool CxxUtils::isConst | ( | ) | const |
Get the const flag for this expression.
|
staticprivate |
Convert an underlying key value to this type's key value.
| val | The underlying key value. |
|
staticprivate |
Convert an underlying key value to this type's key value.
| val | The underlying key value. |
|
staticprivate |
Convert this type's key value to an underlying key value.
| k | The key. |
|
staticprivate |
Convert this type's key value to an underlying key value.
| k | The key. |
|
inline |
Definition at line 42 of file get_unaligned.h.
|
inline |
Definition at line 43 of file get_unaligned.h.
|
inline |
Definition at line 44 of file get_unaligned.h.
| Lock_t CxxUtils::lock | ( | ) |
Take a lock on the container.
Take a lock on the container. The lock can then be passed to insertion methods, allowing to factor out the locking inside loops. The lock will be released when the lock object is destroyed.
| auto CxxUtils::make_reverse_wrapper | ( | T & | r | ) |
Make a reverse_wrapper for a given container-like object.
Definition at line 46 of file reverse_wrapper.h.
| auto CxxUtils::make_span | ( | CONTAINER & | c | ) |
| std::unique_ptr< CRCTable > CxxUtils::makeCRCTable | ( | uint64_t | p, |
| uint64_t | initial = 0xffffffffffffffff ) |
|
staticprivate |
Convert an underlying mapped value to this type's mapped value.
| val | The underlying mapped value. |
|
staticprivate |
Convert an underlying mapped value a pointer to this type's mapped value.
| val | The underlying mapped value. |
|
staticprivate |
Convert this type's mapped value to an underlying mapped value.
| val | The mapped value. |
|
staticprivate |
Convert this type's mapped value to an underlying mapped value.
| val | The mapped value. |
Match this expression against a pattern.
| pattern | The pattern to match. | |
| [out] | matches | Dictionary of pattern substitutions. |
Return true if pattern matches the current expression. pattern may contain dummy variables of the form $T. On a successful return, the map matches contains the variable assignments needed for the match.
|
private |
Match this expression against a pattern.
| pattern | The pattern to match. | |
| topLevel | True if this is the outermost level of matching. | |
| [out] | matches | Dictionary of pattern substitutions. |
Return true if pattern matches the current expression. pattern may contain dummy variables of the form $T. On a successful return, the map matches contains the variable assignments needed for the match.
Definition at line 603 of file CxxUtils/Root/ClassName.cxx.
|
inline |
Find the maximum transformed element in a range.
Evaluates f(x) for each x in r and finds the maximum. Returns a pair (fmax, itmax), where fmax is this maximum value, and itmax is an iterator pointing at the corresponding element in r. If more than one element has the same maximum value, the iterator of the first will be returned.
Precondition: Range r is not empty.
Definition at line 82 of file minmax_transformed_element.h.
| size_t CxxUtils::maxSize | ( | ) | const |
Return the maximum size of the map.
|
inline |
Find the minimum transformed element in a range.
Evaluates f(x) for each x in r and finds the minimum. Returns a pair (fmin, itmin), where fmin is this minimum value, and itmin is an iterator pointing at the corresponding element in r. If more than one element has the same minimum value, the iterator of the first will be returned.
Precondition: Range r is not empty.
Definition at line 50 of file minmax_transformed_element.h.
| uint32_t CxxUtils::MurmurHash2 | ( | const void * | key, |
| int | len, | ||
| uint32_t | seed ) |
Definition at line 42 of file MurmurHash2.cxx.
| uint32_t CxxUtils::MurmurHash2A | ( | const void * | key, |
| int | len, | ||
| uint32_t | seed ) |
Definition at line 220 of file MurmurHash2.cxx.
| uint64_t CxxUtils::MurmurHash64A | ( | const void * | key, |
| int | len, | ||
| uint64_t | seed ) |
Definition at line 103 of file MurmurHash2.cxx.
| uint64_t CxxUtils::MurmurHash64B | ( | const void * | key, |
| int | len, | ||
| uint64_t | seed ) |
Definition at line 155 of file MurmurHash2.cxx.
| uint32_t CxxUtils::MurmurHashAligned2 | ( | const void * | key, |
| int | len, | ||
| uint32_t | seed ) |
Definition at line 324 of file MurmurHash2.cxx.
| uint32_t CxxUtils::MurmurHashNeutral2 | ( | const void * | key, |
| int | len, | ||
| uint32_t | seed ) |
Definition at line 267 of file MurmurHash2.cxx.
| const std::string & CxxUtils::name | ( | ) | const |
Return the root name of the expression.
In A::B<C>, the root name is B.
|
staticprivate |
Find number of blocks needed to hold a given number of bits.
| nbits | The number of bits. |
|
private |
Create a new, uninitialized implementation object.
| nbits | Number of bits to allocate. |
This will allocate memory for the Impl object, but will does not run the constructor.
| size_t CxxUtils::nInserts | ( | ) | const |
Return the number times an item was inserted into the map.
| bool CxxUtils::none | ( | ) | const |
Return true if there are no 1 bits in the set.
| std::string CxxUtils::normalizeFunctionName | ( | const std::string & | fname | ) |
Normalize a pretty-printed C++ function name.
Clean `allocator' template arguments from the function f.
| fname | The name to normalize. |
A C++ compiler can provide a complete printable name of the current function, though for example PRETTY_FUNCTION. This is useful to include in diagnostic messages. However, the exact string generated by different compilers may differ slightly. This can then cause issues if one is trying to compare the output of tests to an expected reference.
This function tries to normalize the function name strings so that they are the same, at least between gcc and clang.
| f | Name of the function to clean. */ std::string clean_allocator (std::string f) { std::string::size_type ipos = 0; while ((ipos = f.find (", std::allocator", ipos)) != std::string::npos) { const char* p = f.c_str() + ipos + 16; while (isspace (*p)) ++p; if (*p == '<') { ++p; int nest = 1; while (nest > 0 && *p) { if (*p == '<') ++nest; else if (*p == '>') –nest; ++p; } if (nest == 0) { if (ipos > 0 && f[ipos-1] != '>') { while (isspace (*p)) ++p; } f.erase (ipos, p-f.c_str()-ipos); p = f.c_str() + ipos; } } ipos = p - f.c_str(); } return f; } |
std::string munge_string_name (const std::string& str_in) { std::string s = str_in;
std::string::size_type ipos = 0; while ((ipos = s.find ("std::basic_string<", ipos)) != std::string::npos) { std::string::size_type beg = ipos; ipos += 18; int inest = 1; while (inest > 0 && ipos < s.size()) { if (s[ipos] == '<') ++inest; else if (s[ipos] == '>') –inest; ++ipos; } s.replace (beg, ipos-beg, "std::string"); ipos = beg+11; }
for (size_t i = 0; i < s.size(); i++) { if ((i == 0 || (s[i-1] != ':' && !isalnum(s[i-1]))) && strncmp (s.c_str()+i, "string", 6) == 0 && !isalnum(s[i+6])) { s.replace (i, 6, "std::string"); } } return s; }
std::string munge_punct (const std::string& str_in) { std::string s = str_in; for (size_t i = 0; i < s.size()-1; i++) { if (s[i] == ' ' && (s[i+1] == '*' || s[i+1] == '&')) s.erase (i, 1); } return s; }
std::string do_replace (std::string s, const std::string& pat, const std::string& rep) { std::string::size_type ipos = 0; while ((ipos = s.find (pat, ipos)) != std::string::npos) s.replace (ipos, pat.size(), rep); return s; }
std::string munge_names (const std::string& str_in) { std::string s = do_replace (str_in, "SG::DataProxyStorageData::pointer", "void*"); s = do_replace (s, "DPSD::pointer", "void*"); s = do_replace (s, "SG::auxid_t", "unsigned long"); s = do_replace (s, "auxid_t", "unsigned long"); s = do_replace (s, "void* ", "void*"); s = do_replace (s, "CLID", "unsigned int");
if (s.compare (0, 8, "virtual ") == 0) s.erase (0, 8); return s; }
/**
Normalize a pretty-printed C++ function name.
| fname | The name to normalize. |
A C++ compiler can provide a complete printable name of the current function, though for example PRETTY_FUNCTION. This is useful to include in diagnostic messages. However, the exact string generated by different compilers may differ slightly. This can then cause issues if one is trying to compare the output of tests to an expected reference.
This function tries to normalize the function name strings so that they are the same, at least between gcc and clang.
Definition at line 135 of file normalizeFunctionName.cxx.
| size_t ClassName< T >::ntargs | ( | ) | const |
Return number of template arguments.
Definition at line 275 of file CxxUtils/Root/ClassName.cxx.
|
inlineconstexpr |
Negation.
Definition at line 158 of file vec_fb.h.
| bool CxxUtils::operator!= | ( | const ClassName & | other | ) | const |
Test two expressions for inequality.
| bool CxxUtils::operator!= | ( | const ConcurrentBitset & | other | ) | const |
Test two sets for inequality.
| other | The other set to test. |
|
inline |
V1 && V2.
Definition at line 169 of file vec_fb.h.
|
inline |
V && S.
Definition at line 191 of file vec_fb.h.
|
inline |
S && V.
Definition at line 180 of file vec_fb.h.
| ConcurrentBitset & CxxUtils::operator&= | ( | const ConcurrentBitset & | other | ) |
AND this set with another set.
| other | The other set. |
This operation is not necessarily atomic; a simultaneous read may be able to see the operation partially done.
| ConcurrentBitset & CxxUtils::operator-= | ( | const ConcurrentBitset & | other | ) |
Subtract another set from this set.
| other | The other set. |
This is the same as (*this) &= ~other;
This operation is not necessarily atomic; a simultaneous read may be able to see the operation partially done.
| std::ostream & CxxUtils::operator<< | ( | std::ostream & | s, |
| const Array< N > & | a ) |
| ConcurrentBitset & CxxUtils::operator= | ( | ConcurrentBitset && | other | ) |
Move.
| other | Bitset from which to move. |
No concurrent access may be in progress on other. After this returns, other can only be deleted.
|
delete |
|
delete |
| ConcurrentBitset & CxxUtils::operator= | ( | const ConcurrentBitset & | other | ) |
Assignment.
| other | Bitset from which to assign. |
The copy is not atomic. If a non-atomic update is simultaneously made to other, then the copy may have this update only partially completed.
|
delete |
|
delete |
| bool CxxUtils::operator== | ( | const ConcurrentBitset & | other | ) | const |
Test two sets for equality.
| other | The other set to test. |
| reference CxxUtils::operator[] | ( | bit_t | bit | ) | const |
Return the value of one bit.
Return a reference to one bit.
| bit | The number of the bit to test. |
| bit | The number of the bit to reference. |
The reference will be invalidated by calls to insert() or operator=. Effects are undefined if bit is past the end of the set.
| ConcurrentBitset & CxxUtils::operator^= | ( | const ConcurrentBitset & | other | ) |
XOR this set with another set.
| other | The other set. |
This operation is not necessarily atomic; a simultaneous read may be able to see the operation partially done.
| ConcurrentBitset & CxxUtils::operator|= | ( | const ConcurrentBitset & | other | ) |
OR this set with another set.
| other | The other set. |
This operation is not necessarily atomic; a simultaneous read may be able to see the operation partially done.
|
inline |
V1 || V2.
Definition at line 202 of file vec_fb.h.
| ConcurrentBitset CxxUtils::operator~ | ( | ) | const |
Return a new set that is the complement of this set.
|
private |
|
private |
Parse a namespace qualification.
| name | The string containing the name. |
| pos | Position in the string to start parsing. |
When this is called, the namespace part has already been parsed, and the next two characters in name are ::. This reads in the remainder of the string as a ClassName, and then moves it inside the namespace given by the current object.
On return, pos will be updated to point just past the last character consumed.
Definition at line 522 of file CxxUtils/Root/ClassName.cxx.
|
private |
Parse a primary part of the class name.
| name | The string containing the name. |
| pos | Position in the string to start parsing. |
The primary part of the class name is a string without namespace and template delimiters.
On return, pos will be updated to point just past the last character consumed.
Definition at line 488 of file CxxUtils/Root/ClassName.cxx.
|
private |
Parse the template part of a name.
| name | The string containing the name. |
| pos | Position in the string to start parsing. |
When this is called, the qualified name part of the name has already been parsed, and the next character in name is ::. This reads in template arguments from name.
On return, pos will be updated to point just past the last character consumed.
Definition at line 554 of file CxxUtils/Root/ClassName.cxx.
|
inline |
Bisect (average) the angle spanned by phiA and phiB.
The average is calculated by rotating phiA half-way counter-clockwise onto phiB. Note that his method is not symmetric in its arguments. Typical use-cases are to determine the centre of a region in the detector.
The returned value is within the range [-pi, pi].
Definition at line 77 of file phihelper.h.
|
inline |
Calculate average of two angles.
The average is calculated as the angle of the sum of the two unit vectors with angles phiA and phiB. As such it always returns the angle in the narrower of the two complimentary regions spanned by phiA and phiB. If the vector sum is zero, return the angle within [-pi/2, pi/2]. This method is symmetric in its arguments except if |mean| equals pi.
The returned value is within the range [-pi, pi].
Definition at line 60 of file phihelper.h.
|
inline |
Prefetch an N-byte block of memory.
| [in] | ptr | Starting address of the block. |
Definition at line 85 of file prefetch.h.
|
inline |
Prefetch next object in sequence.
| iter | Current iteration position. |
| endIter | End of the sequence. |
Iter is a ForwardIterator over pointers.
Prefetches next object in a collection of pointers. Accepts two iterators: the first iterator is the current iteration position, and the second iterator is the end iterator for the whole sequence. The first iterator must not be equal to the end iterator (this is not checked). This increments the iterator and, if not equal to the end, prefetches the complete object referenced by the pointer.
Definition at line 130 of file prefetch.h.
|
inline |
Generic prefetch of the object of specific types (sizes).
| [in] | address | memory location to prefetch |
This method will prefetch as many cache lines as needed to store the object of the specified type in memory. Type is specified as a template argument.
Definition at line 108 of file prefetch.h.
|
inline |
Generic prefetch method.
| [in] | address | memory location to prefetch |
This is generic method that does not have any extra behavior. It only prefetches the whole cache line which contains the specified memory location. It does not incur any additional overhead and may be the most efficient method for small objects which have a high chance of being on just a single cache line.
Definition at line 73 of file prefetch.h.
|
inline |
Prefetch two objects.
| iter | Current iteration position. |
| endIter | End of the sequence. |
Iter is a ForwardIterator over pointers.
Prefetches the current and next objects in a collection of pointers. Accepts two iterators: the first iterator is the current iteration position, and the second is the end iterator for the whole sequence. If the first iterator is not equal to end the iterator, the object to which it points is prefetched. Then the iterator is incremented and, if not equal to the end iterator, the next objects is also prefetched.
Definition at line 154 of file prefetch.h.
|
private |
Insert an entry in the table.
| key | The key of the new item to add. |
| val | The new mapped value to add. |
| ctx | Execution context. |
The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
|
private |
Insert / overwrite an entry in the table, with external locking.
| lock | The lock object returned from lock(). |
| key | The key of the new item to add. |
| val | The value of the new item to add. |
| overwrite | If true, allow overwriting an existing entry. |
| ctx | Execution context. |
The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
|
private |
Insert / overwrite an entry in the table.
| key | The key of the new item to add. |
| val | The value of the new item to add. |
| overwrite | If true, allow overwriting an existing entry. |
| ctx | Execution context. |
The first element in the returned pair is an iterator referencing the added item. The second is a flag that is true if a new element was added.
| std::string ClassName< T >::qualifiedName | ( | ) | const |
Return the namespace-qualified name of the expression.
Return the root name of the expression.
In A::B<C>, this is A::B.
In A::B<C>, the root name is B.
Definition at line 240 of file CxxUtils/Root/ClassName.cxx.
| void CxxUtils::quiescent | ( | const Context_t & | ctx | ) |
Called when this thread is no longer referencing anything from this container.
| ctx | Execution context. |
| void CxxUtils::quiescent | ( | const typename Updater_t::Context_t & | ctx = Updater_t::defaultContext() | ) |
Called when this thread is no longer referencing anything from this container.
| ctx | Execution context. |
| iterator_range CxxUtils::range | ( | ) | const |
Return an iterator range covering the entire map.
Return a range that can be used to iterate over the container.
The mapped objects must themselves be thread-safe in order to make any changes to them through the returned iterators.
| void CxxUtils::rehash | ( | size_type | capacity | ) |
Increase the table capacity.
| capacity | The new table capacity. |
No action will be taken if capacity is smaller than the current capacity.
| void CxxUtils::reserve | ( | size_type | capacity, |
| const Context_t & | ctx = Updater_t::defaultContext() ) |
| ConcurrentBitset & CxxUtils::reset | ( | ) |
Clear all bits in the set.
This operation is not necessarily atomic; a simultaneous read may be able to see the operation partially done.
| ConcurrentBitset & CxxUtils::reset | ( | bit_t | bit | ) |
Turn off one bit.
| bit | The bit to turn off. |
Does nothing if bit beyond the end of the set.
|
constexpr |
| void CxxUtils::safeHexdump | ( | std::ostream & | s, |
| const void * | addr, | ||
| size_t | n, | ||
| size_t | offset = 0 ) |
Make a hex dump of memory, protected against bad reads.
| s | Stream to which to write the output. |
| addr | Address at which to start dumping. |
| n | Number of byte to dump. |
| offset | Offset by which to shift the printed address (mostly for testing). |
This function will skip dumping memory pages that are not readable. It may also start dumping slightly before the requested address, in order to start with an alignment of 16.
Definition at line 104 of file hexdump.cxx.
| ConcurrentBitset & CxxUtils::set | ( | ) |
Turn on all bits in the set.
This operation is not necessarily atomic; a simultaneous read may be able to see the operation partially done.
| ConcurrentBitset & CxxUtils::set | ( | bit_t | bit | ) |
Turn on one bit.
| bit | The bit to turn on. |
Does nothing if bit beyond the end of the set.
| ConcurrentBitset & CxxUtils::set | ( | bit_t | bit, |
| bool | val ) |
Set the value of one bit.
| bit | The bit to turn set. |
| val | The value to which to set it. |
Does nothing if bit beyond the end of the set.
|
constexpr |
| void CxxUtils::set_unaligned | ( | uint8_t *ATH_RESTRICT & | p, |
| T | val ) |
Define templated versions of the above functions.
|
inline |
Write a 2-byte little-endian value to a possibly unaligned pointer.
| p | Pointer to which to write. Advanced to the next value. |
| val | Value to write. |
Writes a little-endian value, regardless of the host byte ordering, and advances the pointer. Should not rely on undefined behavior, regardless of the alignment of p.
If used in a loop, you'll get better code with a restricted pointer.
Definition at line 64 of file set_unaligned.h.
|
inline |
Write a 4-byte little-endian value to a possibly unaligned pointer.
| p | Pointer to which to write. Advanced to the next value. |
| val | Value to write. |
Writes a little-endian value, regardless of the host byte ordering, and advances the pointer. Should not rely on undefined behavior, regardless of the alignment of p.
If used in a loop, you'll get better code with a restricted pointer.
Definition at line 84 of file set_unaligned.h.
|
inline |
Write an 8-byte little-endian value to a possibly unaligned pointer.
| p | Pointer to which to write. Advanced to the next value. |
| val | Value to write. |
Writes a little-endian value, regardless of the host byte ordering, and advances the pointer. Should not rely on undefined behavior, regardless of the alignment of p.
If used in a loop, you'll get better code with a restricted pointer.
Definition at line 104 of file set_unaligned.h.
|
inline |
Definition at line 197 of file set_unaligned.h.
|
inline |
Definition at line 189 of file set_unaligned.h.
|
inline |
Definition at line 213 of file set_unaligned.h.
|
inline |
Definition at line 221 of file set_unaligned.h.
|
inline |
Definition at line 229 of file set_unaligned.h.
|
inline |
Definition at line 205 of file set_unaligned.h.
|
inline |
Definition at line 165 of file set_unaligned.h.
|
inline |
Definition at line 173 of file set_unaligned.h.
|
inline |
Definition at line 181 of file set_unaligned.h.
|
inline |
Definition at line 157 of file set_unaligned.h.
|
inline |
Write a little-endian double value to a possibly unaligned pointer.
| p | Pointer to which to write. Advanced to the next value. |
| val | Value to write. |
Writes a little-endian value, regardless of the host byte ordering, and advances the pointer. Should not rely on undefined behavior, regardless of the alignment of p.
If used in a loop, you'll get better code with a restricted pointer.
Definition at line 142 of file set_unaligned.h.
|
inline |
Write a little-endian float value to a possibly unaligned pointer.
| p | Pointer to which to write. Advanced to the next value. |
| val | Value to write. |
Writes a little-endian value, regardless of the host byte ordering, and advances the pointer. Should not rely on undefined behavior, regardless of the alignment of p.
If used in a loop, you'll get better code with a restricted pointer.
Definition at line 124 of file set_unaligned.h.
| void CxxUtils::setConst | ( | ) |
Set the const flag for this expression.
| size_type CxxUtils::size | ( | ) | const |
Count the number of 1 bits in the set.
Return the current number of elements in the map.
Return the number of items currently in the map.
Note: If you regard this like a std::bitset, you would expect this to return the number of bits that the set can hold, while if you regard this like a set<bit_t>, then you would expect this to return the number of 1 bits. We follow the latter here.
Skip past spaces in a string.
| name | The string containing the name. |
| pos | Position in the string to start skipping. |
On return, pos will be updated to point just past the last character consumed.
Definition at line 584 of file CxxUtils/Root/ClassName.cxx.
| CxxUtils::span | ( | T * | beg, |
| T * | end ) -> span< T > |
| CxxUtils::span | ( | T * | ptr, |
| std::size_t | sz ) -> span< T > |
A couple needed deduction guides.
| std::string CxxUtils::strformat | ( | const char * | fmt, |
| ... ) |
return a std::string according to a format fmt and varargs
Definition at line 49 of file StrFormat.cxx.
Substitute variables into this expression.
| The | dictionary of variables to substitute. |
If this expression contains variables like $T, they are replaced with the corresponding values from matches. If a variable is present in the expression but is not in matches, ExcMissingVariable is thrown.
The substitutions are made in-place.
Definition at line 357 of file CxxUtils/Root/ClassName.cxx.
Return a copy of this expression with variables substituted.
| The | dictionary of variables to substitute. |
If this expression contains variables like $T, they are replaced with the corresponding values from matches. If a variable is present in the expression but is not in matches, ExcMissingVariable is thrown.
The substitutions are made in a copy of the expression, which is returned.
Definition at line 390 of file CxxUtils/Root/ClassName.cxx.
| void CxxUtils::swap | ( | ClassName & | other | ) |
Swap this expression with another one.
| other | The other expression with which to swap. |
| void CxxUtils::swap | ( | ConcurrentMap & | other | ) |
Swap this container with another.
| other | The container with which to swap. |
This will also call swap on the Updater object; hence, the Updater object must also support swap. The Hasher and Matcher instances are NOT swapped.
This operation is NOT thread-safe. No other threads may be accessing either container during this operation.
| void CxxUtils::swap | ( | ConcurrentToValMap & | other | ) |
Swap this container with another.
| other | The container with which to swap. |
This will also call swap on the Updater object; hence, the Updater object must also support swap.
This operation is NOT thread-safe. No other threads may be accessing either container during this operation.
Return one template argument.
| i | Index of the argument to return. |
Definition at line 285 of file CxxUtils/Root/ClassName.cxx.
| bool CxxUtils::test | ( | bit_t | bit | ) | const |
Test to see if a bit is set.
| bit | Number of the bit to test. |
Returns false if bit is beyond the end of the set.
|
constexpr |
Convenience function to test bits in a class enum bitmask.
| lhs | Target bitmask. |
| rhs | Bits to test. |
Same as (lhs & rhs) != 0. This function is enabled only for enumerators that have used the ATH_BITMASK macro.
Definition at line 270 of file bitmask.h.
| void CxxUtils::throw_out_of_range | ( | const char * | what, |
| size_t | index, | ||
| size_t | size, | ||
| const void * | obj ) |
Throw an out_of_range exception.
| what | Description of the error. |
| index | The index that was out of range. |
| size | The size of the container. |
| obj | Pointer to the container (or other relevant object). |
Definition at line 43 of file throw_out_of_range.cxx.
| void CxxUtils::throw_out_of_range | ( | const std::string & | what, |
| size_t | index, | ||
| size_t | size, | ||
| const void * | obj ) |
Throw an out_of_range exception.
| what | Description of the error. |
| index | The index that was out of range. |
| size | The size of the container. |
| obj | Pointer to the container (or other relevant object). |
Definition at line 27 of file throw_out_of_range.cxx.
| CONT CxxUtils::to | ( | RANGE && | r | ) |
| std::vector< T > CxxUtils::tokenize | ( | std::string_view | str, |
| X | delimiters ) |
Definition at line 37 of file StringUtilsTemplates.h.
| std::vector< std::string > CxxUtils::tokenize | ( | std::string_view | the_str, |
| char | delimiter ) |
Definition at line 18 of file Control/CxxUtils/Root/StringUtils.cxx.
| std::vector< std::string > CxxUtils::tokenize | ( | std::string_view | the_str, |
| std::string_view | delimiters ) |
Splits the string into smaller substrings.
Definition at line 12 of file Control/CxxUtils/Root/StringUtils.cxx.
| std::vector< double > CxxUtils::tokenizeDouble | ( | std::string_view | the_str, |
| std::string_view | delimiter ) |
Definition at line 23 of file Control/CxxUtils/Root/StringUtils.cxx.
| std::vector< int > CxxUtils::tokenizeInt | ( | std::string_view | str, |
| std::string_view | delimiter ) |
Definition at line 36 of file Control/CxxUtils/Root/StringUtils.cxx.
| size_t CxxUtils::trim | ( | const std::vector< key_query_type > & | keys, |
| bool | trimall = false ) |
Remove unused entries from the front of the list.
| keys | List of keys that may still be in use. (Must be sorted.) |
| trimall | If true, then allow removing all elements in the container. Otherwise, stop when there's one left. |
We examine the objects in the container, starting with the earliest one. If none of the keys in keys match the range for this object, then it is removed from the container. We stop when we either find an object with a range matching a key in keys or (if trimall is false) when there is only one object left.
The list keys MUST be sorted.
Removed objects are queued for deletion once all slots have been marked as quiescent.
Returns the number of objects that were removed.
|
noexcept |
Removes all trailing and starting whitespaces from a string.
Definition at line 27 of file Control/CxxUtils/Root/StringUtils.cxx.
| void CxxUtils::ubsan_suppress | ( | void(* | func )() | ) |
Helper for suppressing ubsan warnings.
| func | Function to call (may be a lambda). |
If ubsan is running, temporarily redirect stderr to /dev/null. Then call func.
For example, we sometimes get a bogus ubsan warning from cling initialization. This can be suppressed by adding something like:
Definition at line 69 of file ubsan_suppress.cxx.
|
private |
| Updater_t & CxxUtils::updater | ( | ) |
Access the Updater instance.
| void CxxUtils::updateRanges | ( | std::function< void(RANGE &)> | rangeUpdater, |
| const typename Updater_t::Context_t & | ctx = Updater_t::defaultContext() ) |
Update all range objects.
| rangeUpdater | Functional to call on each range object. |
| ctx | Execution context. |
This will iterate through the list of entries and call rangeUpdater on the RANGE part of each. Be careful: rangeUpdater must not change any part of the range which might affect the sorting of entries.
| ATH_ALWAYS_INLINE bool CxxUtils::vall | ( | const VEC & | mask | ) |
Definition at line 402 of file vec.h.
| ATH_ALWAYS_INLINE bool CxxUtils::vany | ( | const VEC & | mask | ) |
| ATH_ALWAYS_INLINE void CxxUtils::vbroadcast | ( | VEC & | v, |
| T | x ) |
Copy a scalar to each element of a vectorized type.
Definition at line 251 of file vec.h.
| ATH_ALWAYS_INLINE void CxxUtils::vconvert | ( | VEC1 & | dst, |
| const VEC2 & | src ) |
performs dst is the result of a static cast of each element of src
Definition at line 428 of file vec.h.
|
constexpr |
Return the number of elements in a vectorized type.
|
constexpr |
Return the number of elements in a vectorized type.
| ATH_ALWAYS_INLINE void CxxUtils::vload | ( | VEC & | dst, |
| vec_type_t< VEC > const * | src ) |
| ATH_ALWAYS_INLINE void CxxUtils::vmax | ( | VEC & | dst, |
| const VEC & | a, | ||
| const VEC & | b ) |
| ATH_ALWAYS_INLINE void CxxUtils::vmin | ( | VEC & | dst, |
| const VEC & | a, | ||
| const VEC & | b ) |
| ATH_ALWAYS_INLINE bool CxxUtils::vnone | ( | const VEC & | mask | ) |
| ATH_ALWAYS_INLINE void CxxUtils::vpermute | ( | VEC1 & | dst, |
| const VEC & | src ) |
vpermute function.
move any element of a vector src into any or multiple position inside dst.
Definition at line 451 of file vec.h.
| ATH_ALWAYS_INLINE void CxxUtils::vpermute2 | ( | VEC1 & | dst, |
| const VEC & | src1, | ||
| const VEC & | src2 ) |
vpermute2 function.
move any element of the vectors src1, src2 into any or multiple position inside dst.
Definition at line 476 of file vec.h.
| ATH_ALWAYS_INLINE void CxxUtils::vselect | ( | VEC & | dst, |
| const VEC & | a, | ||
| const VEC & | b, | ||
| const vec_mask_type_t< VEC > & | mask ) |
| ATH_ALWAYS_INLINE void CxxUtils::vstore | ( | vec_type_t< VEC > * | dst, |
| const VEC & | src ) |
|
inline |
Wrap angle in radians to [-pi, pi].
Odd positive (negative) multiples of pi map to (-)pi.
Definition at line 24 of file phihelper.h.
| void * CxxUtils::xmalloc | ( | size_t | size | ) |
Trapping version of malloc.
| size | Number of bytes to allocate. |
Calls malloc. Throws a std::bad_alloc exception on failure.
If you're writing new code, you probably don't want to use this! Use make_unique/new or STL containers instead. This is intended for compatiblilty with existing code requiring malloc/free.
Definition at line 31 of file xmalloc.cxx.
| CxxUtils::ConcurrentBitset::~ConcurrentBitset | ( | ) |
Destructor.
Definition at line 99 of file ConcurrentBitset.cxx.
|
default |
Destructor.
| CxxUtils::~ConcurrentRangeMap | ( | ) |
Destructor.
Clean up any remaining payload objects.
| CxxUtils::~ConcurrentToValMap | ( | ) |
Destructor.
|
static |
Definition at line 45 of file base64.cxx.
|
inlineconstexpr |
|
static |
Definition at line 90 of file exctrace_collector.cxx.
|
private |
Pointers to the first and last elements of the container. m_last is not the usual end pointer; it points at the last element in the container. If the container is empty, then m_last will be null. If these are to both be updated together, it should be done in this order. First, m_begin should be set to null. This marks that there's an update in progress. Then m_last should be set, followed by m_begin. To read both pointers, we first fetch m_last. Then fetch m_begin. Then check that both m_begin is non-null and the previous value we fetched for last matches what's now in m_last. If either condition fails, then re-fetch both pointers.
Definition at line 654 of file ConcurrentRangeMap.h.
|
private |
Comparison object.
Definition at line 625 of file ConcurrentRangeMap.h.
|
private |
Is this expression const?
Definition at line 477 of file CxxUtils/CxxUtils/ClassName.h.
|
private |
Old implementation objects, pending deletion.
Definition at line 1059 of file ConcurrentBitset.h.
|
private |
The current implementation object.
Current version of the implementation class.
The underlying hash table.
Definition at line 1056 of file ConcurrentBitset.h.
|
private |
Definition at line 655 of file ConcurrentRangeMap.h.
|
private |
Definition at line 659 of file ConcurrentRangeMap.h.
|
private |
Mutex protecting the container.
Definition at line 1064 of file ConcurrentBitset.h.
|
private |
The primary name part of this expression.
Definition at line 486 of file CxxUtils/CxxUtils/ClassName.h.
|
private |
The containing namespace. This vector is always either 0 or 1 elements long; this is a way of getting something sort of like a pointer but with completely automatic management.
Definition at line 483 of file CxxUtils/CxxUtils/ClassName.h.
|
private |
Some basic statistics.
Definition at line 658 of file ConcurrentRangeMap.h.
|
private |
Payload deleter object. Important: do not discard an object while it's still reachable from the m_begin / m_last range — update the pointers first. Otherwise, the object may be deleted while another thread is still referencing it: thread 1: Discard object. Sets grace mask for both slots. thread 2: Call quiescent(). Clears grace mask for 2. Retrieve the discarded object. thread 1: Adjust pointers. Call quiescent. The discarded object may be deleted at this point while thread 2 is still reading it.
Definition at line 638 of file ConcurrentRangeMap.h.
|
private |
The template arguments for this name.
Definition at line 489 of file CxxUtils/CxxUtils/ClassName.h.
|
private |
Updater object. This maintains ownership of the current implementation class and the older versions.
Definition at line 622 of file ConcurrentRangeMap.h.
|
static |
Total number of total mantissa bits.
Definition at line 16 of file FloatCompressor.cxx.