|
template<class ITER > |
void | showDataIter (ostream &, ITER begin, const ITER &end, const char *separator=",", const char *prefix="[", const char *postfix="]") |
| Write out an ascii representation of any container using the given begin and end iterator. More...
|
|
template<class CONTAINER > |
void | showContainer (ostream &os, const CONTAINER &c, const char *separator=",", const char *prefix="[", const char *postfix="]") |
| Write out an ascii representation of any container having a forward iterator. More...
|
|
template<typename T , typename U > |
ostream & | operator<< (ostream &os, const std::pair< T, U > &p) |
| Write a std::pair. More...
|
|
template<typename T > |
ostream & | operator<< (ostream &os, const std::vector< T > &v) |
| Write the contents of a vector enclosed in square brackets, using a comma as separator. More...
|
|
template<typename T > |
ostream & | operator<< (ostream &os, const std::set< T > &v) |
| Write the contents of a set enclosed in square brackets, using a comma as separator. More...
|
|
template<typename T > |
ostream & | operator<< (ostream &os, const std::list< T > &v) |
| Write the contents of a list enclosed in square brackets, using a comma as separator. More...
|
|
template<typename T , typename U > |
ostream & | operator<< (ostream &os, const std::map< T, U > &m) |
| Print the contents of a map enclosed in braces, using a comma as separator. More...
|
|
template<typename T > |
LogIO & | operator<< (LogIO &os, const std::vector< T > &a) |
| Print the contents of a container on LogIO. More...
|
|
template<typename T > |
LogIO & | operator<< (LogIO &os, const std::set< T > &a) |
|
template<typename T > |
LogIO & | operator<< (LogIO &os, const std::list< T > &a) |
|
template<typename T , typename U > |
LogIO & | operator<< (LogIO &os, const std::map< T, U > &a) |
|
template<typename T > |
AipsIO & | operator>> (AipsIO &ios, std::vector< T > &) |
| Read or write the contents of an STL vector from/to AipsIO. More...
|
|
template<typename T > |
AipsIO & | operator<< (AipsIO &ios, const std::vector< T > &) |
|
template<typename K , typename V > |
AipsIO & | operator>> (AipsIO &ios, std::map< K, V > &) |
| Read and write the contents of a map object from/to AipsIO. More...
|
|
template<typename K , typename V > |
AipsIO & | operator<< (AipsIO &ios, const std::map< K, V > &) |
|
Input/output operators for STL-like containers.
Intended use:
Public interface
Review Status
- Reviewed By:
- Paul Shannon
- Date Reviewed:
- 1995/02/21
Prerequisite
Synopsis
The function showContainer
makes it possible to show any STL-like container (having forward iterators) on an ostream. This include casacore classes like Array, IPosition, and Block, but also STL classes like vector. The separator, prefix, and postfix can be defined at will (they default to, [ ]).
The function showDataIter
is similar to showContainer
, but uses iterators directly.
Example
IPosition
shape (3,10,10,3);
Motivation
Effortless input/output is clearly a big win.
Definition at line 95 of file STLIO.h.
template<class CONTAINER >
void casacore::STLIO_global_functions_Container_IO::showContainer |
( |
ostream & |
os, |
|
|
const CONTAINER & |
c, |
|
|
const char * |
separator = "," , |
|
|
const char * |
prefix = "[" , |
|
|
const char * |
postfix = "]" |
|
) |
| |
|
inline |
Write out an ascii representation of any container having a forward iterator.
Note that a multi-dimensional Array object is linearized. An arbitrary separator, prefix, and postfix can be given. E.g. for separator ', ' the output looks like [1, 2, 3].
Definition at line 111 of file STLIO.h.
template<class ITER >
void casacore::STLIO_global_functions_Container_IO::showDataIter |
( |
ostream & |
, |
|
|
ITER |
begin, |
|
|
const ITER & |
end, |
|
|
const char * |
separator = "," , |
|
|
const char * |
prefix = "[" , |
|
|
const char * |
postfix = "]" |
|
) |
| |
Write out an ascii representation of any container using the given begin and end iterator.
An arbitrary separator, prefix, and postfix can be given. E.g. for separator ', ' the output looks like [1, 2, 3].