rutz Namespace Reference

Auxiliary helper namespace used in implementing shared_ptr. More...

Namespaces

namespace  unixcall
 

Wrappers of OS/system calls.


Classes

class  cuda_free_list_base
 Un-typesafe base class for maintaining a free-list memory pool. More...
class  cuda_free_list
 Typesafe wrapper of free_list_base for maintaining free-list memory pools. More...
struct  type_traits< nub::ref< T > >
 type_traits specialization for nub::ref smart pointer More...
struct  type_traits< nub::soft_ref< T > >
 type_traits specialization for soft_ref smart pointer. More...
class  out_of_range
 Exception class for range errors. More...
struct  static_block
 A simple wrapper around a C-style array. More...
class  fixed_block
 A dynamically-allocated array whose size is fixed at construction. More...
class  shared_array
 A reference-counted smart pointer for arrays. More...
class  dynamic_block
 A dynamically-allocated array whose size may be changed at runtime. More...
class  assoc_array_base
 A non-typesafe wrapper around std::map<string, void*>. More...
class  assoc_array
 rutz::assoc_array is a typesafe wrapper of rutz::assoc_array_base. More...
class  darwin_atomic_int
 Atomic integer operations implemented using Apple Darwin's OSAtomicAdd32Barrier(). More...
struct  ix86_atomic_int_t
class  ix86_atomic_int
 Atomic integer class for ix86 CPUs. More...
class  mutex_atomic_int
 Heavyweight atomic integer implementation using mutexes. More...
class  backtrace
 Represents an instantaneous state of the call stack. More...
class  circular_queue
 Circular fixed-size queue; T must have a default constructor. More...
class  imembuf
 An input streambuf that reads from memory. More...
class  imemstream
 An input stream class based on imembuf. More...
class  icstrstream
 An input stream class based on imembuf that makes a private copy. More...
class  error
 rutz::error is a basic exception class. More...
class  error_context
 Don't use this class directly; use the GVX_ERR_CONTEXT() macro instead. More...
class  error_context_entry
 Don't use this class directly; use the GVX_ERR_CONTEXT() macro instead. More...
class  creator_base
 Abstract interface for creating objects of a particular type. More...
class  creator_from_func
 Implements rutz::creator_base by calling a function pointer. More...
class  factory_fallback
 Abstract class for a fallback strategy when factory lookup fails. More...
class  factory_base
 Non-template helper class for rutz::factory. More...
class  factory
 Create objects base on 'key' strings. More...
struct  file_pos
 Represent a position (line number) within a source file. More...
class  free_list_base
 Un-typesafe base class for maintaining a free-list memory pool. More...
class  free_list
 Typesafe wrapper of free_list_base for maintaining free-list memory pools. More...
class  string_rep
struct  char_range
class  fstring
struct  func_args
 Holds typedefs for the types of a function's arguments and return value. More...
struct  func_traits
 A traits class for holding information about functions/functors. More...
struct  func_traits< R(*)()>
 Specialization for free functions with no arguments. More...
struct  func_traits< R(*)(P1)>
 Specialization for free functions with 1 argument. More...
struct  func_traits< R(*)(P1, P2)>
 Specialization for free functions with 2 arguments. More...
struct  func_traits< R(*)(P1, P2, P3)>
 Specialization for free functions with 3 arguments. More...
struct  func_traits< R(*)(P1, P2, P3, P4)>
 Specialization for free functions with 4 arguments. More...
struct  func_traits< R(*)(P1, P2, P3, P4, P5)>
 Specialization for free functions with 5 arguments. More...
struct  func_traits< R(*)(P1, P2, P3, P4, P5, P6)>
 Specialization for free functions with 6 arguments. More...
struct  func_traits< R(C::*)()>
 Specialization for member functions with "this" plus 0 arguments. More...
struct  func_traits< R(C::*)() const >
 Specialization for member functions with "this" plus 0 arguments. More...
struct  func_traits< R(C::*)(P1)>
 Specialization for member functions with "this" plus 1 argument. More...
struct  func_traits< R(C::*)(P1) const >
 Specialization for member functions with "this" plus 1 argument. More...
struct  func_traits< R(C::*)(P1, P2)>
 Specialization for member functions with "this" plus 2 arguments. More...
struct  func_traits< R(C::*)(P1, P2) const >
 Specialization for member functions with "this" plus 2 arguments. More...
struct  func_traits< R(C::*)(P1, P2, P3)>
 Specialization for member functions with "this" plus 3 arguments. More...
