SheafSystem  0.0.0.0
schema_descriptor.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 schema_descriptor
19 
20 #ifndef SCHEMA_DESCRIPTOR_H
21 #define SCHEMA_DESCRIPTOR_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef ANY_H
28 #include "SheafSystem/any.h"
29 #endif
30 
31 #ifndef PRIMITIVE_TYPE_H
32 #include "SheafSystem/primitive_type.h"
33 #endif
34 
35 #ifndef STD_IOSTREAM_H
36 #include "SheafSystem/std_iostream.h"
37 #endif
38 
39 namespace sheaf
40 {
41 
45 class SHEAF_DLL_SPEC schema_descriptor : public any
46 {
47 
48 public:
49 
50  // ===========================================================
51  // ANY FACET
52  // ===========================================================
53 
57  virtual bool is_ancestor_of(const any* other) const;
58 
63  virtual schema_descriptor* clone() const;
64 
65  // Assignment operator provided by compiler.
66 
70  bool operator==(const schema_descriptor& xother) const;
71 
75  virtual bool invariant() const;
76 
77  // ===========================================================
78  // SCHEMA_DESCRIPTOR FACET
79  // ===========================================================
80 
86 
91  schema_descriptor(const schema_descriptor& xother);
92 
97  schema_descriptor(const std::string& xname,
98  primitive_type xtype = NOT_A_PRIMITIVE_TYPE,
99  bool xis_table_dof = true);
100 
104  virtual ~schema_descriptor();
105 
109  std::string name;
110 
115 
121 
122 };
123 
124 // ===========================================================
125 // NON-MEMBER FUNCTIONS
126 // ===========================================================
127 
128 
132 SHEAF_DLL_SPEC
133 std::ostream & operator << (std::ostream& os, const schema_descriptor& xsd);
134 
135 
139 SHEAF_DLL_SPEC
140 std::istream & operator >> (std::istream& is, schema_descriptor& xsd);
141 
146 size_t
147 SHEAF_DLL_SPEC
148 deep_size(const schema_descriptor& xsd, bool xinclude_shallow = true);
149 
150 
151 } // namespace sheaf
152 
153 #endif // ifndef SCHEMA_DESCRIPTOR_H
Abstract base class with useful features for all objects.
Definition: any.h:39
primitive_type
Type ids for sheaf primitives.
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
A description of a dof in a schema.
bool operator==(const singly_linked_list< T, Alloc > &lhs, const singly_linked_list< T, Alloc > &rhs)
Checks if the contents of lhs and rhs are equal, that is, whether lhs.size() == rhs.size() and each element in lhs compares equal with the element in rhs at the same position.
std::string name
The name of the dof described by this.
SHEAF_DLL_SPEC std::istream & operator>>(std::istream &is, dof_tuple_type &xdt)
Extract dof_tuple_type xdt from istream& is.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
Namespace for the sheaves component of the sheaf system.
bool is_table_dof
The role of the dof described by this; true if this describes a table dof.
primitive_type type
The type of the dof described by this.