SheafSystem  0.0.0.0
field_refinement_policy.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 FIELD_REFINEMENT_POLICY_H
22 #define FIELD_REFINEMENT_POLICY_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ANY_H
29 #include "SheafSystem/any.h"
30 #endif
31 
32 #ifndef FIELDS_H
33 #include "SheafSystem/fields.h"
34 #endif
35 
36 namespace sheaf
37 {
38 template <class T>
39 class factory;
40 }
41 
42 namespace fields
43 {
44 
45 using namespace sheaf;
46 
47 class field_refinement_buffer;
48 
53 class SHEAF_DLL_SPEC field_refinement_policy : public any
54 {
55 
56  // ===========================================================
58  // ===========================================================
60 
61 public:
62 
66  virtual ~field_refinement_policy();
67 
71  virtual bool should_refine(field_refinement_buffer& xbuffer,
72  size_type xrefinement_depth) const = 0;
73 
79  size_type refinement_depth_ub() const;
80 
84  void put_refinement_depth_ub(size_type xub);
85 
89  virtual const std::string& class_name() const;
90 
94  static const std::string& static_class_name();
95 
99  static field_refinement_policy* new_policy(const std::string& xname);
100 
104  static factory<field_refinement_policy>& policy_factory();
105 
106 protected:
107 
112  field_refinement_policy(size_type xrefinement_depth_ub);
113 
119 
124 
126 
127 
128  // ===========================================================
130  // ===========================================================
132 
133 public:
134 
138  virtual bool is_ancestor_of(const any *other) const;
139 
144  virtual field_refinement_policy* clone() const = 0;
145 
150  virtual field_refinement_policy& operator=(const field_refinement_policy& xother);
151 
155  virtual bool invariant() const;
156 
158 
159 };
160 
161 // ===========================================================
162 // NON-MEMBER FUNCTIONS
163 // ===========================================================
164 
165 } // namespace fields
166 
167 #endif // ifndef FIELD_REFINEMENT_POLICY_H
size_type _refinement_depth_ub
The upper bound and the refinement level of a cell.
A buffer for data which is used by both a local_field_refiner object and its associated field_refinem...
Namespace for fields component of sheaf system.
Abstract base class with useful features for all objects.
Definition: any.h:39
A factory for instanting descendants of an abstract type T, given the class name of the descendant...
Definition: eval_family.h:49
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
An abstract policy that determines the conditions under which a zone should be refined.
Namespace for the sheaves component of the sheaf system.