Equalizer  1.2.1
Classes | Functions | Typedefs | Enumerations
co::base Namespace Reference

Base abstraction layer and common utility classes. More...

Classes

class  Atomic
 A variable with atomic semantics and standalone atomic operations. More...
class  Buffer
 A simple memory buffer with some helper functions. More...
class  Clock
 A class for time measurements. More...
class  Condition
 A condition variable and associated lock. More...
class  DSO
 Helper to access dynamic shared objects (DSO) More...
class  ErrorRegistry
 A registry translating error codes to strings. More...
class  Global
 Global parameter handling for the Equalizer base library. More...
class  PtrHash
 A hash for pointer keys. More...
struct  hashRefPtr
 A hash function for RefPtr keys. More...
class  RefPtrHash
 A hash for RefPtr keys. More...
class  UUIDHash
 A hash for UUID keys. More...
class  Launcher
 The launcher executes a command from a separate process. More...
class  LFQueue
 A thread-safe, lock-free queue with non-blocking access. More...
class  Lock
 A lock (mutex) primitive. More...
class  Lockable
 A convenience structure to hold data together with a lock for access. More...
class  LogBuffer
class  Log
 The logging class. More...
class  MemoryMap
 Helper to map a file to a memory address (mmap) More...
class  Monitor
 A monitor primitive. More...
class  MTQueue
 A thread-safe queue with a blocking read access. More...
class  NonCopyable
 Base class to make objects non-copyable. More...
class  OMP
 Base class for OpenMP functionality. More...
class  PerThread
 Implements thread-specific storage for C++ objects. More...
class  PerThreadRef
 Thread-specific storage for a RefPtr. More...
class  PluginRegistry
 The registry for all loaded Equalizer plugins. More...
class  Pool
 An object allocation pool. More...
class  Referenced
 Base class for referenced objects. More...
class  RefPtr
 A smart reference pointer. More...
class  RequestHandler
 A thread-safe request handler. More...
class  RNG
 A random number generator. More...
class  ScopedMutex
 A scoped mutex. More...
class  SpinLock
 A fast lock for uncontended memory access. More...
class  Thread
 An utility class to execute code in a separate execution thread. More...
class  ThreadID
 An utility class to wrap OS-specific thread identifiers. More...
class  TimedLock
 A mutex with timeout capabilities. More...
class  uint128_t
 A base type for 128 bit unsigned integer values. More...
class  UUID
 Provides a universally unique identifier. More...

Functions

void memoryBarrier ()
 Perform a full memory barrier.
template<class T >
int32_t getIndexOfLastBit (T value)
template<>
int32_t getIndexOfLastBit< uint32_t > (uint32_t value)
template<>
int32_t getIndexOfLastBit< uint64_t > (uint64_t value)
COBASE_API void abort ()
 Used to trap into an infinite loop to allow debugging of assertions.
COBASE_API void checkHeap ()
 Check the consistency of the heap and abort on error (Win32 only).
COBASE_API std::ostream & sysError (std::ostream &os)
 Print a textual description of the current system error.
COBASE_API std::ostream & backtrace (std::ostream &os)
 Print the current call stack.
template<class T >
std::string className (T *object)
 Print the RTTI name of the given class.
COBASE_API std::ostream & operator<< (std::ostream &os, const Error &error)
 Print the error in a human-readable format.
COBASE_API Strings searchDirectory (const std::string &directory, const std::string &pattern)
 Retrieve a list of files in a directory matching a pattern.
COBASE_API std::string getFilename (const std::string &filename)
COBASE_API std::string getDirname (const std::string &filename)
COBASE_API bool init (const int argc, char **argv)
 Initialize the Equalizer base classes.
COBASE_API bool exit ()
 De-initialize the Equalizer base classes.
template<class D , class L >
std::ostream & operator<< (std::ostream &os, const Lockable< D, L > &l)
 Print the data to the given output stream.
COBASE_API std::ostream & indent (std::ostream &os)
 Increases the indentation level of the Log stream, causing subsequent lines to be intended by four characters.
COBASE_API std::ostream & exdent (std::ostream &os)
 Decrease the indent of the Log stream.
COBASE_API std::ostream & disableFlush (std::ostream &os)
 Disable flushing of the Log stream.
COBASE_API std::ostream & enableFlush (std::ostream &os)
 Re-enable flushing of the Log stream.
