mCRL2
|
Namespaces | |
namespace | detail |
namespace | tools |
The namespace for command line tool classes. | |
Classes | |
class | big_natural_number |
class | block_allocator |
The block allocator provides the allocator interface for the memory pool class. As such is can be used as an allocator for allocator aware storages. More... | |
class | cache_metric |
A helper class to keep track of the number of hits and misses for cache-like data structures. More... | |
class | execution_timer |
Simple timer to time the CPU time used by a piece of code. More... | |
class | fifo_policy |
class | file_format |
class | fixed_size_cache |
A cache keeps track of key-value pairs similar to a map. The difference is that a cache has (an optional) maximum size and a policy that determines what element gets evicted when the cache is full. More... | |
struct | forall |
Checks whether condition holds for all types passed as variadic template. More... | |
struct | forall< Cond, Conds... > |
class | function_cache |
A cache keeps track of key-value pairs similar to a map. The difference is that a cache has (an optional) maximum size and a policy that determines what element gets evicted when the cache is full. More... | |
struct | function_traits |
struct | function_traits< ReturnType(ClassType::*)(Args...) const > |
class | hashtable |
A set that assigns each element an unique index. More... | |
class | ibitstream |
The counterpart of obitstream, guarantees that the same data is read as has been written when calling the read operators in the same sequence as the corresponding write operators. More... | |
class | indexed_set |
A set that assigns each element an unique index. More... | |
struct | is_applicable |
struct | is_applicable2 |
struct | is_applicable2< FunctionType, ArgumentType1, ArgumentType2, typename std::result_of< FunctionType(ArgumentType1, ArgumentType2)>::type > |
struct | is_applicable< FunctionType, ArgumentType, typename std::result_of< FunctionType(ArgumentType)>::type > |
struct | is_constant_function_yielding |
struct | is_iterable |
A typetrait that is std::true_type iff std::begin() and std::end() can be called on type T. More... | |
struct | is_iterable< T, std::void_t< decltype(std::begin(std::declval< T >())), decltype(std::end(std::declval< T >())) > > |
struct | is_iterator |
A typetrait that is std::true_type iff the given type has the iterator traits. More... | |
struct | is_iterator< T, typename std::enable_if<!std::is_same< typename std::iterator_traits< T >::value_type, void >::value >::type > |
class | lock_guard |
An exclusive lock guard for the shared_mutex. More... | |
class | memory_pool |
The memory pool allocates elements of size T from blocks. More... | |
class | mutex |
This is simply an exclusive lock based on the standard library with the ability to perform no locks when thread safety is not desired. More... | |
class | no_policy |
A policy that replaces an arbitrary (but not random) element. More... | |
class | noncopyable |
Inherit from this class to prevent it from being copyable. More... | |
class | number_postfix_generator |
Identifier generator that generates names consisting of a prefix followed by a number. For each prefix an index is maintained, that is incremented after each call to operator()(prefix). More... | |
class | obitstream |
A bitstream provides per bit writing of data to any stream (including stdout). More... | |
class | probabilistic_arbitrary_precision_fraction |
This class contains labels for probabilistic transistions, consisting of a numerator and a denominator as a string of digits. More... | |
class | progress_meter |
Displays progress messages for a task that performs a fixed number of steps. More... | |
class | replacement_policy |
An interface to implement a replacement policy for the fixed_size_cache. More... | |
class | shared_guard |
A shared lock guard for the shared_mutex. More... | |
class | shared_mutex |
struct | shared_mutex_data |
class | shared_reference |
A reference counted reference to a shared_reference_counted object. More... | |
class | shared_reference_counted |
Stores a reference count that can be incremented and decremented. More... | |
struct | skip |
The skip operation with a variable number of arguments. More... | |
class | spinlock |
Implements a very simple spinlock. More... | |
class | stack_array |
Provides (a subset of) the interface of std::array<T> for a portion of preallocated memory. Can be used to interface with a portion of memory allocated on the stack,. More... | |
class | tagged_pointer |
A pointer storage object that uses a least significant bit as a mark. Can be used by objects that are 8 bytes aligned in memory. More... | |
class | unordered_map |
A class for a map of keys to values in T based using the simple hash table set implementation. More... | |
class | unordered_set |
A unordered_set with a subset of the interface of std::unordered_set that only stores a single pointer for each element. More... | |
Typedefs | |
template<typename Key , typename T > | |
using | fifo_cache = fixed_size_cache< fifo_policy< mcrl2::utilities::unordered_map< Key, T > > > |
template<typename F , typename Args > | |
using | fifo_function_cache = function_cache< fifo_policy< mcrl2::utilities::unordered_map< Args, decltype(std::declval< F >()(std::declval< Args >()))> >, F, Args > |
template<typename Key , typename T , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = mcrl2::utilities::block_allocator<Key>, bool ThreadSafe = false, bool Resize = true> | |
using | unordered_map_large = unordered_map< Key, T, Hash, Equals, Allocator, ThreadSafe, Resize > |
A specialization for large unordered maps that uses the block_allocator internally by default. | |
template<typename Key , typename Hash = std::hash<Key>, typename Equals = std::equal_to<Key>, typename Allocator = mcrl2::utilities::block_allocator<Key>, bool ThreadSafe = false> | |
using | unordered_set_large = unordered_set< Key, Hash, Equals, Allocator, ThreadSafe > |
A specialization for large unordered sets that uses the block_allocator internally by default. | |
Functions | |
std::string | get_executable_basename () |
Returns the basename of a tool. | |
std::string | pp (const big_natural_number &l) |
std::ostream & | operator<< (std::ostream &ss, const big_natural_number &l) |
void | swap (big_natural_number &x, big_natural_number &y) |
Standard overload of swap. | |
template<typename T > | |
constexpr std::size_t | integer_encoding_size () |
float | bytes_to_megabytes (std::size_t bytes) |
template<typename T > | |
void | print_performance_statistics (const T &unordered_set) |
Prints various information for unordered_set like data structures. | |
bool | has_extension (const std::string &filename, const std::string &extension) |
Returns true if the given filename has the extension ext. The extension does not start with a dot. | |
std::ostream & | operator<< (std::ostream &stream, const file_format &format) |
bool | file_exists (const std::string &filename) |
std::size_t | ceil_log2 (std::size_t n) |
std::size_t | power_size_t (const std::size_t n_in, const std::size_t m_in) |
std::size_t | parse_natural_number (const std::string &text) |
Parses a natural number from a string. | |
std::vector< std::size_t > | parse_natural_number_sequence (const std::string &text) |
Parses a sequence of natural numbers (separated by spaces) from a string. | |
template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr> | |
static constexpr bool | is_power_of_two (T value) |
template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr> | |
static T | round_up_to_power_of_two (T value) |
std::string | pp (const probabilistic_arbitrary_precision_fraction &l) |
std::ostream & | operator<< (std::ostream &out, const probabilistic_arbitrary_precision_fraction &x) |
template<typename Graph , typename Iter > | |
std::vector< std::size_t > | reachable_nodes (const Graph &g, Iter first, Iter last) |
Compute reachable nodes in a graph. | |
template<typename SequenceContainer , typename OutIter , typename SequenceFunction , typename Assign > | |
void | foreach_sequence (const SequenceContainer &X, OutIter i, SequenceFunction f, Assign assign) |
Algorithm for generating sequences. Given a sequence [X1, ..., Xn], where each element Xi is a sequence as well, this function generates all sequences [x1, ..., xn], where xi is an element of Xi for all i = 1 ... n. For each of these sequences the function f is called. The assign parameter gives the user control over how each sequence is built. | |
template<typename SequenceContainer , typename OutIter , typename SequenceFunction > | |
void | foreach_sequence (const SequenceContainer &X, OutIter i, SequenceFunction f) |
Algorithm for generating sequences. Given a sequence [X1, ..., Xn], where each element Xi is a sequence as well, this function generates all sequences [x1, ..., xn], where xi is an element of Xi for all i = 1 ... n. For each of these sequences the function f is called. | |
template<typename T > | |
T * | tag (const T *p) |
Applies a tag to a pointer. | |
template<typename T > | |
T * | tag (const detail::atomic_wrapper< T * > &p) |
template<typename T > | |
T * | pointer (const T *p) |
template<typename T > | |
T * | pointer (const detail::atomic_wrapper< T * > &p) |
template<typename T > | |
bool | tagged (const T *p) |
template<typename T > | |
bool | tagged (const detail::atomic_wrapper< T * > &p) |
char | rand_alnum () |
Generate a random alphanumeric character. | |
std::string | rand_alnum_str (const std::string::size_type n) |
Generate a random string of length n. | |
bool | file_exists (const char *filename) |
std::string | temporary_filename (std::string const &prefix="") |
Get filename with random suffix. | |
template<class CharContainer > | |
bool | contains_only_ascii_symbols (const CharContainer &input) |
Checks whether the input only contains proper ascii characters, including common control characters. | |
template<typename T > | |
std::string | to_string (const T &x) |
Transform parameter into string. | |
std::vector< std::string > | split_paragraphs (const std::string &text) |
Split a string into paragraphs. | |
std::vector< std::string > | split (const std::string &line, const std::string &separators) |
Split the text. | |
std::string | read_text (const std::string &filename, bool warn=false) |
Read text from a file. | |
std::string | read_text (std::istream &in) |
Read text from a stream. | |
std::string | remove_comments (const std::string &text) |
Remove comments from a text (everything from '' until end of line). | |
std::string | remove_whitespace (const std::string &text) |
Removes whitespace from a string. | |
std::string | regex_replace (const std::string &src, const std::string &dest, const std::string &text) |
Regular expression replacement in a string. | |
std::vector< std::string > | regex_split (const std::string &text, const std::string &sep) |
Split a string using a regular expression separator. | |
std::string | trim_copy (const std::string &text) |
Remove all trailing and leading spaces from the input. | |
void | trim (std::string &text) |
Remove all trailing and leading spaces from the input. | |
template<typename Container > | |
std::string | string_join (const Container &c, const std::string &separator) |
Joins a sequence of strings. This is a replacement for boost::algorithm::join, since it gives stack overflow errors with Visual C++ express 9.0 under some circumstances. | |
std::string | word_wrap_text (const std::string &text, unsigned int max_line_length=78) |
Apply word wrapping to a text. | |
bool | is_numeric_string (const std::string &s) |
Test if a string is a number. | |
void | number2string (std::size_t number, std::string &buffer, std::size_t start_position) |
Convert a number to a string in the buffer starting at position start_position. | |
std::string | number2string (std::size_t number) |
Convert a number to string. | |
std::string | get_toolset_version () |
Get the toolset revision. | |
template<class... T> | |
void | mcrl2_unused (T &&...) |
Function that can be used to silence unused parameter warnings. | |
template<typename Iter > | |
std::string | substring (const std::string &s, Iter first, Iter last) |
interface_description::mandatory_argument< std::string > | make_mandatory_argument (std::string const &name, std::string const &default_value) |
interface_description::mandatory_argument< std::string > | make_mandatory_argument (std::string const &name) |
interface_description::optional_argument< std::string > | make_optional_argument (std::string const &name, std::string const &default_value) |
static std::string | mark_name_in_usage (std::string const &usage, const std::string &begin, const std::string &end) |
static std::vector< std::string > | word_wrap_line (const std::string &line, unsigned int max_line_length) |
Apply word wrapping to a text that doesn't contain newlines. | |
Variables | |
static constexpr std::size_t | minimum_size = 4UL |
static constexpr bool | EnableReferenceCountMetrics = false |
Enable to count the number of reference count changes. | |
template<typename T > | |
constexpr bool | is_iterable_v = is_iterable<T>::value |
template<typename T > | |
constexpr bool | is_iterator_v = is_iterator<T>::value |
static constexpr bool | EnableLockfreeInsertion = true |
Enables lockfree implementation of emplace. | |
static constexpr long | BucketsPerMutex = 256 |
Number of buckets per mutex. | |
using mcrl2::utilities::fifo_cache = typedef fixed_size_cache<fifo_policy<mcrl2::utilities::unordered_map<Key, T> >> |
Definition at line 149 of file fixed_size_cache.h.
using mcrl2::utilities::fifo_function_cache = typedef function_cache< fifo_policy<mcrl2::utilities::unordered_map<Args, decltype(std::declval<F>()(std::declval<Args>()))> >, F, Args> |
Definition at line 152 of file fixed_size_cache.h.
using mcrl2::utilities::unordered_map_large = typedef unordered_map<Key, T, Hash, Equals, Allocator, ThreadSafe, Resize> |
A specialization for large unordered maps that uses the block_allocator internally by default.
Definition at line 258 of file unordered_map.h.
using mcrl2::utilities::unordered_set_large = typedef unordered_set<Key, Hash, Equals, Allocator, ThreadSafe> |
A specialization for large unordered sets that uses the block_allocator internally by default.
Definition at line 393 of file unordered_set.h.
|
inline |
Definition at line 27 of file unordered_set_implementation.h.
|
inline |
|
inline |
Checks whether the input only contains proper ascii characters, including common control characters.
input | The string to be checked. |
Definition at line 34 of file text_utility.h.
|
inline |
Definition at line 55 of file test_utilities.h.
|
inline |
Definition at line 98 of file file_utility.h.
void mcrl2::utilities::foreach_sequence | ( | const SequenceContainer & | X, |
OutIter | i, | ||
SequenceFunction | f | ||
) |
Algorithm for generating sequences. Given a sequence [X1, ..., Xn], where each element Xi is a sequence as well, this function generates all sequences [x1, ..., xn], where xi is an element of Xi for all i = 1 ... n. For each of these sequences the function f is called.
X | A sequence. |
i | An output iterator to where the generated sequences are written. |
f | A function that is called for each generated sequence. |
Definition at line 102 of file sequence.h.
void mcrl2::utilities::foreach_sequence | ( | const SequenceContainer & | X, |
OutIter | i, | ||
SequenceFunction | f, | ||
Assign | assign | ||
) |
Algorithm for generating sequences. Given a sequence [X1, ..., Xn], where each element Xi is a sequence as well, this function generates all sequences [x1, ..., xn], where xi is an element of Xi for all i = 1 ... n. For each of these sequences the function f is called. The assign parameter gives the user control over how each sequence is built.
X | A sequence. |
i | An output iterator to where the generated sequences are written. |
f | A function that is called for each generated sequence. |
assign | The assign operation is called to assign values to the generated sequence. |
Definition at line 81 of file sequence.h.
|
inline |
std::string mcrl2::utilities::get_toolset_version | ( | ) |
Get the toolset revision.
Definition at line 22 of file toolset_version.cpp.
|
inline |
Returns true if the given filename has the extension ext. The extension does not start with a dot.
Definition at line 27 of file file_utility.h.
|
constexpr |
Definition at line 24 of file bitstream.h.
bool mcrl2::utilities::is_numeric_string | ( | const std::string & | s | ) |
Test if a string is a number.
s | A string of text. |
Definition at line 210 of file text_utility.cpp.
|
staticconstexpr |
Definition at line 26 of file power_of_two.h.
interface_description::mandatory_argument< std::string > mcrl2::utilities::make_mandatory_argument | ( | std::string const & | name | ) |
Definition at line 328 of file command_line_interface.cpp.
interface_description::mandatory_argument< std::string > mcrl2::utilities::make_mandatory_argument | ( | std::string const & | name, |
std::string const & | default_value | ||
) |
Definition at line 321 of file command_line_interface.cpp.
interface_description::optional_argument< std::string > mcrl2::utilities::make_optional_argument | ( | std::string const & | name, |
std::string const & | default_value | ||
) |
Definition at line 335 of file command_line_interface.cpp.
|
inlinestatic |
Definition at line 479 of file command_line_interface.cpp.
void mcrl2::utilities::mcrl2_unused | ( | T && | ... | ) |
|
inline |
Convert a number to string.
This function is much faster than std::to_string and its use is therefore preferred in those cases were performance counts.
number | A number to be transformed. |
Definition at line 188 of file text_utility.h.
|
inline |
Convert a number to a string in the buffer starting at position start_position.
number | The number to be converted. |
buffer | A buffer in which the string will be stored that is sufficiently large. |
start_position | The first position where a number is written. |
Definition at line 158 of file text_utility.h.
|
inline |
Definition at line 311 of file probabilistic_arbitrary_precision_fraction.h.
|
inline |
Definition at line 793 of file big_numbers.h.
|
inline |
Definition at line 92 of file file_utility.h.
|
inline |
Parses a natural number from a string.
Definition at line 69 of file parse_numbers.h.
|
inline |
Parses a sequence of natural numbers (separated by spaces) from a string.
Definition at line 98 of file parse_numbers.h.
T * mcrl2::utilities::pointer | ( | const detail::atomic_wrapper< T * > & | p | ) |
Definition at line 44 of file tagged_pointer.h.
T * mcrl2::utilities::pointer | ( | const T * | p | ) |
Definition at line 38 of file tagged_pointer.h.
|
inline |
|
inline |
Definition at line 850 of file big_numbers.h.
|
inline |
Definition at line 303 of file probabilistic_arbitrary_precision_fraction.h.
void mcrl2::utilities::print_performance_statistics | ( | const T & | unordered_set | ) |
Prints various information for unordered_set like data structures.
Definition at line 238 of file unordered_set_implementation.h.
|
inline |
Generate a random alphanumeric character.
Definition at line 30 of file test_utilities.h.
|
inline |
Generate a random string of length n.
Definition at line 46 of file test_utilities.h.
std::vector< std::size_t > mcrl2::utilities::reachable_nodes | ( | const Graph & | g, |
Iter | first, | ||
Iter | last | ||
) |
Compute reachable nodes in a graph.
g | A graph. |
first | Iterator to the first node. |
last | Iterator to the last node. |
Definition at line 59 of file reachable_nodes.h.
std::string mcrl2::utilities::read_text | ( | const std::string & | filename, |
bool | warn = false |
||
) |
Read text from a file.
filename | A string |
warn | If true, a warning is printed to standard error if the file is not found |
Definition at line 66 of file text_utility.cpp.
|
inline |
Read text from a stream.
in | An input stream |
Definition at line 81 of file text_utility.h.
std::string mcrl2::utilities::regex_replace | ( | const std::string & | src, |
const std::string & | dest, | ||
const std::string & | text | ||
) |
Regular expression replacement in a string.
src | A string |
dest | A string |
text | A string |
Definition at line 120 of file text_utility.cpp.
std::vector< std::string > mcrl2::utilities::regex_split | ( | const std::string & | text, |
const std::string & | sep | ||
) |
Split a string using a regular expression separator.
text | A string |
sep | A string |
Definition at line 129 of file text_utility.cpp.
std::string mcrl2::utilities::remove_comments | ( | const std::string & | text | ) |
Remove comments from a text (everything from '' until end of line).
text | A string |
Definition at line 96 of file text_utility.cpp.
std::string mcrl2::utilities::remove_whitespace | ( | const std::string & | text | ) |
Removes whitespace from a string.
text | A string |
Definition at line 108 of file text_utility.cpp.
|
static |
Definition at line 35 of file power_of_two.h.
std::vector< std::string > mcrl2::utilities::split | ( | const std::string & | line, |
const std::string & | separators | ||
) |
Split the text.
line | A string |
separators | A string |
Definition at line 55 of file text_utility.cpp.
std::vector< std::string > mcrl2::utilities::split_paragraphs | ( | const std::string & | text | ) |
Split a string into paragraphs.
text | A string |
text
Definition at line 27 of file text_utility.cpp.
std::string mcrl2::utilities::string_join | ( | const Container & | c, |
const std::string & | separator | ||
) |
Joins a sequence of strings. This is a replacement for boost::algorithm::join, since it gives stack overflow errors with Visual C++ express 9.0 under some circumstances.
Definition at line 129 of file text_utility.h.
std::string mcrl2::utilities::substring | ( | const std::string & | s, |
Iter | first, | ||
Iter | last | ||
) |
Definition at line 22 of file command_line_interface.cpp.
|
inline |
Standard overload of swap.
Definition at line 820 of file big_numbers.h.
T * mcrl2::utilities::tag | ( | const detail::atomic_wrapper< T * > & | p | ) |
Definition at line 31 of file tagged_pointer.h.
T * mcrl2::utilities::tag | ( | const T * | p | ) |
Applies a tag to a pointer.
Definition at line 25 of file tagged_pointer.h.
bool mcrl2::utilities::tagged | ( | const detail::atomic_wrapper< T * > & | p | ) |
Definition at line 57 of file tagged_pointer.h.
bool mcrl2::utilities::tagged | ( | const T * | p | ) |
Definition at line 51 of file tagged_pointer.h.
|
inline |
Get filename with random suffix.
Definition at line 64 of file test_utilities.h.
|
inline |
Transform parameter into string.
x | Some expression |
Definition at line 53 of file text_utility.h.
void mcrl2::utilities::trim | ( | std::string & | text | ) |
Remove all trailing and leading spaces from the input.
text | A string |
Definition at line 223 of file text_utility.cpp.
std::string mcrl2::utilities::trim_copy | ( | const std::string & | text | ) |
Remove all trailing and leading spaces from the input.
text | A string |
Definition at line 218 of file text_utility.cpp.
|
static |
Apply word wrapping to a text that doesn't contain newlines.
line | A string of text. |
max_line_length | The maximum line length. |
Definition at line 155 of file text_utility.cpp.
std::string mcrl2::utilities::word_wrap_text | ( | const std::string & | text, |
unsigned int | max_line_length = 78 |
||
) |
Apply word wrapping to a text.
text | A string of text. |
max_line_length | The maximum line length. |
Definition at line 186 of file text_utility.cpp.
|
staticconstexpr |
Number of buckets per mutex.
Definition at line 27 of file unordered_set.h.
|
staticconstexpr |
Enables lockfree implementation of emplace.
Definition at line 24 of file unordered_set.h.
|
staticconstexpr |
Enable to count the number of reference count changes.
Definition at line 27 of file shared_reference.h.
|
constexpr |
Definition at line 50 of file type_traits.h.
|
constexpr |
Definition at line 53 of file type_traits.h.
|
staticconstexpr |
Definition at line 25 of file unordered_set_implementation.h.