SheafSystem  0.0.0.0
primitives_poset.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 PRIMITIVES_POSET_H
22 #define PRIMITIVES_POSET_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef POSET_H
29 #include "SheafSystem/poset.h"
30 #endif
31 
32 #ifndef POSET_MEMBER_H
33 #include "SheafSystem/total_poset_member.h"
34 #endif
35 
36 #ifndef POSET_STATE_HANDLE_H
37 #include "SheafSystem/poset_state_handle.h"
38 #endif
39 
40 #ifndef STD_IOSTREAM_H
41 #include "SheafSystem/std_iostream.h"
42 #endif
43 
44 namespace sheaf
45 {
46 
47 class namespace_poset;
48 
52 class SHEAF_DLL_SPEC primitives_poset : public poset_state_handle
53 {
54 
55  friend class namespace_poset;
56 
57  // ===========================================================
59  // ===========================================================
61 
62 public:
63 
67  static const std::string& standard_name();
68 
72  bool primitive_members_attached() const;
73 
78  {
79  return _bool_type;
80  };
81 
85  inline const abstract_poset_member& bool_type() const
86  {
87  return _bool_type;
88  };
89 
94  {
95  return _char_type;
96  };
97 
101  inline const abstract_poset_member& char_type() const
102  {
103  return _char_type;
104  };
105 
110  {
111  return _signed_char_type;
112  };
113 
118  {
119  return _signed_char_type;
120  };
121 
126  {
127  return _short_int_type;
128  };
129 
133  inline const abstract_poset_member& short_int_type() const
134  {
135  return _short_int_type;
136  };
137 
142  {
143  return _int_type;
144  };
145 
149  inline const abstract_poset_member& int_type() const
150  {
151  return _int_type;
152  };
153 
158  {
159  return _int_type;
160  };
161 
165  inline const abstract_poset_member& int_type_type() const
166  {
167  return _int_type;
168  };
169 
174  {
175  return _int_type;
176  };
177 
182  {
183  return _int_type;
184  };
185 
190  {
191  return _long_int_type;
192  };
193 
197  inline const abstract_poset_member& long_int_type() const
198  {
199  return _long_int_type;
200  };
201 
206  {
207  return _long_long_int_type;
208  };
209 
214  {
215  return _long_long_int_type;
216  };
217 
222  {
223  return _unsigned_char_type;
224  };
225 
230  {
231  return _unsigned_char_type;
232  };
233 
238  {
239  return _unsigned_short_int_type;
240  };
241 
246  {
247  return _unsigned_short_int_type;
248  };
249 
254  {
255  return _unsigned_int_type;
256  };
257 
262  {
263  return _unsigned_int_type;
264  };
265 
270  {
271  return _unsigned_long_int_type;
272  };
273 
278  {
279  return _unsigned_long_int_type;
280  };
281 
286  {
287  return _unsigned_long_long_int_type;
288  };
289 
294  {
295  return _unsigned_long_long_int_type;
296  };
297 
302  {
303  return _float_type;
304  };
305 
309  inline const abstract_poset_member& float_type() const
310  {
311  return _float_type;
312  };
313 
318  {
319  return _double_type;
320  };
321 
325  inline const abstract_poset_member& double_type() const
326  {
327  return _double_type;
328  };
329 
334  {
335  return _long_double_type;
336  };
337 
342  {
343  return _long_double_type;
344  };
345 
350  {
351  return _void_star_type;
352  };
353 
357  inline const abstract_poset_member& void_star_type() const
358  {
359  return _void_star_type;
360  };
361 
366  {
367  return _c_string_type;
368  };
369 
373  inline const abstract_poset_member& c_string_type() const
374  {
375  return _c_string_type;
376  };
377 
382  {
383  return _namespace_relative_member_index_type;
384  };
385 
390  {
391  return _namespace_relative_member_index_type;
392  };
393 
398  {
399  return _namespace_relative_subposet_index_type;
400  };
401 
406  {
407  return _namespace_relative_subposet_index_type;
408  };
409 
410 protected:
411 
412 private:
413 
417  total_poset_member _bool_type;
418 
422  total_poset_member _char_type;
423 
427  total_poset_member _signed_char_type;
428 
432  total_poset_member _short_int_type;
433 
437  total_poset_member _int_type;
438 
442  total_poset_member _long_int_type;
443 
447  total_poset_member _long_long_int_type;
448 
452  total_poset_member _unsigned_char_type;
453 
457  total_poset_member _unsigned_short_int_type;
458 
462  total_poset_member _unsigned_int_type;
463 
467  total_poset_member _unsigned_long_int_type;
468 
472  total_poset_member _unsigned_long_long_int_type;
473 
477  total_poset_member _float_type;
478 
482  total_poset_member _double_type;
483 
487  total_poset_member _long_double_type;
488 
492  total_poset_member _void_star_type;
493 
497  total_poset_member _c_string_type;
498 
502  total_poset_member _namespace_relative_member_index_type;
503 
507  total_poset_member _namespace_relative_subposet_index_type;
508 
513 
517  ~primitives_poset();
518 
522  void initialize_primitive_member(total_poset_member& xmbr, primitive_type xtype);
523 
527  subposet* _table_dof_subposet;
528 
532  subposet* _row_dof_subposet;
533 
537  static bool make_prototype();
538 
540 
541 
542  // ===========================================================
544  // ===========================================================
546 
547 public:
548 
552  virtual poset_type type_id() const;
553 
557  virtual const char* class_name() const;
558 
563  virtual bool row_dof_map_conforms(const poset_dof_map* xdof_map) const;
564 
565 protected:
566 
567 private:
568 
570 
574  virtual void attach_to_state(const namespace_poset* xhost, pod_index_type xindex);
575 
579  virtual void detach_from_state();
580 
582 
587  void new_state(const abstract_poset_member* xschema);
588 
592  virtual void initialize_standard_members();
593 
597  virtual void initialize_standard_subposets(const std::string& xname);
598 
600 
601 
602  // ===========================================================
604  // ===========================================================
606 
607 public:
608 
612  virtual bool is_ancestor_of(const any* other) const;
613 
617  bool invariant() const;
618 
619 protected:
620 
621 private:
622 
626  virtual primitives_poset* clone() const;
627 
629 };
630 
631 } // namespace sheaf
632 
633 #endif // ifndef PRIMITIVES_POSET_H
A client handle for a subposet.
Definition: subposet.h:86
abstract_poset_member & char_type()
Poset member representing primitive type char (mutable version)
abstract_poset_member & int_type_type()
Poset member representing primitive type int_type; alias for int (mutable version) ...
const abstract_poset_member & void_star_type() const
Poset member representing primitive type void_star (const version)
The default name space; a poset which contains other posets as members.
abstract_poset_member & namespace_relative_member_index_type()
Poset member representing primitive type namespace_relative_member_index (mutable version) ...
poset_type
Identifiers for poset types.
Definition: poset_type.h:41
abstract_poset_member & namespace_relative_subposet_index_type()
Poset member representing primitive type namespace_relative_member_index (mutable version) ...
abstract_poset_member & bool_type()
Poset member representing primitive type bool (mutable version)
A client handle for a general, abstract partially order set.
abstract_poset_member & int_type()
Poset member representing primitive type int (mutable version)
const abstract_poset_member & namespace_relative_member_index_type() const
Poset member representing primitive type namespace_relative_member_index (const version) ...
const abstract_poset_member & unsigned_int_type() const
Poset member representing primitive type unsigned int (const version)
abstract_poset_member & unsigned_char_type()
Poset member representing primitive type unsigned char (mutable version)
const abstract_poset_member & int_type() const
Poset member representing primitive type int (const version)
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
abstract_poset_member & float_type()
Poset member representing primitive type float (mutable version)
abstract_poset_member & pod_index_type_type()
Poset member representing primitive type pod_index_type; alias for int (mutable version) ...
const abstract_poset_member & unsigned_short_int_type() const
Poset member representing primitive type unsigned short int (const version)
const abstract_poset_member & unsigned_long_int_type() const
Poset member representing primitive type unsigned long int (const version)
The poset containing the primitive type definitions.
Abstract base class with useful features for all objects.
Definition: any.h:39
abstract_poset_member & unsigned_short_int_type()
Poset member representing primitive type unsigned short int (mutable version)
abstract_poset_member & void_star_type()
Poset member representing primitive type void_star (mutable version)
primitive_type
Type ids for sheaf primitives.
const abstract_poset_member & long_int_type() const
Poset member representing primitive type long int (const version)
abstract_poset_member & unsigned_int_type()
Poset member representing primitive type unsigned int (mutable version)
const abstract_poset_member & signed_char_type() const
Poset member representing primitive type signed char (const version)
const abstract_poset_member & c_string_type() const
Poset member representing primitive type c_string (const version)
const abstract_poset_member & namespace_relative_subposet_index_type() const
Poset member representing primitive type namespace_relative_member_index (const version) ...
const abstract_poset_member & float_type() const
Poset member representing primitive type float (const version)
abstract_poset_member & signed_char_type()
Poset member representing primitive type signed char (mutable version)
abstract_poset_member & long_long_int_type()
Poset member representing primitive type long long int (mutable version)
void attach_to_state(const poset_state_handle *xother)
Attach this handle to the same state as xother.
abstract_poset_member & double_type()
Poset member representing primitive type double (mutable version)
const abstract_poset_member & int_type_type() const
Poset member representing primitive type int_type; alias for int (const version)
abstract_poset_member & c_string_type()
Poset member representing primitive type c_string (mutable version)
abstract_poset_member & long_int_type()
Poset member representing primitive type long int (mutable version)
abstract_poset_member & unsigned_long_long_int_type()
Poset member representing primitive type unsigned long long int (mutable version) ...
const abstract_poset_member & double_type() const
Poset member representing primitive type double (const version)
const abstract_poset_member & pod_index_type_type() const
Poset member representing primitive type pod_index_type; alias for int (const version) ...
const abstract_poset_member & char_type() const
Poset member representing primitive type char (const version)
const abstract_poset_member & unsigned_long_long_int_type() const
Poset member representing primitive type unsigned long long int (const version)
abstract_poset_member & short_int_type()
Poset member representing primitive type short int (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.
const abstract_poset_member & long_long_int_type() const
Poset member representing primitive type long long int (const version)
An abstract client handle for a member of a poset.
abstract_poset_member & long_double_type()
Poset member representing primitive type long double (mutable version)
void new_state(namespace_poset &xns, const poset_path &xpath, const schema_poset_member &xschema, array_poset_dof_map &xdof_map)
Creates a new poset state with schema xschema and table dof map xdof_map, attaches this to the state ...
const abstract_poset_member & unsigned_char_type() const
Poset member representing primitive type unsigned char (const version)
const abstract_poset_member & long_double_type() const
Poset member representing primitive type long double (const version)
const abstract_poset_member & short_int_type() const
Poset member representing primitive type short int (const version)
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...
abstract_poset_member & unsigned_long_int_type()
Poset member representing primitive type unsigned long int (mutable version)
const abstract_poset_member & bool_type() const
Poset member representing primitive type bool (const version)