PetaVision  Alpha
Response.cpp
1 /*
2  * Response.cpp
3  *
4  * Created on Jan 22, 2018
5  *
6  * The possible return values of the notify and response functions
7  * in the observer pattern.
8  */
9 
10 #include "Response.hpp"
11 #include "include/pv_common.h"
12 #include "utils/PVAssert.hpp"
13 #include "utils/PVLog.hpp"
14 
15 namespace PV {
16 
17 namespace Response {
18 
19 Status operator+(Status const &a, Status const &b) {
20  if (a == NO_ACTION) {
21  return b;
22  }
23  else if (b == NO_ACTION) {
24  return a;
25  }
26  else if (a == SUCCESS and b == SUCCESS) {
27  return SUCCESS;
28  }
29  else if (a == POSTPONE and b == POSTPONE) {
30  return POSTPONE;
31  }
32  else {
33  return PARTIAL;
34  }
35 }
36 
37 } // namespace Response
38 
39 } // namespace PV
Status operator+(Status const &a, Status const &b)
Definition: Response.cpp:19