casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
casa::utilj Namespace Reference

Classes

class  AipsErrorTrace
 
class  Strings
 
class  FirstFunctor
 
class  SecondFunctor
 
class  MemoryStatistics
 
class  IoStatistics
 
class  ThreadTimes
 
class  DeltaThreadTimes
 
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(); } More...
 
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 ()
 
*casacore::String formatV (const casacore::String &formatString, va_list vaList)
 DEPRECATED (casacore::String format (const char * formatString,...) /* "Use casacore::String::format". More...
 
template<typename T >
getEnv (const casacore::String &name, const T &defaultValue)
 
bool getEnv (const casacore::String &name, const bool &defaultValue)
 
int getEnv (const casacore::String &name, const int &defaultValue)
 
casacore::String getTimestamp ()
 
bool isEnvDefined (const casacore::String &name)
 
std::vector< casacore::Stringsplit (const casacore::String &string, const casacore::String &splitter, bool ignoreConsecutiveSplitters=false)
 
template<typename Itr >
casacore::String join (Itr begin, Itr end, const casacore::String &delimiter)
 
template<typename T >
casacore::String join (const T &strings, const casacore::String &delimiter)
 
template<typename Itr , typename F >
casacore::String join (Itr begin, Itr end, F f, const casacore::String &delimiter)
 
template<typename K , typename V >
std::vector< K > mapKeys (const std::map< K, V > &aMap)
 
casacore::AipsError repackageAipsError (casacore::AipsError &error, const casacore::String &message, const casacore::String &file, int line, const casacore::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 (std::ostream &os, const casacore::String &prefix="")
 
long round (double d)
 
void sleepMs (int milliseconds)
 
void toStdError (const casacore::String &m, const casacore::String &prefix="*E* ")
 
void throwIf (bool condition, const casacore::String &message, const casacore::String &file, int line, const casacore::String &func=casacore::String())
 
void throwIfError (int errorCode, const casacore::String &prefix, const casacore::String &file, int line, const casacore::String &func=casacore::String())
 
template<typename It , typename Obj >
casacore::String containerToString (It begin, It end, casacore::String(Obj::*func)() const, const casacore::String &delimiter=",", const casacore::String &wrapper="")
 
 transform (a.begin(), a.end(), std::ostream_iterator< int >(cout,"\n"), compose(unary(h), compose(unary(f), unary(f))))
 Global Functions. More...
 
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 594 of file UtilJ.h.

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

Definition at line 276 of file UtilJ.h.

References casa::vi::end().

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 91 of file UtilJ.h.

References casacore::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 83 of file UtilJ.h.

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

Definition at line 115 of file UtilJ.h.

References casacore::C::e.

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

Definition at line 101 of file UtilJ.h.

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

Definition at line 104 of file UtilJ.h.

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

Definition at line 141 of file UtilJ.h.

* casacore::String casa::utilj::formatV ( const casacore::String formatString,
va_list  vaList 
)

DEPRECATED (casacore::String format (const char * formatString,...) /* "Use casacore::String::format".

template<typename T >
T casa::utilj::getEnv ( const casacore::String name,
const T &  defaultValue 
)
bool casa::utilj::getEnv ( const casacore::String name,
const bool &  defaultValue 
)
int casa::utilj::getEnv ( const casacore::String name,
const int &  defaultValue 
)
casacore::String casa::utilj::getTimestamp ( )
bool casa::utilj::isEnvDefined ( const casacore::String name)
template<typename Itr >
casacore::String casa::utilj::join ( Itr  begin,
Itr  end,
const casacore::String delimiter 
)

Definition at line 177 of file UtilJ.h.

References casa::vi::begin(), and casa::vi::end().

Referenced by join().

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

Definition at line 196 of file UtilJ.h.

References join().

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

Definition at line 203 of file UtilJ.h.

References casa::vi::begin(), and casa::vi::end().

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

Definition at line 223 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 254 of file UtilJ.h.

References transform().

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

Definition at line 238 of file UtilJ.h.

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

Definition at line 241 of file UtilJ.h.

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

Definition at line 250 of file UtilJ.h.

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