SheafSystem  0.0.0.0
gln.impl.h
Go to the documentation of this file.
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 
20 
21 
22 #ifndef GLN_IMPL_H
23 #define GLN_IMPL_H
24 
25 #ifndef SHEAF_DLL_SPEC_H
26 #include "SheafSystem/sheaf_dll_spec.h"
27 #endif
28 
29 #ifndef ASSERT_CONTRACT_H
30 #include "SheafSystem/assert_contract.h"
31 #endif
32 
33 #ifndef GLN_H
34 #include "SheafSystem/gln.h"
35 #endif
36 
37 namespace fiber_bundle
38 {
39 
40 //==============================================================================
41 // CLASS GLN_ROW_DOFS_TYPE
42 //==============================================================================
43 
44 template <typename T>
45 const std::string&
48 {
49  // Preconditions:
50 
51  // Body:
52 
53  static const std::string result("gln_row_dofs_type");
54 
55  // Postconditions:
56 
57  ensure(!result.empty());
58 
59  // Exit:
60 
61  return result;
62 }
63 
64 template <typename T>
65 T&
67 operator[] (int xindex)
68 {
69  // Preconditions:
70 
71  require(xindex >= 0);
72 
73  // Body:
74 
75  T& result = reinterpret_cast<T*>(this)[xindex];
76 
77  // Postconditions:
78 
79  // Exit:
80 
81  return result;
82 }
83 
84 template <typename T>
85 const T&
87 operator[] (int xindex) const
88 {
89  // Preconditions:
90 
91  require(xindex >= 0);
92 
93  // Body:
94 
95  const T& result = reinterpret_cast<const T*>(this)[xindex];
96 
97  // Postconditions:
98 
99  // Exit:
100 
101  return result;
102 }
103 
104 template <typename T>
107 {
108  // Preconditions:
109 
110  // Body:
111 
113 
114  // Postconditions:
115 
116  ensure(result != 0);
117 
118  // Exit:
119 
120  return result;
121 }
122 
123 
124 } // namespace fiber_bundle
125 
126 #endif // ifndef GLN_IMPL_H
row_dofs_type * clone() const
Creates a new instance of the same type as this.
Definition: gln.impl.h:106
static const std::string & static_class_name()
The name of this class.
Definition: gln.impl.h:47
T & operator[](int xindex)
Value of xindex-th component (row dof) (non const version).
Definition: gln.impl.h:67
Row dofs type for class gln.
Definition: gln.h:54
Namespace for the fiber_bundles component of the sheaf system.