struct  func_traits< R(C::*)(P1, P2, P3) const >
 Specialization for member functions with "this" plus 3 arguments. More...
struct  func_traits< R(C::*)(P1, P2, P3, P4)>
 Specialization for member functions with "this" plus 4 arguments. More...
struct  func_traits< R(C::*)(P1, P2, P3, P4) const >
 Specialization for member functions with "this" plus 4 arguments. More...
struct  func_traits< R(C::*)(P1, P2, P3, P4, P5)>
 Specialization for member functions with "this" plus 5 arguments. More...
struct  func_traits< R(C::*)(P1, P2, P3, P4, P5) const >
 Specialization for member functions with "this" plus 5 arguments. More...
struct  func_traits< R(C::*)(P1, P2, P3, P4, P5, P6)>
 Specialization for member functions with "this" plus 6 arguments. More...
struct  func_traits< R(C::*)(P1, P2, P3, P4, P5, P6) const >
 Specialization for member functions with "this" plus 6 arguments. More...
struct  func_traits< mem_functor_base< MF > >
 func_traits specialization for mem_functor_base. More...
class  mem_functor_base
 mem_functor_base adapts a member function to an ordinary operator(). More...
struct  mem_functor
 mem_functor extends mem_functor_base smart pointers for "this". More...
struct  functor_of
 Traits struct for specifying a "functor" type given a function pointer. More...
struct  functor_of< R(C::*)() >
 Specialization for zero-arg mem func. More...
struct  functor_of< R(C::*)() const >
 Specialization for zero-arg const mem func. More...
struct  functor_of< R(C::*)(P1) >
 Specialization for one-arg mem func. More...
struct  functor_of< R(C::*)(P1) const >
 Specialization for one-arg const mem func. More...
struct  functor_of< R(C::*)(P1, P2) >
 Specialization for two-arg mem func. More...
struct  functor_of< R(C::*)(P1, P2) const >
 Specialization for two-arg const mem func. More...
struct  functor_of< R(C::*)(P1, P2, P3) >
 Specialization for three-arg mem func. More...
struct  functor_of< R(C::*)(P1, P2, P3) const >
 Specialization for three-arg const mem func. More...
struct  functor_of< R(C::*)(P1, P2, P3, P4) >
 Specialization for four-arg mem func. More...
struct  functor_of< R(C::*)(P1, P2, P3, P4) const >
 Specialization for four-arg const mem func. More...
struct  functor_of< R(C::*)(P1, P2, P3, P4, P5) >
 Specialization for 5-arg mem func. More...
struct  functor_of< R(C::*)(P1, P2, P3, P4, P5) const >
 Specialization for 5-arg const mem func. More...
struct  functor_of< R(C::*)(P1, P2, P3, P4, P5, P6) >
 Specialization for 6-arg mem func. More...
struct  functor_of< R(C::*)(P1, P2, P3, P4, P5, P6) const >
 Specialization for 6-arg const mem func. More...
struct  func_traits< bound_first< base_functor, bound_t > >
 func_traits specialization for bound_first. More...
class  bound_first
 bound_first wraps another functor type with a fixed first argument. More...
struct  func_traits< bound_last< base_functor, bound_t > >
 func_traits specialization for bound_last. More...
class  bound_last
 bound_last wraps another functor type with a fixed last argument. More...
class  gzstreambuf
 A std::streambuf implementation that handles gzip-encoded data. More...
struct  iter_end_t
 Symbol class for representing generic "end of iteration". More...
class  concrete_iter
 A template base class for all concrete iterator classes. More...
class  fwd_iter_ifx
 Abstract interface class for forward iterators. More...
class  fwd_iter_adapter
 Adapts forward iterators to the fwd_iter_ifx interface. More...
class  fwd_iter
 Concrete forward iterator class. More...
class  bidir_iter_ifx
 Abstract interface class for bidirectional iterators. More...
class  bidir_iter_adapter
 Adapts bidirectional iterators to the bidir_iter_ifx interface. More...
class  bidir_iter
 Concrete bidirectional iterator class. More...
class  rxs_iter_ifx
 Abstract interface class for random-access iterators. More...
class  rxs_iter_adapter
 Adapts random-access iterators to the rxs_iter_ifx interface. More...
class  rxs_iter
 Concrete random-access iterator class. More...
class  mapped_infile
 An mmap()/munmap() wrapper class for fast input file reading. More...
class  mutex_lock_class
 Quick mutex locking class. More...
class  shell_pipe
 Adapts UNIX-style process pipes to a std::iostream interface. More...
class  pipe_fds
 An exception-safe wrapper around a pair of file descriptors from pipe(). More...
