Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_ValidatorMaps.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Teuchos: Common Tools Package
4//
5// Copyright 2004 NTESS and the Teuchos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef Teuchos_VALIDATORMAPS_HPP
11#define Teuchos_VALIDATORMAPS_HPP
12
15
16
17#include "Teuchos_ParameterEntryValidator.hpp"
18
19
20namespace Teuchos {
21
22
24class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT IDtoValidatorMap {
25public:
26
30
34
36 typedef ValidatorMap::iterator iterator;
37
39 typedef ValidatorMap::const_iterator const_iterator;
40
42 void insert(IDValidatorPair toInsert);
43
49 const_iterator find(int id) const;
50
52 const_iterator begin() const;
53
55 const_iterator end() const;
56
58 inline
60 return validatorMap.erase(x);
61 }
62
63private:
64
65 ValidatorMap validatorMap;
66
67};
68
69
71class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ValidatortoIDMap {
72public:
73
75 typedef std::map<RCP<const ParameterEntryValidator>, int, RCPComp>
77
79 typedef std::pair<RCP<const ParameterEntryValidator>, int> ValidatorIDPair;
80
82 typedef ValidatorMap::iterator iterator;
83
85 typedef ValidatorMap::const_iterator const_iterator;
86
89
92
99 const RCP<const ParameterEntryValidator> validator) const;
100
102 const_iterator begin() const;
103
105 const_iterator end() const;
106
107private:
108
109 ValidatorMap validatorMap;
110
111 int counter;
112
113};
114
115
116} // namespace Teuchos
117
118
119#endif //Teuchos_VALIDATORMAPS_HPP
Maps Validators to integers.
const_iterator end() const
Returns a const_reference to the end of the map.
const_iterator begin() const
Returns a const_reference to the beginning of the map.
ValidatorMap::const_iterator const_iterator
size_t erase(const ParameterEntryValidator::ValidatorID &x)
removes the specified validator from the map.
std::pair< ParameterEntryValidator::ValidatorID, RCP< ParameterEntryValidator > > IDValidatorPair
std::map< ParameterEntryValidator::ValidatorID, RCP< ParameterEntryValidator > > ValidatorMap
ValidatorMap::iterator iterator
const_iterator find(int id) const
Retrieves and iterator to a validator and id based on the id given.
void insert(IDValidatorPair toInsert)
inserts an IDValidatorPair into the map.
Smart reference counting pointer class for automatic garbage collection.
std::pair< RCP< const ParameterEntryValidator >, int > ValidatorIDPair
const_iterator end() const
Returns a const_reference to the end of the map.
void insert(RCP< const ParameterEntryValidator > toInsert)
inserts an IDValidatorPair into the map.
std::map< RCP< const ParameterEntryValidator >, int, RCPComp > ValidatorMap
ValidatorMap::const_iterator const_iterator
const_iterator find(const RCP< const ParameterEntryValidator > validator) const
Returns an iterator to the validator and id specified by the validator.
ValidatorMap::iterator iterator
const_iterator begin() const
Returns a const_reference to the beginning of the map.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Struct for comparing two RCPs. Simply compares the raw pointers contained within the RCPs.