9 #ifndef STK_UTIL_DIAG_WRITEREXT_HPP
10 #define STK_UTIL_DIAG_WRITEREXT_HPP
22 #include <stk_util/stk_config.h>
26 #include <stk_util/diag/Writer.hpp>
30 #include <stk_util/diag/StringUtil.hpp>
32 #include <stk_util/util/FeatureTest.hpp>
34 #include <stk_util/util/FArrayPrint.hpp>
35 #include <stk_util/parallel/MPI.hpp>
36 #include <stk_util/diag/Mapv.hpp>
37 #include <stk_util/diag/Option.hpp>
60 Writer &
operator<<(Writer &dout,
const std::type_info &t);
76 dout <<
" " <<
typeid(t) <<
", " << t.get() <<
", " << *t;
78 dout <<
" " <<
typeid(t) <<
", <not created or not owner>";
94 template <
class T,
class U>
97 dout <<
"(" << pair.first <<
":" << pair.second <<
")";
117 const std::vector<T> & t)
119 if (dout.shouldPrint()) {
120 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
122 if (t.size() <= 10) {
123 for (
typename std::vector<T>::const_iterator it = t.begin(); it != t.end(); ++it)
124 dout << (*it) <<
" ";
129 for (
typename std::vector<T>::const_iterator it = t.begin(); it != t.end(); ++it, ++i)
130 dout <<
"[" << i <<
"] " << (*it) <<
dendl;
154 const std::vector<T *> & t)
156 if (dout.shouldPrint()) {
157 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
160 for (
typename std::vector<T *>::const_iterator it = t.begin(); it != t.end(); ++it, ++i)
184 const std::list<T> & t)
186 if (dout.shouldPrint()) {
187 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
190 for (
typename std::list<T>::const_iterator it = t.begin(); it != t.end(); ++it, ++i)
191 dout <<
"[" << i <<
"] " << (*it) <<
dendl;
214 const std::list<T *> & t)
216 if (dout.shouldPrint()) {
217 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
220 for (
typename std::list<T *>::const_iterator it = t.begin(); it != t.end(); ++it, ++i)
240 template <
class Key,
class T,
class L>
244 const std::map<Key, T, L> & t)
246 if (dout.shouldPrint()) {
247 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
249 for (
typename std::map<Key, T, L>::const_iterator it = t.begin(); it != t.end(); ++it)
250 dout <<
"[" << (*it).first <<
"] " << (*it).second <<
dendl;
269 template <
class Key,
class T,
class L>
273 const std::map<Key, T *, L> & t)
275 if (dout.shouldPrint()) {
276 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
278 for (
typename std::map<Key, T *, L>::const_iterator it = t.begin(); it != t.end(); ++it)
279 dout <<
"[" << (*it).first <<
"] " <<
c_ptr_<T>((*it).second) << std::endl;
298 template <
class Key,
class T,
class L>
302 const std::multimap<Key, T, L> & t)
304 if (dout.shouldPrint()) {
305 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
307 for (
typename std::multimap<Key, T, L>::const_iterator it = t.begin(); it != t.end(); ++it)
308 dout <<
"[" << (*it).first <<
"] " << (*it).second <<
dendl;
327 template <
class Key,
class T,
class L>
331 const std::multimap<Key, T *, L> & t)
333 if (dout.shouldPrint()) {
334 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
336 for (
typename std::multimap<Key, T *, L>::const_iterator it = t.begin(); it != t.end(); ++it)
337 dout <<
"[" << (*it).first <<
"] " <<
c_ptr_<T>((*it).second) << std::endl;
356 template <
class Key,
class L>
360 const std::set<Key, L> & t)
362 if (dout.shouldPrint()) {
363 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
365 for (
typename std::set<Key, L>::const_iterator it = t.begin(); it != t.end(); ++it)
366 dout << (*it) <<
dendl;
385 template <
class Key,
class L>
389 const std::set<Key *, L> & t)
391 if (dout.shouldPrint()) {
392 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
394 for (
typename std::set<Key *, L>::const_iterator it = t.begin(); it != t.end(); ++it)
414 template <
class Key,
class L>
418 const std::multiset<Key, L> & t)
420 if (dout.shouldPrint()) {
421 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
423 for (
typename std::multiset<Key, L>::const_iterator it = t.begin(); it != t.end(); ++it)
424 dout << (*it) <<
dendl;
443 template <
class Key,
class L>
447 const std::multiset<Key *, L> & t)
449 if (dout.shouldPrint()) {
450 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
452 for (
typename std::multiset<Key *, L>::const_iterator it = t.begin(); it != t.end(); ++it)
522 Writer &operator<<(Writer &dout,
const std::bitset<n> &t) {
523 if (dout.shouldPrint())
524 dout.getStream() << t;
543 return dump(dout, t);
559 return dump(dout, t);
573 template <
class Key,
class T,
class L>
575 return dump(dout, t);
589 template <
class Key,
class T,
class L>
591 return dump(dout, t);
605 template <
class Key,
class L>
607 return dump(dout, t);
621 template <
class Key,
class L>
623 return dump(dout, t);
653 #if defined( STK_HAS_MPI )
704 Writer &operator<<(Writer &dout,
const sierra::MPI::TempLoc &loc);
706 #endif // if defined( STK_HAS_MPI )
723 template<
class ElementType,
737 if (dout.shouldPrint()) {
739 dout << type.substr(0, type.find(
", sierra::TypeListEnd")) <<
">" << push <<
dendl;
740 dout.getStream() << array;
741 dout << pop <<
dendl;
747 template<
class ElementType,
761 if (
dout.shouldPrint()) {
763 dout << type.substr(0, type.find(
", sierra::TypeListEnd")) <<
">" << push <<
dendl;
764 dout.getStream() << array;
771 template<
class ElementType,
int Dimension>
777 if (
dout.shouldPrint()) {
779 dout.getStream() << array;
785 template<
class ElementType,
int Dimension>
791 if (
dout.shouldPrint()) {
793 dout.getStream() << array;
814 const sierra::Mapv_no_delete<T> & t)
816 if (dout.shouldPrint()) {
817 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
819 for (
typename sierra::Mapv_no_delete<T>::const_iterator it = t.begin(); it != t.end(); ++it) {
820 dout <<
"[" << (*it).mapv_key() <<
"] " << (*it) <<
dendl;
840 template <
class Key,
class T,
class U>
846 if (dout.shouldPrint()) {
847 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
849 for (
typename sierra::vecmap<Key, T, U>::const_iterator it = t.begin(); it != t.end(); ++it)
850 dout <<
"[" << (*it).first <<
"] " << (*it).second <<
dendl;
869 template <
class Key,
class T,
class U>
875 if (dout.shouldPrint()) {
876 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
878 for (
typename sierra::vecmap<Key, T *, U>::const_iterator it = t.begin(); it != t.end(); ++it)
879 dout <<
"[" << (*it).first <<
"] " << *(*it).second <<
dendl;
898 template <
class Key,
class T,
class U>
904 if (dout.shouldPrint()) {
905 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
907 for (
typename sierra::vecmap<Key *, T *, U>::const_iterator it = t.begin(); it != t.end(); ++it)
908 dout <<
"[" << (*it).first <<
"] " << *(*it).second <<
dendl;
927 template <
class T,
class U>
933 if (dout.shouldPrint()) {
934 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
937 for (
typename sierra::vecset<T, U>::const_iterator it = t.begin(); it != t.end(); ++it, ++i)
938 dout <<
"[" << i <<
"] " << (*it) <<
dendl;
957 template <
class T,
class U>
963 if (dout.shouldPrint()) {
964 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
967 for (
typename sierra:: vecset<T *, U>::const_iterator it = t.begin(); it != t.end(); ++it, ++i)
968 dout <<
"[" << i <<
"] " << *(*it) <<
dendl;
986 template <
class T,
class U>
992 if (dout.shouldPrint()) {
993 dout <<
typeid(t) <<
", " << t.
mapv_key();
1009 template <
class T,
class U>
1013 const sierra::Mapv<T, U> & t)
1015 if (dout.shouldPrint()) {
1016 dout <<
typeid(t) <<
", size " << t.size() << push <<
dendl;
1018 for (
typename sierra::Mapv<T, U>::const_iterator it = t.begin(); it != t.end(); ++it) {
1019 dout <<
"[" << (*it).mapv_key() <<
"] " << (*it) <<
dendl;
1039 template <
class T,
class U>
1041 return dump(dout, t);
1055 template <
class Key,
class T,
class U>
1057 return dump(dout, t);
1071 template <
class T,
class U>
1073 return dump(dout, t);
1087 template <
class Key,
class T,
class U>
1089 return dump(dout, t);
1105 return dump(dout, t);
1119 template <
class T,
class U>
1121 return dump(dout, t);
1135 template <
class T,
class U>
1137 return dump(dout, t);
1151 template <
class Key,
class T,
class U>
1153 return dump(dout, t);
1164 #endif // STK_UTIL_DIAG_WRITEREXT_HPP