EMANE  1.2.1
configurationinfo.inl
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 - Adjacent Link LLC, Bridgewater, New Jersey
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in
13  * the documentation and/or other materials provided with the
14  * distribution.
15  * * Neither the name of Adjacent Link LLC nor the names of its
16  * contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #include <algorithm>
34 
35 inline
37  Any::Type type,
38  const ConfigurationProperties & properties,
39  const std::vector<Any> & values,
40  const std::string & sUsage,
41  const Any & minValue,
42  const Any & maxValue,
43  std::size_t minOccurs,
44  std::size_t maxOccurs,
45  const std::string & sRegexPattern):
46 sName_{sName},
47  properties_{properties},
48  sUsage_{sUsage},
49  minOccurs_{minOccurs},
50  maxOccurs_{maxOccurs},
51  values_{values},
52  minValue_{minValue},
53  maxValue_{maxValue},
54  bIsNumberic_{true},
55  type_{type},
56  sRegexPattern_{sRegexPattern}
57 {}
58 
59 inline
61  Any::Type type,
62  const ConfigurationProperties & properties,
63  const std::vector<Any> & values,
64  const std::string & sUsage,
65  std::size_t minOccurs,
66  std::size_t maxOccurs,
67  const std::string & sRegexPattern):
68 sName_{sName},
69  properties_{properties},
70  sUsage_{sUsage},
71  minOccurs_{minOccurs},
72  maxOccurs_{maxOccurs},
73  values_{values},
74  minValue_{0},
75  maxValue_{0},
76  bIsNumberic_{false},
77  type_{type},
78  sRegexPattern_{sRegexPattern}
79 {}
80 
81 inline
82 const std::string & EMANE::ConfigurationInfo::getName() const
83 {
84  return sName_;
85 }
86 
87 inline
89 {
90  return type_;
91 }
92 
93 inline
95 {
96  return static_cast<bool>(properties_ & ConfigurationProperties::DEFAULT);
97 }
98 
99 inline
101 {
102  return static_cast<bool>(properties_ & ConfigurationProperties::REQUIRED);
103 }
104 
105 inline
107 {
108  return static_cast<bool>(properties_ & ConfigurationProperties::MODIFIABLE);
109 }
110 
111 inline
113 {
114  return minOccurs_;
115 }
116 
117 inline
119 {
120  return maxOccurs_;
121 }
122 
123 inline
124 const std::vector<EMANE::Any> & EMANE::ConfigurationInfo::getValues() const
125 {
126  return values_;
127 }
128 
129 inline
131 {
132  return minValue_;
133 }
134 
135 inline
137 {
138  return maxValue_;
139 }
140 
141 inline
142 const std::string & EMANE::ConfigurationInfo::getUsage() const
143 {
144  return sUsage_;
145 }
146 
147 inline
148 const std::string & EMANE::ConfigurationInfo::getRegexPattern() const
149 {
150  return sRegexPattern_;
151 }
152 
153 inline
155 {
156  return bIsNumberic_;
157 }
158 
159 inline
160 void EMANE::ConfigurationInfo::setValues(const std::vector<Any> & values)
161 {
162  values_ = values;
163 }
164 
const Any & getMinValue() const
Type
Definition: any.h:52
const std::string & getRegexPattern() const
const std::string & getName() const
void setValues(const std::vector< Any > &values)
const std::string & getUsage() const
const std::vector< Any > & getValues() const
const Any & getMaxValue() const
ConfigurationInfo(const std::string &sName, Any::Type type, const ConfigurationProperties &properties, const std::vector< Any > &values, const std::string &sUsage, const Any &minValue, const Any &maxValue, std::size_t minOccurs, std::size_t maxOccurs, const std::string &sRegexPattern)
std::size_t getMinOccurs() const
The Any class can contain an instance of one of any type in its support type set. ...
Definition: any.h:49
std::size_t getMaxOccurs() const