client-cpp  0.10.0
FailoverCommon.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2014-2016 CyberVision, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef FAILOVERCOMMON_HPP_
19 #define FAILOVERCOMMON_HPP_
20 
21 #include <cstddef>
22 
23 namespace kaa {
24 
25 enum class KaaFailoverReason {
30 
35 
40 
45 
50 
55 
61 
66 };
67 
72  NOOP,
73 
78 
86 
91 
96 };
97 
99 public:
100  FailoverStrategyDecision(FailoverStrategyAction action, std::size_t retryPeriod = 0)
101  : action_(action), retryPeriod_(retryPeriod) {}
102 
104  return action_;
105  }
106 
107  std::size_t getRetryPeriod() const {
108  return retryPeriod_;
109  }
110 
111 private:
112  FailoverStrategyAction action_;
113  std::size_t retryPeriod_ = 0;
114 };
115 
116 }
117 
118 #endif /* FAILOVERCOMMON_HPP_ */
KaaFailoverReason
FailoverStrategyDecision(FailoverStrategyAction action, std::size_t retryPeriod=0)
FailoverStrategyAction getAction() const
std::size_t getRetryPeriod() const
FailoverStrategyAction