class  child_process
 An exception-safe wrapper around a child process from fork(). More...
class  exec_pipe
 An exception-safe wrapper around a pipe-fork-exec sequence. More...
class  bidir_pipe
 An exception-safe wrapper around a pipe-fork-exec sequence. More...
class  prof
 Accumulates profiling information for a given execution context. More...
class  urand
 Uniform random distribution. More...
class  urand_irange
 uniform distribution over a specified integer range More...
class  urand_frange
 uniform distribution over a specified floating-point range More...
class  scoped_ptr
 A smart-pointer for unshared objects. More...
class  shared_ptr
 A thread-safe smart pointer with reference counted copy semantics. More...
class  spin_lock_locker
class  spin_lock_darwin
class  spin_lock_pthreads
class  static_stack
 STL-style class for fixed-size stacks whose size is known at compile time. More...
class  stdiobuf
 A C++ streambuf that wraps a standard posix file descriptor. More...
class  stdiostream
class  stopwatch
 Tracks elapsed wall-clock time. More...
class  time
 A simple wrapper around timeval. More...
class  trace
 Times and traces execution in and out of a lexical scope. More...
struct  type_traits
 Basic type traits class. More...
struct  type_traits< T * >
 Specialization of type traits for pointers. More...
struct  type_traits< T & >
 Specialization of type traits for references. More...
struct  type_traits< const T & >
 Specialization of type traits for const references. More...
struct  select_if
 Select between two types based on a compile-time constant boolean expression. More...
struct  select_if< false, if_true, if_false >
 Specialization of select_if for 'false'. More...
struct  type_match
 Helper class for is_sub_super. More...
struct  is_sub_super
 Determine whether sub derives from super. More...
struct  is_class
 Traits class to tell us whether T is a class type or not. More...
struct  is_polymorphic_imp1
 Helper struct for telling whether T is a polymorphic type or not. More...
struct  is_polymorphic_imp2
struct  is_polymorphic_selector
struct  is_polymorphic_selector< true >
struct  is_polymorphic
 Traits class to tell whether T is a polymorphic type (i.e. has virtual functions). More...
struct  full_object_caster< T, false >
struct  full_object_caster< T, true >
class  value
struct  func_traits< mem_functor< MF > >
 Specialization of func_traits for mem_functor. More...
struct  func_traits< tcl::func_wrapper< N, F, Func > >
 Specialization of func_traits for tcl::func_wrapper. More...

Typedefs

typedef ix86_atomic_int atomic_int_t
typedef spin_lock_pthreads spin_lock_t

Functions

template<class T >
const T & min (const T &a, const T &b)
template<class T >
const T & max (const T &a, const T &b)
template<class T >
abs (const T &val)
template<class T >
clamp (const T &val, const T &lower, const T &upper)
template<class T >
void swap2 (T &t1, T &t2)
template<class T , std::size_t N>
T * array_begin (T(&array)[N])
 Get a pointer to the beginning of a C-style array.
template<class T , std::size_t N>
T * array_end (T(&array)[N])
 Get a pointer to the one-past-the-end of a C-style array.
template<class T , std::size_t N>
const T * array_begin (T const (&array)[N])
 Get a pointer to the beginning of a C-style const array.
template<class T , std::size_t N>
const T * array_end (T const (&array)[N])
 Get a pointer to the one-past-the-end of a C-style const array.
template<typename T >
bool operator== (const shared_array< T > &a, const shared_array< T > &b)
 Equality for shared_array; returns true if both have the same pointee.
template<typename T >
bool operator!= (const shared_array< T > &a, const shared_array< T > &b)
 Inequality for shared_array; returns true if each has different pointees.
static __inline__ void ix86_atomic_add (int i, ix86_atomic_int_t *v)
static __inline__ void ix86_atomic_sub (int i, ix86_atomic_int_t *v)
static __inline__ int ix86_atomic_sub_and_test (int i, ix86_atomic_int_t *v)
static __inline__ void ix86_atomic_inc (ix86_atomic_int_t *v)
static __inline__ void ix86_atomic_dec (ix86_atomic_int_t *v)
static __inline__ int ix86_atomic_dec_and_test (ix86_atomic_int_t *v)
static __inline__ int ix86_atomic_inc_and_test (ix86_atomic_int_t *v)
static __inline__ int ix86_atomic_add_return (int i, ix86_atomic_int_t *v)
static __inline__ int ix86_atomic_sub_return (int i, ix86_atomic_int_t *v)
rutz::fstring format (const rutz::backtrace &bt)
 Generate a human-readable string representation of the backtrace.
