SheafSystem  0.0.0.0
any_lite.h
Go to the documentation of this file.
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 
20 
21 #ifndef ANY_LITE_H
22 #define ANY_LITE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef SHEAF_H
29 #include "SheafSystem/sheaf.h"
30 #endif
31 
32 #ifndef STD_STRING_H
33 #include "SheafSystem/std_string.h"
34 #endif
35 
36 namespace fiber_bundle
37 {
38 
39 using namespace sheaf;
40 
41 //==============================================================================
42 // CLASS ANY_LITE
43 //==============================================================================
44 
48 class SHEAF_DLL_SPEC any_lite
49 {
50 
51  //============================================================================
53  //============================================================================
55 
56 public:
57 
62 
66  virtual const std::string& class_name() const = 0;
67 
71  static const std::string& static_class_name();
72 
77  virtual any_lite* clone() const;
78 
82  virtual ~any_lite();
83 
87  virtual bool is_ancestor_of(const any_lite& xother) const;
88 
92  bool is_same_type(const any_lite& xother) const;
93 
94 protected:
95 
99  any_lite();
100 
101 
102 private:
103 
105 
106 
107  //============================================================================
109  //============================================================================
111 
112 public:
113 
117  bool invariant() const;
118 
122  inline bool invariant_check() const
123  {
124  return _disable_invariance_check_request_depth == 0;
125  };
126 
130  inline void enable_invariant_check() const
131  {
132  --_disable_invariance_check_request_depth;
133  };
134 
140  inline void disable_invariant_check() const
141  {
142  ++_disable_invariance_check_request_depth;
143  };
144 
150  {
151  return _disable_invariance_check_request_depth;
152  };
153 
154 protected:
155 
156 private:
157 
162  mutable int _disable_invariance_check_request_depth;
163 
165 
166 
167  //============================================================================
169  //============================================================================
171 
172 public:
173 
177  virtual void* row_dofs();
178 
182  virtual const void* row_dofs() const;
183 
184 protected:
185 
186 private:
187 
189 };
190 
191 
192 } // namespace fiber_bundle
193 
194 #endif // ifndef ANY_LITE_H
int disable_invariance_check_request_depth() const
Number of times disable_invariant_check has been called without matching call to enable_invariant_che...
Definition: any_lite.h:149
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
void disable_invariant_check() const
Disable invariant check. Intended for preventing recursive calls to invariant and for suppressing inv...
Definition: any_lite.h:140
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
void enable_invariant_check() const
Enable invariant checking.
Definition: any_lite.h:130
Namespace for the sheaves component of the sheaf system.
bool invariant_check() const
True if invariant checking is enabled.
Definition: any_lite.h:122
Namespace for the fiber_bundles component of the sheaf system.
any_lite volatile_type
The associated volatile type.
Definition: any_lite.h:61