mCRL2
Loading...
Searching...
No Matches
find.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9/// \file mcrl2/data/detail/find.h
10/// \brief add your file description here.
11
12#ifndef MCRL2_DATA_DETAIL_FIND_H
13#define MCRL2_DATA_DETAIL_FIND_H
14
15#include "mcrl2/data/variable.h"
16
17namespace mcrl2::data::detail
18{
19
20/// \brief Returns the names of a set of data variables.
21/// \param variables A set of data variables
22inline
24{
25 std::set<core::identifier_string> result;
26 for (const data::variable& v: variables)
27 {
28 result.insert(v.name());
29 }
30 return result;
31}
32
33/// \brief Returns the names of a set of data variables as a set of strings.
34/// \param variables A set of data variables
35inline
37{
38 std::set<std::string> result;
39 for (const data::variable& v: variables)
40 {
41 result.insert(std::string(v.name()));
42 }
43 return result;
44}
45
46/// \brief Returns the names of a set of data variables.
47/// \param variables A set of data variables
48inline
50{
51 std::set<std::string> result;
52 for (const data::variable& v: variables1)
53 {
54 result.insert(std::string(v.name()));
55 }
56 for (const data::variable& v: variables2)
57 {
58 result.insert(std::string(v.name()));
59 }
60 return result;
61}
62
63} // namespace mcrl2::data::detail
64
65#endif // MCRL2_DATA_DETAIL_FIND_H
std::set< std::string > variable_name_strings(const std::set< data::variable > &variables)
Returns the names of a set of data variables as a set of strings.
Definition find.h:36
std::set< std::string > variable_name_strings(const std::set< data::variable > &variables1, const std::set< data::variable > &variables2)
Returns the names of a set of data variables.
Definition find.h:49
std::set< core::identifier_string > variable_names(const std::set< data::variable > &variables)
Returns the names of a set of data variables.
Definition find.h:23