SheafSystem  0.0.0.0
record.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 record
19 
20 #ifndef RECORD_H
21 #define RECORD_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 POSET_SCAFFOLD_H
32 #include "SheafSystem/poset_scaffold.h"
33 #endif
34 
35 #include "SheafSystem/record_index.h"
36 
37 namespace sheaf
38 {
39 
40 class data_type_map;
41 class poset_data_type_map;
42 
48 class SHEAF_DLL_SPEC record : public any
49 {
50 public:
51 
52  // CANONICAL MEMBERS
53 
58  record(const record& xother);
59 
65  virtual record* clone() const;
66 
70  virtual ~record();
71 
75  virtual bool invariant() const;
76 
80  virtual bool is_ancestor_of(const any* other) const;
81 
82  // RECORD INTERFACE
83 
87  record(const poset_scaffold& xscaffold);
88 
89 
90 
95  {
96  return _index;
97  };
98 
102  inline void put_external_index(const record_index& xindex)
103  {
104  _index = xindex;
105  };
106 
107 
108 
113  {
114  return _scaffold;
115  };
116 
120  inline const poset_scaffold& scaffold() const
121  {
122  return _scaffold;
123  };
124 
125 
126 
131  {
132  return scaffold().type_map();
133  };
134 
138  inline const poset_data_type_map& type_map() const
139  {
140  return scaffold().type_map();
141  };
142 
143 protected:
144 
145  // Default constructor.
146  // Default construction prohibited because scaffold must be initialized
147  // inline record() {} ;
148 
149 
150 private:
151 
152  // The external index of this record.
153 
154  record_index _index;
155 
156  // The scaffold for the poset associated with this record.
157 
158  poset_scaffold& _scaffold;
159 
160 };
161 
162 } // namespace sheaf
163 
164 #endif // ifndef RECORD_H
165 
166 
167 
168 
169 
170 
171 
void put_external_index(const record_index &xindex)
Sets the index of this record to xindex.
Definition: record.h:102
poset_scaffold & scaffold()
The scaffold for the poset associated with this record (mutable version).
Definition: record.h:112
const poset_data_type_map & type_map() const
The data type map used to convert data for this record (const version).
Definition: record.h:138
const poset_scaffold & scaffold() const
The scaffold for the poset associated with this record (const version).
Definition: record.h:120
poset_data_type_map & type_map()
The data type map used to convert data for this record (mutable version).
Definition: record.h:130
record_index external_index() const
The external index of this record.
Definition: record.h:94
Abstract base class with useful features for all objects.
Definition: any.h:39
A poset specific collection of data converters, various buffers and other data used while transferrin...
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
The general variable length record wrapper/adapter for transferring data between the kernel and the i...
Definition: record.h:48
Namespace for the sheaves component of the sheaf system.
A poset specific collection of data converters, various buffers and other data used while transferrin...