20 #ifndef DEEP_SIZE_IMPL_H 21 #define DEEP_SIZE_IMPL_H 23 #ifndef SHEAF_DLL_SPEC_H 24 #include "SheafSystem/sheaf_dll_spec.h" 28 #include "SheafSystem/deep_size.h" 31 #ifndef ASSERT_CONTRACT_H 32 #include "SheafSystem/assert_contract.h" 35 #ifndef PRIMITIVE_TRAITS_H 36 #include "SheafSystem/primitive_traits.h" 39 #ifndef STD_IOSTREAM_H 40 #include "SheafSystem/std_iostream.h" 87 typename M::const_iterator litr;
88 for(litr = xp.begin(); litr != xp.end(); ++litr)
91 result +=
deep_size(*(litr->second),
false);
103 template <
typename M>
114 typename M::const_iterator litr;
115 for(litr = xp.begin(); litr != xp.end(); ++litr)
129 template <
typename M>
140 typename M::const_iterator litr;
141 for(litr = xp.begin(); litr != xp.end(); ++litr)
143 result +=
deep_size(litr->second,
false);
155 template <
typename M>
166 typename M::const_iterator litr;
167 for(litr = xp.begin(); litr != xp.end(); ++litr)
170 result +=
deep_size(litr->second,
false);
182 template <
typename K,
typename V,
typename S,
typename H,
typename E,
typename A>
184 deep_size(
const unordered::unordered_multimap<K, V, H, E, A>& xp,
bool xinclude_shallow)
194 result = xinclude_shallow ?
sizeof(xp) : 0;
204 static const int load_factor = 2;
209 size_t lbucket_count = xp.bucket_count();
210 size_t ldeep_size = load_factor * lbucket_count *
sizeof(pair<K, V>);
212 result += ldeep_size;
216 result += S::items_deep_size(xp);
227 template <
typename K,
typename V,
typename S,
typename H,
typename E,
typename A>
229 deep_size(
const unordered::unordered_map<K, V, H, E, A>& xp,
bool xinclude_shallow)
239 result = xinclude_shallow ?
sizeof(xp) : 0;
247 static const int load_factor = 2;
252 size_t lbucket_count = xp.bucket_count();
253 size_t ldeep_size = load_factor * lbucket_count *
sizeof(pair<K, V>);
255 result += ldeep_size;
259 result += S::items_deep_size(xp);
270 template <
typename K,
typename V,
typename S>
272 deep_size(
const std::map<K, V>& xp,
bool xinclude_shallow)
282 result = xinclude_shallow ?
sizeof(xp) : 0;
289 size_t lsize = xp.size();
290 size_t ldeep_size = lsize *
sizeof(pair<K, V>);
292 result += ldeep_size;
296 result += S::items_deep_size(xp);
307 template <
typename T>
309 deep_size(
const std::list<T>& xp,
bool xinclude_shallow)
317 result = xinclude_shallow ?
sizeof(xp) : 0;
326 result += xp.size() * 2*
sizeof(
void*);
330 typename std::list<T>::const_iterator litr = xp.begin();
331 for(; litr != xp.end(); ++litr)
349 template <
typename T>
372 #endif // ifndef DEEP_SIZE_IMPL_H static size_type size()
The size of T in bytes.
static size_t items_deep_size(const M &xp)
The deep_size of the items in xp.
static size_t items_deep_size(const M &xp)
The deep_size of the items in xp.
static size_t items_deep_size(const M &xp)
The deep_size of the items in xp.
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.
static size_t items_deep_size(const M &xp)
The deep_size of the items in xp.
static size_t items_deep_size(const M &xp)
The deep_size of the items in xp.
Namespace for the sheaves component of the sheaf system.