SheafSystem  0.0.0.0
sec_tuple_space.impl.h
Go to the documentation of this file.
1 // $RCSfile: class.h,v $ $Revision: 1.2 $ $Date: 2010/06/25 20:44:19 $
2 
3 // $Name: $
4 //
5 // Copyright (c) 2008 Limit Point Systems, Inc.
6 //
7 
10 
11 #ifndef SEC_TUPLE_SPACE_IMPL_H
12 #define SEC_TUPLE_SPACE_IMPL_H
13 
14 #ifndef SEC_TUPLE_SPACE_H
15 #include "SheafSystem/sec_tuple_space.h"
16 #endif
17 
18 #ifndef NAMESPACE_POSET_H
19 #include "SheafSystem/namespace_poset.h"
20 #endif
21 
22 #ifndef SECTION_SPACE_SCHEMA_POSET_H
23 #include "SheafSystem/section_space_schema_poset.h"
24 #endif
25 
26 using namespace fiber_bundle; // Workaround for MS C++ bug.
27 
28 template <typename F>
29 bool
31 fiber_space_conforms(const namespace_poset& xns, const poset_path& xsection_schema_path, bool xauto_access)
32 {
33  // cout << endl << "Entering sec_tuple_space::fiber_schema_conforms." << endl;
34 
35  // Preconditions:
36 
37  require(xns.state_is_auto_read_accessible(xauto_access));
38 
39  require(!xsection_schema_path.empty());
40  require(xns.path_is_auto_read_accessible<section_space_schema_poset>(xsection_schema_path, xauto_access));
41 
42  // Body:
43 
44  // Get the schema poset.
45 
46  section_space_schema_poset& lschema_host = xns.member_poset<section_space_schema_poset>(xsection_schema_path, xauto_access);
47 
48  // Fiber space conforms if it is can be downcast to type F. This also ensures the schema conforms
49  // to F::standard_schema_path, since that is a precondition of the fiber space factory methods.
50 
51  bool result = (dynamic_cast<F*>(&lschema_host.fiber_space()) != 0);
52 
53  // Postconditions:
54 
55 
56  // Exit:
57 
58  // cout << "Leaving sec_tuple_space::fiber_schema_conforms." << endl;
59  return result;
60 }
61 
62 
63 #endif // ifndef SEC_TUPLE_SPACE_IMPL_H
static bool fiber_space_conforms(const namespace_poset &xns, const poset_path &xsection_schema_path, bool xauto_access)
True if and only if the fiber space of the section schema specified by xsection_schema_path conforms ...
The default name space; a poset which contains other posets as members.
bool path_is_auto_read_accessible(const poset_path &xpath, bool xauto_access) const
True if the state referred to xpath exists and is auto read accessible.
bool state_is_auto_read_accessible(bool xauto_access) const
True if the state is auto accessible for read, that is, if the state is already accessible for read o...
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
poset_state_handle & member_poset(pod_index_type xhub_id, bool xauto_access=true) const
The poset_state_handle object referred to by hub id xhub_id.
poset & fiber_space()
The fiber space for section spaces on this schema.
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
An abstract schema poset for a section space. A Cartesian product subspace of the tensor product of a...
Namespace for the fiber_bundles component of the sheaf system.