File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change 23
23
24
24
namespace ndn ::nfd {
25
25
26
- ControlParametersCommandFormat::ControlParametersCommandFormat ()
27
- : m_required(CONTROL_PARAMETER_UBOUND)
28
- , m_optional(CONTROL_PARAMETER_UBOUND)
29
- {
30
- }
31
-
32
26
void
33
27
ControlParametersCommandFormat::validate (const ControlParameters& parameters) const
34
28
{
Original file line number Diff line number Diff line change 25
25
#include " ndn-cxx/interest.hpp"
26
26
#include " ndn-cxx/mgmt/nfd/control-parameters.hpp"
27
27
28
+ #include < bitset>
29
+
28
30
namespace ndn ::nfd {
29
31
30
32
/* *
@@ -47,15 +49,13 @@ class ControlParametersCommandFormat
47
49
public:
48
50
using ParametersType = ControlParameters;
49
51
50
- ControlParametersCommandFormat ();
51
-
52
52
/* *
53
53
* \brief Declare a required field.
54
54
*/
55
55
ControlParametersCommandFormat&
56
56
required (ControlParameterField field)
57
57
{
58
- m_required[ field] = true ;
58
+ m_required. set ( field) ;
59
59
return *this ;
60
60
}
61
61
@@ -65,7 +65,7 @@ class ControlParametersCommandFormat
65
65
ControlParametersCommandFormat&
66
66
optional (ControlParameterField field)
67
67
{
68
- m_optional[ field] = true ;
68
+ m_optional. set ( field) ;
69
69
return *this ;
70
70
}
71
71
@@ -85,8 +85,8 @@ class ControlParametersCommandFormat
85
85
encode (Interest& interest, const ControlParameters& params) const ;
86
86
87
87
private:
88
- std::vector< bool > m_required;
89
- std::vector< bool > m_optional;
88
+ std::bitset<CONTROL_PARAMETER_UBOUND > m_required;
89
+ std::bitset<CONTROL_PARAMETER_UBOUND > m_optional;
90
90
};
91
91
92
92
You can’t perform that action at this time.
0 commit comments