Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Teuchos_ValidatorMaps.cpp
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 
11 
12 namespace Teuchos{
13 
14 
16 {
17  validatorMap.insert(toInsert);
18 }
19 
20 
22 {
23  return validatorMap.find(id);
24 }
25 
26 
28 {
29  return validatorMap.begin();
30 }
31 
32 
34 {
35  return validatorMap.end();
36 }
37 
38 
40 {}
41 
43 {
44  const_iterator result = validatorMap.find(toInsert);
45  if(result == validatorMap.end()){
46  validatorMap.insert(ValidatorIDPair(toInsert, counter));
47  ++counter;
48  }
49 }
50 
51 
53  const RCP<const ParameterEntryValidator> validator) const
54 {
55  return validatorMap.find(validator);
56 }
57 
58 
60 {
61  return validatorMap.begin();
62 }
63 
64 
66 {
67  return validatorMap.end();
68 }
69 
70 
71 } // namespace Teuchos
const_iterator find(int id) const
Retrieves and iterator to a validator and id based on the id given.
ValidatorMap::const_iterator const_iterator
ValidatorMap::const_iterator const_iterator
const_iterator end() const
Returns a const_reference to the end of the map.
std::pair< RCP< const ParameterEntryValidator >, int > ValidatorIDPair
void insert(RCP< const ParameterEntryValidator > toInsert)
inserts an IDValidatorPair into the map.
const_iterator end() const
Returns a const_reference to the end of the map.
const_iterator find(const RCP< const ParameterEntryValidator > validator) const
Returns an iterator to the validator and id specified by the validator.
std::pair< ParameterEntryValidator::ValidatorID, RCP< ParameterEntryValidator > > IDValidatorPair
const_iterator begin() const
Returns a const_reference to the beginning of the map.
Smart reference counting pointer class for automatic garbage collection.
const_iterator begin() const
Returns a const_reference to the beginning of the map.
void insert(IDValidatorPair toInsert)
inserts an IDValidatorPair into the map.