SheafSystem  0.0.0.0
tern.h
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
18 // Interface for class tern
19 
20 #ifndef TERN_H
21 #define TERN_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifdef TRUE
28 #undef TRUE
29 #endif
30 
31 #ifdef FALSE
32 #undef FALSE
33 #endif
34 
35 namespace sheaf
36 {
37 
45 class SHEAF_DLL_SPEC tern
46 {
47 
48 public:
49 
50  // =============================================================================
51  // TERN FACET
52  // =============================================================================
53 
57  tern();
58 
62  tern(const tern& xother);
63 
64  // ///
66  // ///
67  // tern(const bool& xother);
68 
72  ~tern();
73 
77  tern& operator=(const tern& xother);
78 
79  // ///
81  // ///
82  // tern& operator=(const bool& xother);
83 
87  operator bool() const;
88 
92  bool is_true() const;
93 
97  bool is_false() const;
98 
102  bool is_neither() const;
103 
108  {
109  TRUE, FALSE, NEITHER
110  };
111 
115  tern(state_type xstate);
116 
117 private:
118 
122  state_type _state;
123 
124 
125 
126 };
127 
128 // =============================================================================
129 // NON-MEMBER FUNCTIONS
130 // =============================================================================
131 
132 } // namespace sheaf
133 
134 #endif // ifndef TERN_H
A three state "bool". Does not provide the operations of ternary logic and is intended for use mostly...
Definition: tern.h:45
state_type
The three possible values.
Definition: tern.h:107
Namespace for the sheaves component of the sheaf system.