casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Functions
casa::utilj Namespace Reference

Classes

class  AipsErrorTrace
class  Strings
class  FirstFunctor
class  SecondFunctor
class  MemoryStatistics
class  IoStatistics
class  ThreadTimes
class  DeltaThreadTimes
 
More...
class  ComposedFunctor
 prints out 104 116 136 More...
class  UnaryFunctor
class  Z

Functions

template<typename Container >
Bool containsKey (const typename Container::key_type &key, const Container &container)
 template <typename Element, typename Container> Bool contains (const Element & e, const Container & c) { return c.find(e) != c.end(); }
template<typename Container >
Bool contains (const typename Container::value_type &e, const Container &c)
template<typename F , typename S >
F & first (std::pair< F, S > &pair)
template<typename F , typename S >
const F & first (const std::pair< F, S > &pair)
template<typename Container , typename Element >
Container fillContainer (Element sentinel,...)
template<typename F , typename S >
FirstFunctor< F, S > firstFunctor ()
String format (const char *formatString,...)
String formatV (const String &formatString, va_list vaList)
template<typename T >
getEnv (const String &name, const T &defaultValue)
Bool getEnv (const String &name, const Bool &defaultValue)
Int getEnv (const String &name, const Int &defaultValue)
String getTimestamp ()
Bool isEnvDefined (const String &name)
std::vector< Stringsplit (const String &string, const String &splitter, Bool ignoreConsecutiveSplitters=False)
template<typename Itr >
String join (Itr begin, Itr end, const String &delimiter)
template<typename T >
String join (const T &strings, const String &delimiter)
template<typename Itr , typename F >
String join (Itr begin, Itr end, F f, const String &delimiter)
template<typename K , typename V >
std::vector< K > mapKeys (const std::map< K, V > &aMap)
AipsError repackageAipsError (AipsError &error, const String &message, const String &file, Int line, const String &func)
template<typename F , typename S >
F & second (std::pair< F, S > &pair)
template<typename F , typename S >
const F & second (const std::pair< F, S > &pair)
template<typename F , typename S >
SecondFunctor< F, S > secondFunctor ()
template<typename K , typename V >
std::vector< V > mapValues (const std::map< K, V > &aMap)
void printBacktrace (ostream &os, const String &prefix="")
void sleepMs (Int milliseconds)
void toStdError (const String &m, const String &prefix="*E* ")
void throwIf (Bool condition, const String &message, const String &file, Int line, const String &func=String())
void throwIfError (Int errorCode, const String &prefix, const String &file, Int line, const String &func=String())
template<typename It , typename Obj >
string containerToString (It begin, It end, String(Obj::*func)() const, const String &delimiter=",", const String &wrapper="")
 transform (a.begin(), a.end(), std::ostream_iterator< int >(cout,"\n"), compose(unary(h), compose(unary(f), unary(f))))
 Global Functions.
template<typename F , typename G >
ComposedFunctor< F, G > compose (F f, G g)
template<typename D , typename R >
UnaryFunctor< D, R > unary (R(*f)(D))

Function Documentation

template<typename F , typename G >
ComposedFunctor<F, G> casa::utilj::compose ( f,
g 
)

Definition at line 611 of file UtilJ.h.

template<typename It , typename Obj >
string casa::utilj::containerToString ( It  begin,
It  end,
String(Obj::*)() const  func,
const String delimiter = ",",
const String wrapper = "" 
)

Definition at line 293 of file UtilJ.h.

template<typename Container >
Bool casa::utilj::contains ( const typename Container::value_type &  e,
const Container &  c 
)

For set and map use containsKey; will work for set but use with map requires specifying a pair as the first argument

Definition at line 110 of file UtilJ.h.

References casa::C::e.

template<typename Container >
Bool casa::utilj::containsKey ( const typename Container::key_type &  key,
const Container &  container 
)

template <typename Element, typename Container> Bool contains (const Element & e, const Container & c) { return c.find(e) != c.end(); }

 

Definition at line 102 of file UtilJ.h.

template<typename Container , typename Element >
Container casa::utilj::fillContainer ( Element  sentinel,
  ... 
)

Definition at line 134 of file UtilJ.h.

References casa::C::e.

template<typename F , typename S >
F& casa::utilj::first ( std::pair< F, S > &  pair)

Definition at line 120 of file UtilJ.h.

template<typename F , typename S >
const F& casa::utilj::first ( const std::pair< F, S > &  pair)

Definition at line 123 of file UtilJ.h.

template<typename F , typename S >
FirstFunctor<F,S> casa::utilj::firstFunctor ( )

Definition at line 160 of file UtilJ.h.

String casa::utilj::format ( const char *  formatString,
  ... 
)
String casa::utilj::formatV ( const String formatString,
va_list  vaList 
)
template<typename T >
T casa::utilj::getEnv ( const String name,
const T &  defaultValue 
)
Bool casa::utilj::getEnv ( const String name,
const Bool &  defaultValue 
)
Int casa::utilj::getEnv ( const String name,
const Int &  defaultValue 
)
template<typename Itr >
String casa::utilj::join ( Itr  begin,
Itr  end,
const String delimiter 
)

Definition at line 196 of file UtilJ.h.

Referenced by join().

template<typename T >
String casa::utilj::join ( const T &  strings,
const String delimiter 
)

Definition at line 215 of file UtilJ.h.

References join().

template<typename Itr , typename F >
String casa::utilj::join ( Itr  begin,
Itr  end,
f,
const String delimiter 
)

Definition at line 222 of file UtilJ.h.

template<typename K , typename V >
std::vector<K> casa::utilj::mapKeys ( const std::map< K, V > &  aMap)

Definition at line 242 of file UtilJ.h.

References transform().

template<typename K , typename V >
std::vector<V> casa::utilj::mapValues ( const std::map< K, V > &  aMap)

Definition at line 271 of file UtilJ.h.

References transform().

void casa::utilj::printBacktrace ( ostream &  os,
const String prefix = "" 
)
AipsError casa::utilj::repackageAipsError ( AipsError &  error,
const String message,
const String file,
Int  line,
const String func 
)
template<typename F , typename S >
F& casa::utilj::second ( std::pair< F, S > &  pair)

Definition at line 255 of file UtilJ.h.

template<typename F , typename S >
const F& casa::utilj::second ( const std::pair< F, S > &  pair)

Definition at line 258 of file UtilJ.h.

template<typename F , typename S >
SecondFunctor<F,S> casa::utilj::secondFunctor ( )

Definition at line 267 of file UtilJ.h.

void casa::utilj::sleepMs ( Int  milliseconds)
std::vector<String> casa::utilj::split ( const String string,
const String splitter,
Bool  ignoreConsecutiveSplitters = False 
)
void casa::utilj::throwIf ( Bool  condition,
const String message,
const String file,
Int  line,
const String func = String() 
)
void casa::utilj::throwIfError ( Int  errorCode,
const String prefix,
const String file,
Int  line,
const String func = String() 
)
void casa::utilj::toStdError ( const String m,
const String prefix = "*E* " 
)
casa::utilj::transform ( a.  begin(),
a.  end(),
std::ostream_iterator< int >  cout,"\n",
compose(unary(h), compose(unary(f), unary(f)))   
)

Global Functions.

A free function is provided that is useful for go here...

Referenced by casa::ArrayMath_global_functions_Array_mathematical_operations::arrayContTransform(), mapKeys(), and mapValues().

template<typename D , typename R >
UnaryFunctor<D, R> casa::utilj::unary ( R(*)(D)  f)