SheafSystem  0.0.0.0
fiber_bundle.cc
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 #include "SheafSystem/fiber_bundle.h"
19 
20 #include "SheafSystem/assert_contract.h"
21 #include "SheafSystem/block.impl.h"
22 #include "SheafSystem/error_message.h"
23 #include "SheafSystem/poset_path.h"
24 
25 using namespace fiber_bundle; // Workaround for MS C++ bug.
26 
31  const poset_path& xbase_path)
32 {
33  poset_path result;
34 
35  // Preconditions:
36 
37 
38  // Body:
39 
40  result.put_poset_name(xfiber_path.poset_name() + "_on_" + xbase_path.poset_name());
41 
42  // Postconditions:
43 
44  ensure(!result.empty());
45  ensure(!result.full());
46 
47  // Exit:
48 
49  return result;
50 }
51 
56 {
57  poset_path result;
58 
59  // Preconditions:
60 
61 
62  // Body:
63 
64  result.put_member_name(xsection_space_path.poset_name() + "_schema");
65  result.put_poset_name(result.member_name() + "_host");
66 
67  // Postconditions:
68 
69  ensure(!result.empty());
70  ensure( result.full());
71 
72  // Exit:
73 
74  return result;
75 }
76 
77 
bool full() const
True if both poset name and member name are not empty.
Definition: poset_path.cc:311
A path defined by a poset name and a member name separated by a forward slash ('/'). For example: "cell_definitions/triangle".
Definition: poset_path.h:48
poset_path SHEAF_DLL_SPEC standard_section_space_path(const poset_path &xfiber_path, const poset_path &xbase_path)
The standard path for the section space with fiber space path xfiber_path and base space path xbase_p...
Definition: fiber_bundle.cc:30
poset_path SHEAF_DLL_SPEC standard_section_space_schema_path(const poset_path &xsection_space_path)
The standard path for the section space schema.
Definition: fiber_bundle.cc:55
void put_member_name(const std::string &xname)
Sets member_name() to xname.
Definition: poset_path.cc:526
std::string poset_name() const
The poset name part of the path.
Definition: poset_path.cc:473
bool empty() const
True if both poset name and member name are empty.
Definition: poset_path.cc:291
void put_poset_name(const std::string &xname)
Sets poset_name() to xname.
Definition: poset_path.cc:489
std::string member_name() const
The member name part of the path.
Definition: poset_path.cc:511
Namespace for the fiber_bundles component of the sheaf system.