SheafSystem  0.0.0.0
block.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 BLOCK
19 
20 #ifndef BLOCK_H
21 #define BLOCK_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef AUTO_BLOCK_H
28 #include "SheafSystem/auto_block.h"
29 #endif
30 
31 namespace sheaf
32 {
33 
37 template <typename T>
38 class SHEAF_DLL_SPEC block : public auto_block<T, un_block_initialization_policy<T> >
39 {
40 
41 public:
42 
43  typedef auto_block<T, un_block_initialization_policy<T> > base_type;
44 
45  typedef typename base_type::index_type index_type;
46  typedef typename base_type::size_type size_type;
47 
48 
53  block(index_type xub = 0);
54 
59  block(index_type xub, size_type xct, const T *xitems);
60 
64  block(const block& xother);
65 
69  block& operator=(const block& xother);
70 
74  ~block();
75 
76 };
77 
78 
79 // ===========================================================
80 // NON-MEMBER FUNCTIONS
81 // ===========================================================
82 
86 template <typename T>
87 bool operator==(const block<T>& xblk1, const block<T>& xblk2);
88 
92 template <typename T>
93 std::ostream& operator << (std::ostream& xos, const block<T>& xblk);
94 
99 template<typename T>
100 size_t deep_size(const block<T>& xblk, bool xinclude_shallow = true);
101 
108 template<typename T>
109 size_t deep_size(const block<T*>& xblk, bool xinclude_shallow = true);
110 
111 } // namespace sheaf
112 
113 #endif // BLOCK_H
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
bool operator==(const singly_linked_list< T, Alloc > &lhs, const singly_linked_list< T, Alloc > &rhs)
Checks if the contents of lhs and rhs are equal, that is, whether lhs.size() == rhs.size() and each element in lhs compares equal with the element in rhs at the same position.
Namespace for the sheaves component of the sheaf system.