COBASE_API std::ostream & forceFlush (std::ostream &os)
 Flush the Log stream regardless of the auto-flush state.
COBASE_API std::ostream & disableHeader (std::ostream &os)
 Disable printing of the Log header for subsequent lines.
COBASE_API std::ostream & enableHeader (std::ostream &os)
 Re-enable printing of the Log header.
template<typename T >
std::ostream & operator<< (std::ostream &os, const Monitor< T > &monitor)
 Print the monitor to the given output stream.
template<class T >
void perThreadDelete (T *object)
 Default PerThread destructor deleting the object.
template<class T >
void perThreadNoDelete (T *object)
 Empty PerThread destructor.
template<class T >
std::ostream & operator<< (std::ostream &os, const RefPtr< T > &rp)
 Print the reference pointer to the given output stream.
template<class T >
std::string className (const RefPtr< T > &rp)
COBASE_API std::ostream & operator<< (std::ostream &, const RequestHandler &)
COBASE_API void sleep (const uint32_t milliSeconds)
 Sleep the current thread for a number of milliseconds.
std::ostream & operator<< (std::ostream &os, const Thread *thread)
 Print the thread to the given output stream.
COBASE_API std::ostream & operator<< (std::ostream &, const ThreadID &)
 Print the thread to the given output stream.
std::ostream & operator<< (std::ostream &os, const uint128_t &id)
 ostream operator for 128 bit unsigned integers.
uint128_t operator+ (const uint128_t &a, const uint64_t &b)
 Add a 64 bit value to a 128 bit value.
uint128_t operator- (const uint128_t &a, const uint64_t &b)
 Subtract a 64 bit value from a 128 bit value.
uint128_t operator& (const uint128_t &a, const uint128_t &b)
 Bitwise and operation on two 128 bit values.
uint128_t operator| (const uint128_t &a, const uint128_t &b)
 Bitwise or operation on two 128 bit values.

Typedefs

typedef Atomic< int32_t > a_int32_t
 An atomic 32 bit integer variable.
typedef Atomic< ssize_t > a_ssize_t
 An atomic signed size variable.
typedef Buffer< uint8_t > Bufferb
typedef Monitor< bool > Monitorb
 A boolean monitor variable.
typedef Monitor< uint32_t > Monitoru
 An unsigned 32bit integer monitor.
typedef ScopedMutex< SpinLock,
ReadOp > 
ScopedFastRead
 A scoped mutex for a fast uncontended read operation.
typedef ScopedMutex< SpinLock,
WriteOp > 
ScopedFastWrite
 A scoped mutex for a fast uncontended write operation.
typedef ScopedMutex< Lock, ReadOp > ScopedRead
 A scoped mutex for a read operation.
typedef ScopedMutex< Lock,
WriteOp > 
ScopedWrite
 A scoped mutex for a write operation.
typedef std::vector< std::string > Strings
 A vector of std::strings.
typedef Strings::const_iterator StringsCIter
typedef std::vector
< CompressorInfo > 
CompressorInfos
typedef std::vector< const
CompressorInfo * > 
CompressorInfoPtrs
typedef std::vector< Plugin * > Plugins

Enumerations

enum  Error { ERROR_NONE = 0, ERROR_CUSTOM = EQ_16KB }
 Defines errors produced by Collage base classes. More...
enum  LogLevel {
  LOG_ERROR = 1, LOG_WARN, LOG_INFO, LOG_VERB,
  LOG_ALL
}
 The logging levels. More...
enum  LogTopic { LOG_PLUGIN = 0x1, LOG_CUSTOM = 0x10, LOG_ANY = 0xffffu }
 The logging topics. More...

Detailed Description

Base abstraction layer and common utility classes.

The co::base namespace provides C++ classes to abstract the underlying operating system and implements common helper functionality. Classes with non-virtual destructors are not intended to be subclassed.


Function Documentation

COBASE_API std::ostream& co::base::backtrace ( std::ostream &  os)

Print the current call stack.

May not be implemented on all platforms.

Version:
1.0

Referenced by co::base::Referenced::ref().

+ Here is the caller graph for this function:

template<class T >
std::string co::base::className ( T *  object) [inline]

Print the RTTI name of the given class.

Version:
1.0

Definition at line 66 of file debug.h.

Referenced by co::WorkerThread< Q >::init(), and co::base::PerThread< T, D >::operator*().

+ Here is the caller graph for this function:

COBASE_API std::ostream& co::base::disableFlush ( std::ostream &  os)

Disable flushing of the Log stream.

Version:
1.0

Referenced by operator<<().

+ Here is the caller graph for this function:

COBASE_API std::ostream& co::base::disableHeader ( std::ostream &  os)

Disable printing of the Log header for subsequent lines.

Version:
1.0
COBASE_API std::ostream& co::base::enableFlush ( std::ostream &  os)

Re-enable flushing of the Log stream.

Version:
1.0

Referenced by operator<<().

+ Here is the caller graph for this function:

COBASE_API std::ostream& co::base::enableHeader ( std::ostream &  os)

Re-enable printing of the Log header.

Version:
1.0
COBASE_API std::ostream& co::base::exdent ( std::ostream &  os)

Decrease the indent of the Log stream.

Version:
1.0
COBASE_API bool co::base::exit ( )

De-initialize the Equalizer base classes.

Returns:
true if the library was successfully de-initialised, false otherwise.
Version:
1.0
COBASE_API std::ostream& co::base::forceFlush ( std::ostream &  os)

Flush the Log stream regardless of the auto-flush state.

Version:
1.0
COBASE_API std::string co::base::getDirname ( const std::string &  filename)
Returns:
the directory name part of a path.
Version:
1.0
COBASE_API std::string co::base::getFilename ( const std::string &  filename)
Returns:
the file name part of a path.
Version:
1.0
template<class T >
int32_t co::base::getIndexOfLastBit ( value)
Returns:
the position of the last (most significant) set bit, or -1.

Referenced by eqPly::Channel::frameAssemble(), eqPly::Channel::frameClear(), eqPly::Channel::frameDraw(), eqPly::Channel::frameViewFinish(), and eqPly::Channel::getJitter().

+ Here is the caller graph for this function:

COBASE_API std::ostream& co::base::indent ( std::ostream &  os)

Increases the indentation level of the Log stream, causing subsequent lines to be intended by four characters.

Version:
1.0
COBASE_API bool co::base::init ( const int  argc,
char **  argv 
) [inline]

Initialize the Equalizer base classes.

Parameters:
argcthe command line argument count.
argvthe command line argument values.
Returns:
true if the library was successfully initialised, false otherwise
Version:
1.0

Initialize the Equalizer base classes.

Parameters:
argcthe command line argument count.
argvthe command line argument values.
Returns:
true if the library was successfully initialised, false otherwise.

Definition at line 38 of file co/init.h.

void co::base::memoryBarrier ( ) [inline]

Perform a full memory barrier.

Definition at line 38 of file atomic.h.

Referenced by co::base::Atomic< T >::operator!=(), co::base::Atomic< T >::operator=(), co::base::Atomic< T >::operator==(), co::base::SpinLock::trySetRead(), and co::base::SpinLock::unsetRead().

+ Here is the caller graph for this function:

uint128_t co::base::operator& ( const uint128_t &  a,
const uint128_t &  b 
) [inline]

Bitwise and operation on two 128 bit values.

Version:
1.1.5

Definition at line 221 of file uint128_t.h.

References co::base::uint128_t::high(), and co::base::uint128_t::low().

+ Here is the call graph for this function:

uint128_t co::base::operator+ ( const uint128_t &  a,
const uint64_t &  b 
) [inline]

Add a 64 bit value to a 128 bit value.

Version:
1.0

Definition at line 201 of file uint128_t.h.

References co::base::uint128_t::high(), and co::base::uint128_t::low().

+ Here is the call graph for this function:

uint128_t co::base::operator- ( const uint128_t &  a,
const uint64_t &  b 
) [inline]

Subtract a 64 bit value from a 128 bit value.

Version:
1.0

Definition at line 211 of file uint128_t.h.

References co::base::uint128_t::high(), and co::base::uint128_t::low().

+ Here is the call graph for this function:

COBASE_API std::ostream& co::base::operator<< ( std::ostream &  os,
const Error &  error 
)

Print the error in a human-readable format.

Version:
1.0
COBASE_API std::ostream& co::base::operator<< ( std::ostream &  ,
const ThreadID &   
)

Print the thread to the given output stream.

template<class D , class L >
std::ostream& co::base::operator<< ( std::ostream &  os,
const Lockable< D, L > &  l 
) [inline]

Print the data to the given output stream.

Definition at line 69 of file lockable.h.

References disableFlush(), and enableFlush().

+ Here is the call graph for this function:

std::ostream& co::base::operator<< ( std::ostream &  os,
const Thread *  thread 
)

Print the thread to the given output stream.

template<class T >
std::ostream& co::base::operator<< ( std::ostream &  os,
const RefPtr< T > &  rp 
) [inline]

Print the reference pointer to the given output stream.

Definition at line 190 of file refPtr.h.

References disableFlush(), and enableFlush().

+ Here is the call graph for this function:

std::ostream& co::base::operator<< ( std::ostream &  os,
const uint128_t &  id 
) [inline]

ostream operator for 128 bit unsigned integers.

Version:
1.0

Definition at line 191 of file uint128_t.h.

template<typename T >
std::ostream& co::base::operator<< ( std::ostream &  os,
const Monitor< T > &  monitor 
) [inline]

Print the monitor to the given output stream.

Version:
1.0

Definition at line 315 of file monitor.h.

References co::base::Monitor< T >::get().

+ Here is the call graph for this function:

uint128_t co::base::operator| ( const uint128_t &  a,
const uint128_t &  b 
) [inline]

Bitwise or operation on two 128 bit values.

Version:
1.1.5

Definition at line 230 of file uint128_t.h.

References co::base::uint128_t::high(), and co::base::uint128_t::low().

+ Here is the call graph for this function:

template<class T >
void co::base::perThreadDelete ( T *  object)

Default PerThread destructor deleting the object.

Version:
1.1.2

Definition at line 33 of file perThread.h.

template<class T >
void co::base::perThreadNoDelete ( T *  object)

Empty PerThread destructor.

Version:
1.1.2

Definition at line 36 of file perThread.h.

COBASE_API Strings co::base::searchDirectory ( const std::string &  directory,
const std::string &  pattern 
)

Retrieve a list of files in a directory matching a pattern.

Only foo*bar pattern are implemented currently.

Returns:
all file names matching the given pattern in the given directory.
Version:
1.0
COBASE_API void co::base::sleep ( const uint32_t  milliSeconds)

Sleep the current thread for a number of milliseconds.

Version:
1.0

Referenced by eqAsync::AsyncFetcher::run().

+ Here is the caller graph for this function:

COBASE_API std::ostream& co::base::sysError ( std::ostream &  os)

Print a textual description of the current system error.

The current system error is OS-specific, e.g., errno or GetLastError().

Version:
1.0

Referenced by co::base::RNG::get(), and Tracker::init().

+ Here is the caller graph for this function:


Typedef Documentation

A scoped mutex for a fast uncontended read operation.

Version:
1.1.2

Definition at line 95 of file scopedMutex.h.

A scoped mutex for a fast uncontended write operation.

Version:
1.1.2

Definition at line 98 of file scopedMutex.h.

A scoped mutex for a read operation.

Version:
1.1.5

Definition at line 101 of file scopedMutex.h.

typedef ScopedMutex< Lock, WriteOp > co::base::ScopedWrite

A scoped mutex for a write operation.

Version:
1.1.5

Definition at line 104 of file scopedMutex.h.

typedef std::vector< std::string > co::base::Strings

A vector of std::strings.

Version:
1.0

Definition at line 132 of file co/base/types.h.


Enumeration Type Documentation

Defines errors produced by Collage base classes.

Definition at line 29 of file include/co/base/error.h.

The logging levels.

Version:
1.0
Enumerator:
LOG_ERROR 

Output critical errors.

LOG_WARN 

Output potentially critical warnings.

LOG_INFO 

Output informational messages.

LOG_VERB 

Be noisy.

Definition at line 46 of file co/base/log.h.

The logging topics.

See also:
net/log.h, client/log.h
Version:
1.0
Enumerator:
LOG_PLUGIN 

Plugin usage (1)

LOG_CUSTOM 

Log topics for other namespaces start here.

LOG_ANY 

Log all Equalizer topics.

Definition at line 61 of file co/base/log.h.

Generated on Fri Jun 8 2012 15:44:34 for Equalizer 1.2.1 by  doxygen 1.8.0