shared_ptr< std::ostream > obzip2open (const rutz::fstring &filename, std::ios::openmode flags=std::ios::openmode(0))
shared_ptr< std::ostream > obzip2open (const char *filename, std::ios::openmode flags=std::ios::openmode(0))
 Overload.
shared_ptr< std::istream > ibzip2open (const rutz::fstring &filename, std::ios::openmode flags=std::ios::openmode(0))
shared_ptr< std::istream > ibzip2open (const char *filename, std::ios::openmode flags=std::ios::openmode(0))
 Overload.
double compat_m_pi ()
double compat_m_pi_2 ()
double compat_m_e ()
double compat_m_ln2 ()
const char * demangled_name (const std::type_info &info)
 Returns a demangled typename for the given type.
fstring sconvert (char x)
 Convert char -> fstring.
fstring sconvert (const char *x)
 Convert c string -> fstring.
fstring sconvert (const fstring &x)
 Convert fstring -> fstring.
fstring sconvert (bool x)
 Convert bool -> fstring.
fstring sconvert (int x)
 Convert int -> fstring.
fstring sconvert (unsigned int x)
 Convert uint -> fstring.
fstring sconvert (long x)
 Convert long -> fstring.
fstring sconvert (unsigned long x)
 Convert ulong -> fstring.
fstring sconvert (double x)
 Convert double -> fstring.
bool operator== (const char *lhs, const fstring &rhs) throw ()
bool operator!= (const char *lhs, const fstring &rhs) throw ()
std::istream & operator>> (std::istream &is, fstring &str)
std::ostream & operator<< (std::ostream &os, const fstring &str)
std::istream & getline (std::istream &is, fstring &str)
std::istream & getline (std::istream &is, fstring &str, char eol)
template<class MF >
mem_functor< MF > mem_func (MF mf)
 Factory function to make a mem_functor from any member function.
template<class fptr >
functor_of< fptr >::type build_functor (fptr f)
 Factory function for building a "functor" from any function pointer.
template<class base_functor , class bound_t >
bound_first< base_functor,
bound_t > 
bind_first (base_functor base, bound_t bound)
 Factory function for creating bound_first functors.
template<class base_functor , class bound_t >
bound_last< base_functor, bound_t > bind_last (base_functor base, bound_t bound)
 Factory function for creating bound_last functors.
shared_ptr< std::ostream > ogzopen (const rutz::fstring &filename, std::ios::openmode flags=std::ios::openmode(0))
shared_ptr< std::ostream > ogzopen (const char *filename, std::ios::openmode flags=std::ios::openmode(0))
 Overload.
shared_ptr< std::istream > igzopen (const rutz::fstring &filename, std::ios::openmode flags=std::ios::openmode(0))
shared_ptr< std::istream > igzopen (const char *filename, std::ios::openmode flags=std::ios::openmode(0))
 Overload.
template<class T >
T & getref (T &t)
template<class T1 , class T2 >
T2 & getref (std::pair< T1, T2 > &p)
template<class T >
rand_range (const T &min, const T &max)
rutz::fstring vsfmt (const char *fmt, va_list ap)
 snprintf() the specified format string + varargs into a rutz::fstring.
