SheafSystem  0.0.0.0
tuple.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 TUPLE_H
22 #define TUPLE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ANY_LITE_H
29 #include "SheafSystem/any_lite.h"
30 #endif
31 
32 #ifndef ARRAY_POSET_DOF_MAP_H
33 #include "SheafSystem/array_poset_dof_map.h"
34 #endif
35 
36 #ifndef FIBER_BUNDLE_H
37 #include "SheafSystem/fiber_bundle.h"
38 #endif
39 
40 #ifndef TOTAL_POSET_MEMBER_H
41 #include "SheafSystem/total_poset_member.h"
42 #endif
43 
44 #ifndef TUPLE_TABLE_DOFS_TYPE_H
45 #include "SheafSystem/tuple_table_dofs_type.h"
46 #endif
47 
48 
49 // #ifndef POSET_H
50 // #include "SheafSystem/poset.h"
51 // #endif
52 
53 // #ifndef STD_VECTOR_H
54 // #include "SheafSystem/std_vector.h"
55 // #endif
56 
57 namespace sheaf
58 {
59  class namespace_poset;
60  class poset;
61  class schema_descriptor;
62  template <class T> class wsv_block;
63 }
64 
65 namespace fiber_bundle
66 {
67 
68 using namespace sheaf;
69 
70 class fiber_bundles_namespace;
71 class tuple_space;
72 
73 //==============================================================================
74 // CLASS TUPLE_LITE
75 //==============================================================================
76 
81 class SHEAF_DLL_SPEC tuple_lite : public any_lite
82 {
83  //============================================================================
85  //============================================================================
87 
88 public:
89 
94 
98  tuple_lite();
99 
103  tuple_lite(const tuple_lite& xother);
104 
108  tuple_lite& operator=(const tuple_lite& xother);
109 
113  virtual ~tuple_lite();
114 
118  virtual int factor_ct() const = 0;
119 
120 protected:
121 private:
122 
124 
125 
126  //============================================================================
128  //============================================================================
130 
131 public:
132 
136  virtual const std::string& class_name() const;
137 
141  static const std::string& static_class_name();
142 
146  virtual tuple_lite* clone() const;
147 
151  table_dofs_type table_dofs() const;
152 
153 protected:
154 private:
155 
157 
158 
159  //============================================================================
161  //============================================================================
163 
164 public:
165 
169  virtual bool is_ancestor_of(const any_lite& xother) const;
170 
174  bool invariant() const;
175 
176 protected:
177 private:
178 
180 };
181 
182 
183 //==============================================================================
184 // CLASS TUPLE
185 //==============================================================================
186 
191 class SHEAF_DLL_SPEC tuple : public total_poset_member
192 {
193 
194  // ===========================================================
196  // ===========================================================
198 
199 public:
200 
205 
210 
215 
220 
224  static const std::string& standard_schema_poset_name();
225 
229  static const poset_path& standard_schema_path();
230 
234  static void make_standard_schema(namespace_poset& xns);
235 
239  template <typename F>
240  SHEAF_DLL_SPEC
241  static poset_path standard_host_path(const std::string& xsuffix);
242 
247  template <typename F>
248  SHEAF_DLL_SPEC
249  static bool standard_host_is_available(namespace_type& xns, const std::string& xsuffix, bool xauto_access);
250 
256  static host_type& new_host(namespace_type& xns,
257  const poset_path& xhost_path,
258  const poset_path& xschema_path,
259  int xfactor_ct,
260  bool xauto_access);
261 
262 protected:
263 
264 private:
265 
267 
268  //============================================================================
270  //============================================================================
272 
273 public:
274 
275  // Typedefs:
279  tuple();
280 
281  // New handle/old state constructors.
282 
287  tuple(const poset_state_handle* xhost, pod_index_type xhub_id);
288 
293  tuple(const poset_state_handle* xhost, const scoped_index& xid);
294 
299  tuple(const poset_state_handle* xhost, const std::string& xname);
300 
304  explicit tuple(const abstract_poset_member* xother);
305 
309  tuple(poset_state_handle* xhost, bool xauto_access = true);
310 
314  virtual tuple& operator=(const abstract_poset_member& xother);
315 
319  tuple& operator=(const tuple& xother);
320 
324  virtual ~tuple();
325 
331  enum static_const_int {FACTOR_CT = 0};
332 
336  virtual int factor_ct() const;
337 
341  int factor_ct(bool xauto_access) const;
342 
346  virtual array_poset_dof_map& dof_map(bool xrequire_write_access = false);
347 
351  virtual const array_poset_dof_map& dof_map(bool xrequire_write_access = false) const;
352 
357  virtual bool dof_map_is_ancestor_of(const poset_dof_map* xdof_map) const;
358 
359 protected:
360 private:
361 
363 
364 
365  //============================================================================
367  //============================================================================
369 
370 public:
371 
375  virtual const std::string& class_name() const;
376 
380  static const std::string& static_class_name();
381 
387  inline tuple* clone(bool xnew_state, bool xauto_access = true) const
388  {
389  return static_cast<tuple*>(total_poset_member::clone(xnew_state,
390  xauto_access));
391  }
392 
393 protected:
394 private:
395 
397 
398  // ===========================================================
400  // ===========================================================
402 
403 public:
404 
408  host_type* host() const;
409 
413  virtual bool host_is_ancestor_of(const poset_state_handle* other) const;
414 
415 protected:
416 
417 private:
418 
420 
421  //============================================================================
423  //============================================================================
425 
426 public:
427 
431  bool is_ancestor_of(const any* other) const;
432 
436  virtual tuple* clone() const;
437 
441  virtual bool invariant() const;
442 
443 protected:
444 private:
445 
447 };
448 
449 } // namespace fiber_bundle
450 
451 #endif // ifndef TUPLE_H
virtual total_poset_member * clone() const
Make a new handle, no state instance of current.
Table dofs type for class tuple_table_dofs_type.
The default name space; a poset which contains other posets as members.
The standard fiber bundles name space; extends the standard sheaves namespace by defining base space...
A client handle for a general, abstract partially order set.
A path defined by a poset name and a member name separated by a forward slash (&#39;/&#39;). For example: "cell_definitions/triangle".
Definition: poset_path.h:48
tuple_table_dofs_type table_dofs_type
The type of the table dofs.
Definition: tuple.h:93
tuple * clone(bool xnew_state, bool xauto_access=true) const
Make a new handle instance of current. Attach the new instance to a new state if xnew_state is true...
Definition: tuple.h:387
tuple_lite volatile_type
The associated volatile type.
Definition: tuple.h:219
A Cartesian product space.
Definition: tuple_space.h:52
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
Abstract base class with useful features for all volatile objects.
Definition: any_lite.h:48
Abstract base class with useful features for all objects.
Definition: any.h:39
static_const_int
Number of factors (components) in tuple.
Definition: tuple.h:331
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
tuple_space host_type
The type of host poset.
Definition: tuple.h:209
A member of a Cartesian product space; a tuple of attributes (volatile version).
Definition: tuple.h:81
A member of a Cartesian product space; a tuple of attributes (persistent version).
Definition: tuple.h:191
fiber_bundles_namespace namespace_type
The type of namespace for this type of member.
Definition: tuple.h:204
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable version).
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Namespace for the sheaves component of the sheaf system.
void tuple(pod_index_type x, size_type xj_ub, pod_index_type &xi, pod_index_type &xj)
Ordinal to 2-tuple conversion.
An abstract client handle for a member of a poset.
tuple_table_dofs_type table_dofs_type
The type of the table dofs.
Definition: tuple.h:214
An array representation of abstract class poset_dof_map.
Namespace for the fiber_bundles component of the sheaf system.
Whitespace-separated-value block; A block of objects of type T that can be conveniently initialized b...
Definition: tuple.h:62
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...