SheafSystem  0.0.0.0
index_scope.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 index_scope
19 
20 #ifndef INDEX_SCOPE_H
21 #define INDEX_SCOPE_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef STD_CSTDDEF_H
28 #include "SheafSystem/std_cstddef.h"
29 #endif
30 
31 namespace sheaf
32 {
33 
34 class id_map;
35 class scoped_index;
36 
42 class SHEAF_DLL_SPEC index_scope
43 {
44 
45  // ===========================================================
46  // INDEX_SCOPE FACET
47  // ===========================================================
48 
49 public:
50 
54  index_scope(const immutable_id_map* xmap);
55 
60  ~index_scope();
61 
65  const immutable_id_map* scope() const;
66 
70  void put_scope(const immutable_id_map* xmap);
71 
75  const immutable_id_map* old_scope() const;
76 
77 protected:
78 
82  const immutable_id_map* _old_scope;
83 
84 
85 private:
86 
90  index_scope()
91  {}
92  ;
93 
98  index_scope(const index_scope& )
99  {}
100  ;
101 
106  index_scope& operator=(const index_scope&)
107  {}
108  ;
109 
113  static void* operator new(size_t)
114  {
115  return reinterpret_cast<void *>(1);
116  }
117  ; // return 0 causes compiler warning
118 
122  static void* operator new[] ( size_t );
123 
127  static void operator delete(void*)
128  {}
129  ;
130 
134  static void operator delete[](void *);
135 
136 };
137 
138 // ===========================================================
139 // NON-MEMBER FUNCTIONS
140 // ===========================================================
141 
142 } // namespace sheaf
143 
144 
145 #endif // ifndef INDEX_SCOPE_H
const immutable_id_map * _old_scope
The scope before this was created.
Definition: index_scope.h:82
Default id map for objects of type scoped_index. A convenient and safe mechanism for managing scoped_...
Definition: index_scope.h:42
Namespace for the sheaves component of the sheaf system.