rutz::fstring sfmt (const char *fmt,...) __attribute__((format(__printf__
 snprintf() the specified format string + varargs into a rutz::fstring.
template<class T , class U >
bool operator== (const shared_ptr< T > &a, const shared_ptr< U > &b)
 Test whether two shared_ptr's point to the same object.
template<class T , class U >
bool operator!= (const shared_ptr< T > &a, const shared_ptr< U > &b)
 Test whether two shared_ptr's point to different objects.
template<class T >
shared_ptr< T > make_shared (T *t)
 A convenience function for making a shared_ptr out of a raw pointer.
template<class Dst , class Src >
shared_ptr< Dst > dyn_cast (const shared_ptr< Src > &src)
 Do a dynamic cast on a shared ptr.
template<class Dst , class Src >
void dyn_cast_to_from (shared_ptr< Dst > &dst, const shared_ptr< Src > &src)
 Do a dynamic cast on a shared ptr.
template<class Dst , class Src >
shared_ptr< Dst > dynCast (const shared_ptr< Src > &src)
 Synonym for dyn_cast.
template<class Dst , class Src >
void dynCastToFrom (shared_ptr< Dst > &dst, const shared_ptr< Src > &src)
 Synonym for dyn_cast_to_from.
void throw_bad_cast (const std::type_info &to, const std::type_info &from, const rutz::file_pos &pos)
rutz::fstring format_time (const timeval &tval, const char *formatstring="%a %b %d %H:%M:%S %Z %Y")
 Return a formatted string (a la strftime) for the given timeval.
template<class U >
traits::yes_type is_class_tester (void(U::*)(void))
 Remove const/volative qualifiers.
template<class U >
traits::no_type is_class_tester (...)
template<class T >
const void * full_object_cast (const T *p)
 Cast a pointer to the beginning of the full object.

Variables

const iter_end_t iter_end = {}
unsigned long default_rand_seed = 0
 A hook that allows various code to start from a predictable seed.

Detailed Description

Auxiliary helper namespace used in implementing shared_ptr.


Function Documentation

template<class T , std::size_t N>
const T* rutz::array_begin ( T const (&)  array[N]  )  [inline]

Get a pointer to the beginning of a C-style const array.

Definition at line 65 of file arrays.h.

template<class T , std::size_t N>
T* rutz::array_begin ( T(&)  array[N]  )  [inline]

Get a pointer to the beginning of a C-style array.

Definition at line 51 of file arrays.h.

template<class T , std::size_t N>
const T* rutz::array_end ( T const (&)  array[N]  )  [inline]

Get a pointer to the one-past-the-end of a C-style const array.

Definition at line 72 of file arrays.h.

template<class T , std::size_t N>
T* rutz::array_end ( T(&)  array[N]  )  [inline]

Get a pointer to the one-past-the-end of a C-style array.

Definition at line 58 of file arrays.h.

template<class base_functor , class bound_t >
bound_first<base_functor, bound_t> rutz::bind_first ( base_functor  base,
bound_t  bound 
) [inline]

Factory function for creating bound_first functors.

Definition at line 632 of file functors.h.

template<class base_functor , class bound_t >
bound_last<base_functor, bound_t> rutz::bind_last ( base_functor  base,
bound_t  bound 
) [inline]

Factory function for creating bound_last functors.

Definition at line 745 of file functors.h.

template<class fptr >
functor_of<fptr>::type rutz::build_functor ( fptr  f  )  [inline]

Factory function for building a "functor" from any function pointer.

Definition at line 520 of file functors.h.

const char * rutz::demangled_name ( const std::type_info &  info  ) 
template<class Dst , class Src >
shared_ptr<Dst> rutz::dyn_cast ( const shared_ptr< Src > &  src  )  [inline]

Do a dynamic cast on a shared ptr.

Definition at line 228 of file shared_ptr.h.

References rutz::shared_ptr< T >::dyn_cast_from().

Referenced by SimEventQueue::check(), dynCast(), and ChannelFacetMap::getFacet().

template<class Dst , class Src >
void rutz::dyn_cast_to_from ( shared_ptr< Dst > &  dst,
const shared_ptr< Src > &  src 
) [inline]

Do a dynamic cast on a shared ptr.

Definition at line 237 of file shared_ptr.h.

References rutz::shared_ptr< T >::dyn_cast_from().

template<class Dst , class Src >
shared_ptr<Dst> rutz::dynCast ( const shared_ptr< Src > &  src  )  [inline]

Synonym for dyn_cast.

Definition at line 244 of file shared_ptr.h.

References dyn_cast().

template<class Dst , class Src >
void rutz::dynCastToFrom ( shared_ptr< Dst > &  dst,
const shared_ptr< Src > &  src 
) [inline]

Synonym for dyn_cast_to_from.

Definition at line 249 of file shared_ptr.h.

rutz::fstring rutz::format ( const rutz::backtrace bt  ) 

Generate a human-readable string representation of the backtrace.

Note: this function is not part of rutz::backtrace's interface so that rutz::backtrace doesn't have to depend on rutz::fstring, in order to break cyclic dependencies. In any case, this function's implementation doesn't need access to rutz::backtrace's privates.

Definition at line 46 of file backtraceformat.cc.

References rutz::backtrace::size().

Referenced by Capture::initCapture(), cimg_library::cimg::number_filename(), RasterOutputSeries::setFileStem(), XCgrabberFlex::start1(), and XCgrabber::start1().

rutz::fstring rutz::format_time ( const timeval &  tval,
const char *  formatstring = "%a %b %d %H:%M:%S %Z %Y" 
)

Return a formatted string (a la strftime) for the given timeval.

Formatting codes (see 'man strftime' for more details):

a The abbreviated weekday name according to the current locale.

A The full weekday name according to the current locale.

b The abbreviated month name according to the current locale.

B The full month name according to the current locale.

c The preferred date and time representation for the current locale.

C The century number (year/100) as a 2-digit integer. (SU)

d The day of the month as a decimal number (range 01 to 31).

D Equivalent to m/d/y. (Yecch - for Americans only. Americans should note that in other countries d/m/y is rather common. This means that in international context this format is ambiguous and should not be used.) (SU)

e Like d, the day of the month as a decimal number, but a leading zero is replaced by a space. (SU)

E Modifier: use alternative format, see below. (SU)

F Equivalent to Y-m-d (the ISO 8601 date format). (C99)

G The ISO 8601 year with century as a decimal number. The 4-digit year corresponding to the ISO week number (see V). This has the same format and value as y, except that if the ISO week number belongs to the previous or next year, that year is used instead. (TZ)

g Like G, but without century, i.e., with a 2-digit year (00-99). (TZ)

h Equivalent to b. (SU)

H The hour as a decimal number using a 24-hour clock (range 00 to 23).

I The hour as a decimal number using a 12-hour clock (range 01 to 12).

j The day of the year as a decimal number (range 001 to 366).

k The hour (24-hour clock) as a decimal number (range 0 to 23); single digits are preceded by a blank. (See also H.) (TZ)

l The hour (12-hour clock) as a decimal number (range 1 to 12); single digits are preceded by a blank. (See also I.) (TZ)

m The month as a decimal number (range 01 to 12).

M The minute as a decimal number (range 00 to 59).

n A newline character. (SU)

O Modifier: use alternative format, see below. (SU)

p Either `AM' or `PM' according to the given time value, or the corresponding strings for the current locale. Noon is treated as `pm' and midnight as `am'.

P Like p but in lowercase: `am' or `pm' or a corresponding string for the current locale. (GNU)

r The time in a.m. or p.m. notation. In the POSIX locale this is equivalent to `I:M:S p'. (SU)

R The time in 24-hour notation (H:M). (SU) For a version including the seconds, see T below.

s The number of seconds since the Epoch, i.e., since 1970-01-01 00:00:00 UTC. (TZ)

S The second as a decimal number (range 00 to 61).

t A tab character. (SU)

T The time in 24-hour notation (H:M:S). (SU)

u The day of the week as a decimal, range 1 to 7, Monday being 1. See also w. (SU)

U The week number of the current year as a decimal number, range 00 to 53, starting with the first Sunday as the first day of week 01. See also V and W.

V The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week. See also U and W. (SU)

w The day of the week as a decimal, range 0 to 6, Sunday being 0. See also u.

W The week number of the current year as a decimal number, range 00 to 53, starting with the first Monday as the first day of week 01.

x The preferred date representation for the current locale without the time.

X The preferred time representation for the current locale without the date.

y The year as a decimal number without a century (range 00 to 99).

Y The year as a decimal number including the century.

z The time-zone as hour offset from GMT. Required to emit RFC822-conformant dates (using "%a, %d %b %Y %H:%M:%S %z"). (GNU)

Z The time zone or name or abbreviation.

+ The date and time in date(1) format. (TZ)

%% A literal `' character.

Definition at line 42 of file timeformat.cc.

Referenced by ColorbarsInput::readFrame().

template<class T >
const void* rutz::full_object_cast ( const T *  p  )  [inline]

Cast a pointer to the beginning of the full object.

Here we select between static_cast and dynamic_cast depending on whether T is polymorphic.

Definition at line 215 of file traits.h.

Referenced by ModelComponent::ModelComponent(), rutz::shared_ptr< T >::shared_ptr(), and ModelComponent::~ModelComponent().

shared_ptr< std::istream > rutz::ibzip2open ( const char *  filename,
std::ios::openmode  flags = std::ios::openmode(0) 
)

Overload.

Definition at line 413 of file bzip2stream.cc.

References ibzip2open().

shared_ptr< std::istream > rutz::ibzip2open ( const rutz::fstring filename,
std::ios::openmode  flags = std::ios::openmode(0) 
)

Opens a file for reading. An exception will be thrown if the specified file cannot be opened. The input file will be bzip2-decompressed if the filename ends with ".bz2".

Definition at line 383 of file bzip2stream.cc.

References rutz::fstring::c_str(), rutz::fstring::ends_with(), make_shared(), sfmt(), and SRC_POS.

Referenced by YuvParser::getFrame(), ibzip2open(), MrawvDecoder::MrawvDecoder(), and openMaybeCompressedFile().

shared_ptr< std::istream > rutz::igzopen ( const char *  filename,
std::ios::openmode  flags = std::ios::openmode(0) 
)

Overload.

Definition at line 253 of file gzstreambuf.cc.

shared_ptr< std::istream > rutz::igzopen ( const rutz::fstring filename,
std::ios::openmode  flags = std::ios::openmode(0) 
)

Opens a file for reading. An exception will be thrown if the specified file cannot be opened. If the file is gz-compressed, this will be automagically detected regardless of the filename extension.

Definition at line 260 of file gzstreambuf.cc.

References rutz::fstring::c_str().

Referenced by YuvParser::getFrame(), MrawvDecoder::MrawvDecoder(), and openMaybeCompressedFile().

template<class U >
traits::yes_type rutz::is_class_tester ( void(U::*)(void)   )  [inline]

Remove const/volative qualifiers.

static __inline__ void rutz::ix86_atomic_add ( int  i,
ix86_atomic_int_t *  v 
) [static]

ix86_atomic_add - add integer to atomic variable : integer value to add : pointer of type ix86_atomic_int_t

Atomically adds to .

Definition at line 54 of file atomic_ix86.h.

Referenced by rutz::ix86_atomic_int::atomic_add().

static __inline__ int rutz::ix86_atomic_add_return ( int  i,
ix86_atomic_int_t *  v 
) [static]

ix86_atomic_add_return - add and return : pointer of type ix86_atomic_int_t : integer value to add

Atomically adds to and returns +

Definition at line 172 of file atomic_ix86.h.

Referenced by rutz::ix86_atomic_int::atomic_add_return(), rutz::ix86_atomic_int::atomic_decr_return(), and rutz::ix86_atomic_int::atomic_incr_return().

static __inline__ void rutz::ix86_atomic_dec ( ix86_atomic_int_t *  v  )  [static]

ix86_atomic_dec - decrement atomic variable : pointer of type ix86_atomic_int_t

Atomically decrements by 1.

Definition at line 118 of file atomic_ix86.h.

Referenced by rutz::ix86_atomic_int::atomic_decr().

static __inline__ int rutz::ix86_atomic_dec_and_test ( ix86_atomic_int_t *  v  )  [static]

ix86_atomic_dec_and_test - decrement and test : pointer of type ix86_atomic_int_t

Atomically decrements by 1 and returns true if the result is 0, or false for all other cases. Note that the guaranteed useful range of an ix86_atomic_int_t is only 24 bits.

Definition at line 135 of file atomic_ix86.h.

Referenced by rutz::ix86_atomic_int::atomic_decr_test_zero().

static __inline__ void rutz::ix86_atomic_inc ( ix86_atomic_int_t *  v  )  [static]

ix86_atomic_inc - increment atomic variable : pointer of type ix86_atomic_int_t

Atomically increments by 1. Note that the guaranteed useful range of an ix86_atomic_int_t is only 24 bits.

Definition at line 104 of file atomic_ix86.h.

Referenced by rutz::ix86_atomic_int::atomic_incr().

static __inline__ int rutz::ix86_atomic_inc_and_test ( ix86_atomic_int_t *  v  )  [static]

ix86_atomic_inc_and_test - increment and test : pointer of type ix86_atomic_int_t

Atomically increments by 1 and returns true if the result is zero, or false for all other cases.

Definition at line 154 of file atomic_ix86.h.

Referenced by rutz::ix86_atomic_int::atomic_incr_test_zero().

static __inline__ void rutz::ix86_atomic_sub ( int  i,
ix86_atomic_int_t *  v 
) [static]

ix86_atomic_sub - subtract the atomic variable : integer value to subtract : pointer of type ix86_atomic_int_t

Atomically subtracts from .

Definition at line 69 of file atomic_ix86.h.

Referenced by rutz::ix86_atomic_int::atomic_sub().

static __inline__ int rutz::ix86_atomic_sub_and_test ( int  i,
ix86_atomic_int_t *  v 
) [static]

ix86_atomic_sub_and_test - subtract value from variable and test result : integer value to subtract : pointer of type ix86_atomic_int_t

Atomically subtracts from and returns true if the result is zero, or false for all other cases.

Definition at line 86 of file atomic_ix86.h.

Referenced by rutz::ix86_atomic_int::atomic_sub_test_zero().

template<class T >
shared_ptr<T> rutz::make_shared ( T *  t  )  [inline]
template<class MF >
mem_functor<MF> rutz::mem_func ( MF  mf  )  [inline]

Factory function to make a mem_functor from any member function.

Definition at line 395 of file functors.h.

shared_ptr< std::ostream > rutz::obzip2open ( const char *  filename,
std::ios::openmode  flags = std::ios::openmode(0) 
)

Overload.

Definition at line 407 of file bzip2stream.cc.

References obzip2open().

shared_ptr< std::ostream > rutz::obzip2open ( const rutz::fstring filename,
std::ios::openmode  flags = std::ios::openmode(0) 
)

Opens a file for writing. An exception will be thrown if the specified file cannot be opened. The output file will be bzip2-compressed if the filename ends with ".bz2".

Definition at line 361 of file bzip2stream.cc.

References rutz::fstring::c_str(), rutz::fstring::ends_with(), make_shared(), sfmt(), and SRC_POS.

Referenced by obzip2open().

shared_ptr< std::ostream > rutz::ogzopen ( const char *  filename,
std::ios::openmode  flags = std::ios::openmode(0) 
)

Overload.

Definition at line 247 of file gzstreambuf.cc.

References ogzopen().

shared_ptr< std::ostream > rutz::ogzopen ( const rutz::fstring filename,
std::ios::openmode  flags = std::ios::openmode(0) 
)

Opens a file for writing. An exception will be thrown if the specified file cannot be opened. The output file will be gz-compressed if the filename ends with ".gz".

Definition at line 224 of file gzstreambuf.cc.

References rutz::fstring::c_str(), rutz::fstring::ends_with(), make_shared(), sfmt(), and SRC_POS.

Referenced by ogzopen().

template<class T , class U >
bool rutz::operator!= ( const shared_ptr< T > &  a,
const shared_ptr< U > &  b 
) [inline]

Test whether two shared_ptr's point to different objects.

Definition at line 217 of file shared_ptr.h.

References rutz::shared_ptr< T >::get().

template<typename T >
bool rutz::operator!= ( const shared_array< T > &  a,
const shared_array< T > &  b 
) [inline]

Inequality for shared_array; returns true if each has different pointees.

Definition at line 339 of file arrays.h.

References rutz::shared_array< T >::get().

template<class T , class U >
bool rutz::operator== ( const shared_ptr< T > &  a,
const shared_ptr< U > &  b 
) [inline]

Test whether two shared_ptr's point to the same object.

Definition at line 210 of file shared_ptr.h.

References rutz::shared_ptr< T >::get().

template<typename T >
bool rutz::operator== ( const shared_array< T > &  a,
const shared_array< T > &  b 
) [inline]

Equality for shared_array; returns true if both have the same pointee.

Definition at line 334 of file arrays.h.

References rutz::shared_array< T >::get().

fstring rutz::sconvert ( double  x  ) 

Convert double -> fstring.

Definition at line 425 of file fstring.cc.

fstring rutz::sconvert ( unsigned long  x  ) 

Convert ulong -> fstring.

Definition at line 424 of file fstring.cc.

fstring rutz::sconvert ( long  x  ) 

Convert long -> fstring.

Definition at line 423 of file fstring.cc.

fstring rutz::sconvert ( unsigned int  x  ) 

Convert uint -> fstring.

Definition at line 422 of file fstring.cc.

fstring rutz::sconvert ( int  x  ) 

Convert int -> fstring.

Definition at line 421 of file fstring.cc.

fstring rutz::sconvert ( bool  x  ) 

Convert bool -> fstring.

Definition at line 420 of file fstring.cc.

fstring rutz::sconvert ( const fstring x  ) 

Convert fstring -> fstring.

Definition at line 411 of file fstring.cc.

fstring rutz::sconvert ( const char *  x  ) 

Convert c string -> fstring.

Definition at line 410 of file fstring.cc.

fstring rutz::sconvert ( char  x  ) 

Convert char -> fstring.

Definition at line 409 of file fstring.cc.

fstring rutz::sfmt ( const char *  fmt,
  ... 
)
fstring rutz::vsfmt ( const char *  fmt,
va_list  ap 
)

snprintf() the specified format string + varargs into a rutz::fstring.

NOTE: The CALLER is responsible for doing va_end(ap); it is not done internally in vsfmt().

Definition at line 45 of file sfmt.cc.

References SRC_POS.

Referenced by sfmt().


Variable Documentation

unsigned long rutz::default_rand_seed = 0

A hook that allows various code to start from a predictable seed.

This allows code in disparate locations to all be triggered by the same random seed. This is useful in allowing for predictable and repeatable execution sequences e.g. in a testing context. Initial value is 0. The most sensible use case involves setting this value just once, at or near the beginning of program execution.

Definition at line 38 of file rand.cc.

Generated on Sun May 8 08:31:11 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3