mCRL2
Loading...
Searching...
No Matches
atermpp::detail::index_traits< Variable, KeyType, N > Struct Template Reference

For several variable types in mCRL2 an implicit mapping of these variables to integers is available. This is done for efficiency reasons. Examples are: More...

#include <index_traits.h>

Static Public Member Functions

static std::size_t index (const Variable &x)
 Returns the index of the variable.
 
static std::size_t max_index ()
 Returns an upper bound for the largest index of a variable that is currently in use.
 
static std::size_t insert (const KeyType &x)
 Note: intended for internal use only! Returns the index of the variable. If the variable was not already in the map, it is added.
 
static void erase (const KeyType &x)
 Note: intended for internal use only! Removes the variable from the index map.
 
static std::size_t size ()
 Note: intended for internal use only! Provides the size of the variable index map.
 

Detailed Description

template<typename Variable, typename KeyType, const int N>
struct atermpp::detail::index_traits< Variable, KeyType, N >

For several variable types in mCRL2 an implicit mapping of these variables to integers is available. This is done for efficiency reasons. Examples are:

data::variable, process::process_identifier

The class index_traits is used to implement this mapping. A traits class was chosen to prevent pollution of the public interface of the classes that represent these variables.

N is the position of the index in the aterm.

Definition at line 63 of file index_traits.h.

Member Function Documentation

◆ erase()

template<typename Variable , typename KeyType , const int N>
static void atermpp::detail::index_traits< Variable, KeyType, N >::erase ( const KeyType &  x)
inlinestatic

Note: intended for internal use only! Removes the variable from the index map.

Definition at line 118 of file index_traits.h.

◆ index()

template<typename Variable , typename KeyType , const int N>
static std::size_t atermpp::detail::index_traits< Variable, KeyType, N >::index ( const Variable &  x)
inlinestatic

Returns the index of the variable.

Definition at line 69 of file index_traits.h.

◆ insert()

template<typename Variable , typename KeyType , const int N>
static std::size_t atermpp::detail::index_traits< Variable, KeyType, N >::insert ( const KeyType &  x)
inlinestatic

Note: intended for internal use only! Returns the index of the variable. If the variable was not already in the map, it is added.

Definition at line 85 of file index_traits.h.

◆ max_index()

template<typename Variable , typename KeyType , const int N>
static std::size_t atermpp::detail::index_traits< Variable, KeyType, N >::max_index ( )
inlinestatic

Returns an upper bound for the largest index of a variable that is currently in use.

Definition at line 77 of file index_traits.h.

◆ size()

template<typename Variable , typename KeyType , const int N>
static std::size_t atermpp::detail::index_traits< Variable, KeyType, N >::size ( )
inlinestatic

Note: intended for internal use only! Provides the size of the variable index map.

Definition at line 135 of file index_traits.h.


The documentation for this struct was generated from the following file: