Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

mcllib Namespace Reference

The mcllib namespace contains all public exported symbols for the General System Library. More...


Classes

class  MCBase
 Base class for most mcllib classes that manage resources. More...
class  MCBootstrap
class  MCByteRegion
 Byte Region Representation of a byte region. More...
class  MCCLSocket
 Base class for connecion-less sockets. More...
class  MCCondVar
 Classic condition variable. More...
class  MCCOSocket
 Base class for connection-oriented sockets. More...
class  MCCOUDPSocket
 Connection-oriented UDP Socket. More...
class  MCDictionary
 STL safe dictionary (map). More...
class  MCDir
 Representation of a directory. More...
class  MCDirEntry
 Representation of a directory entry. More...
class  MCDirEnum
 Representation of a directory enumeration, i.e. More...
struct  MCEqCase
 Class to do case insensitive comparisons using equal-to. More...
class  MCEvent
 Implementation of light-weight events. More...
class  MCEventListener
 Base class for event listeners. More...
class  MCExcept
 Base class for all library generated exceptions. More...
class  MCExceptFatal
 Fatal exceptions generated by the library are considered worthy of causing the application to terminate. More...
class  MCFile
 Representation of a file. More...
class  MCFileMutex
 File mutex object (NOT IMPLEMENTED). More...
class  MCFileSerializer
 A serializer (see MCSerializer) which serializes objects to a file. More...
class  MCGetOpt
 Class supporting simplified command line option processing. More...
class  MCGlobal
 Template to provide singletons. More...
class  MCIMgr
 Templatized run-time type-safe interface manager class. More...
class  MCIMgrBase
 Base class for templatized run-time type-safe interface manager class. More...
class  MCIniFile
 Implementation of an initialization file (ini file for short). More...
class  MCIniSection
 Implementation of an initialization section (ini section for short). More...
class  MCInitHelper
 Initialization helper class. More...
class  MCInMutex
 Representation of an in-process mutex object. More...
class  MCInterface
 Base class for all virtual interfaces allocated using new. More...
class  MCInterrupt
 Exception indicating an operation was interrupted. More...
class  MCIOBase
 Base class for all IO classes. More...
struct  MCLessCase
 Class to do case insensitive comparisons using less-than. More...
class  MCLibrary
 Representation of a dynamically loaded library. More...
class  MCLibrarySym
 Representation of a symbol obtained from a dynamically loaded library. More...
class  MCLock
 Provides automatic locking and unlocking based on scope. More...
class  MCLogFile
 Implementation of a log file. More...
class  MCMemSerializer
 A serializer (see MCSerializer) which serializes objects to a memory buffer. More...
class  MCMonitor
 A monitor is a re-entrant lock with a condition variable. More...
class  MCMsg
 A message contains a string, a code number and a level. More...
class  MCMutex
 Base class for all mutual exclusion primitives. More...
class  MCNetAddr
 Representation of a network address. More...
class  MCNonCopy
 Base class preventing copying of derived class. More...
class  MCProcess
 Representation of a process. More...
class  MCRecvFromResult
 Class to hold the return value of the MCSocket::recvFrom() method. More...
class  MCRefCount
 Base class for all reference counted objects. More...
class  MCRefCountAccessorBase
 Deriving from this class allows controlled manipulation of reference count objects. More...
class  MCRefCountAccessorTmpl
 Template to provide increment and decrement of a reference count using a particular threading model. More...
class  MCRefCountAccessorTmpl< MCThreadModel::THRMODELMULTI >
 Specialization of MCRefCountAccessorTmpl which increments and decrements the reference count in a thread safe manner. More...
class  MCRefCountAccessorTmpl< MCThreadModel::THRMODELSINGLE >
 Specialization of MCRefCountAccessorTmpl which increments and decrements the reference count in a thread unsafe manner. More...
class  MCRefCountGetter
 Convenience class to get reference count from object and store it away. More...
class  MCRefCountWrap
 Template class to put a MCRefCount wrapper around a class. More...
class  MCRefPtr
 Template class for managing reference counted pointers. More...
class  MCRefPtrAttacher
 Template class for attaching to a refcounted pointer without detaching on destruction. More...
class  MCRefPtrDetacher
 Template class for detaching from a refcounted pointer on destruction without attaching on construction. More...
class  MCRunnable
 Base class used to provide a method which a thread can run. More...
class  MCRWLock
 Scoped lock object for Readers/Writer mutex object. More...
class  MCRWMutex
 Representation of an readers/writer mutex object. More...
class  MCSemaphore
 Representation of a named counting semaphore. More...
class  MCSerializer
 Base class for serializers. More...
class  MCSingleton
class  MCSocket
 Socket base class. More...
class  MCSocketSerializer
 A serializer (see MCSerializer) which serializes objects to a socket. More...
class  MCSrcMsg
 A source message is an MCMsg with a file and line number. More...
class  MCStreamSocket
 Base class for connection-oriented stream sockets. More...
class  MCString
 Reference counted string. More...
class  MCStringStream
 Class which acts like stringstream but the results are obtainable as an MCString. More...
class  MCSystem
 Class which provides system (platform) related information. More...
class  MCTCPSocket
 TCP Socket. More...
class  MCTestMutex
 Base class for mutex objects which can be test locked. More...
class  MCThread
 Provides support for multiple concurrent threads of control in an application. More...
class  MCThreadData
 Provides a definition of thread private data. More...
class  MCThreadGlobal
 Template to provide per-thread singletons. More...
class  MCThreadJob
 Base class for thread pool jobs (see MCThreadPool). More...
class  MCThreadListener
 Thread event listener. More...
class  MCThreadModel
 Provides definition of thread models. More...
class  MCThreadPool
 Manages creation of threads and allocation of threads to jobs. More...
class  MCThreadSingleton
class  MCThreadSingleton::Inner
 wrapper class to wrap a pointer for use as a thread data item
class  MCThrowWrapper
 Wrapper class with a += operator that returns the exception type. More...
class  MCTime
 Utility class to help manage times. More...
class  MCTimeDelta
 Utility class representing time deltas (differences between two times). More...
class  MCTimedOut
 Exception indicating that an operation timed out. More...
class  MCTimer
 Milli-second timer. More...
struct  MCTypeTraits
 Template for type traits. More...
struct  MCTypeTraits< bool >
 Type traits for bool type. More...
class  MCTypeTraits< mcfloat32 >
 Type traits for mcfloat32 type. More...
class  MCTypeTraits< mcfloat64 >
 Type traits for mcfloat64 type. More...
class  MCTypeTraits< mcint16 >
 Type traits for mcint16 type. More...
class  MCTypeTraits< mcint32 >
 Type traits for mcint32 type. More...
class  MCTypeTraits< mcint64 >
 Type traits for mcint64 type. More...
class  MCTypeTraits< mcint8 >
 Type traits for mcint8 type. More...
struct  MCTypeTraits< mcllib::mcfloat32 >
struct  MCTypeTraits< mcllib::mcfloat64 >
struct  MCTypeTraits< mcllib::mcint16 >
struct  MCTypeTraits< mcllib::mcint32 >
struct  MCTypeTraits< mcllib::mcint64 >
struct  MCTypeTraits< mcllib::mcint8 >
struct  MCTypeTraits< mcllib::mcuint16 >
struct  MCTypeTraits< mcllib::mcuint32 >
struct  MCTypeTraits< mcllib::mcuint64 >
struct  MCTypeTraits< mcllib::mcuint8 >
class  MCTypeTraits< mcuint16 >
 Type traits for mcuint16 type. More...
class  MCTypeTraits< mcuint32 >
 Type traits for mcuint32 type. More...
class  MCTypeTraits< mcuint64 >
 Type traits for mcuint64 type. More...
class  MCTypeTraits< mcuint8 >
 Type traits for mcuint8 type. More...
class  MCUDPSocket
 Connection-less UDP Socket. More...
class  MCVariantType
 Base class for all variant data types. More...
class  MCVTBool
 A Boolean value. More...
class  MCVTFloat32
 32-bit float. More...
class  MCVTFloat64
 64-bit float. More...
class  MCVTInt16
 16-bit signed integer variant type. More...
class  MCVTInt32
 32-bit signed integer variant type. More...
class  MCVTInt64
 64-bit signed integer variant type. More...
class  MCVTInt8
 8-bit signed integer variant type. More...
class  MCVTNumeric
 Base class for numeric variant types (ints and floats). More...
class  MCVTNumericFloat
 Base class for floating point numeric variant types. More...
class  MCVTNumericInt
 Base class for integer numeric variant types. More...
class  MCVTString
 MCString variant type. More...
class  MCVTUInt16
 16-bit unsigned integer variant type. More...
class  MCVTUInt32
 32-bit unsigned integer variant type. More...
class  MCVTUInt64
 64-bit unsigned integer variant type. More...
class  MCVTUInt8
 8-bit unsigned integer variant type. More...
class  MCWaitNotify
 Base class for all wait/notify type objects. More...
class  MCWaitNotifyAll
 An waitnotify which allows multiple waiters to be awoken simultaneously. More...

Typedefs

typedef mcint32 mcatomic_t
 atomic counter type (AtomicIncrement etc.) use this type
typedef float mcfloat32
 32-bit float
typedef PRFloat64 mcfloat64
 64-bit float
typedef mcuint64 MCIID
 Interface Identifier.
typedef PRInt16 mcint16
 16-bit signed integer
typedef PRInt32 mcint32
 32-bit signed integer
typedef PRInt64 mcint64
 64-bit signed integer
typedef PRInt8 mcint8
 8-bit signed integer
typedef mcuint32 mcinterval_t
 Time interval type (in milliseconds).
typedef PRIntn mcintn
 integer which is at least 16 bits but could be more
typedef MCRefCountAccessorTmpl<
MCThreadModel::THRMODELMULTI > 
MCRefCountAccessor
 Default reference count accessor using the multi-threaded model.
typedef mcuint32 mcstacksize_t
 Size of stack type.
typedef mcuint32 mcthreaddatakey_t
 Thread data key.
typedef void * mcthreadid_t
 Thread identifier.
typedef mcint64 mctime_t
 Time type.
typedef PRUint16 mcuint16
 16-bit unsigned integer
typedef PRUint32 mcuint32
 32-bit unsigned integer
typedef PRUint64 mcuint64
 64-bit unsigned integer
typedef PRUint8 mcuint8
 8-bit unsigned integer

Enumerations

enum  MCEAddrType { MCAFRAW, MCAFINET, MCAFINETV6, MCAFPATH }
 Address type (or family). More...

Functions

bool MCConfigExists (const MCString &sectionName, const MCString &key)
 Return true if the section and key exist in the system config file Determine whether a section and key exists in the system configuration file.
bool MCConfigExists (const MCString &sectionName)
 Determine whether a section exists in the system configuration file.
bool MCConfigExists ()
 Determine whether the system configuration file exists.
MCString MCConfigExpand (const MCString &str)
 Expand a string which may contain variable references.
MCString MCConfigGet (const MCString &sectionName, const MCString &key)
 Get the value for a section/key pair.
bool MCConfigGetBool (const MCString &sectionName, const MCString &key, bool defValue)
 Get the section/key as a bool value.
mcint32 MCConfigGetInt (const MCString &sectionName, const MCString &key, const mcint32 minValue, const mcint32 maxValue, const mcint32 defValue)
 Get the section/key as an int constrained within a range.
MCThrowWrapper< mcllib::MCExceptMCExceptMaker (const char *msg, const char *file, int line)
 Create an MCExcept from a string and a file/line pair.
template<typename MCEXT>
MCThrowWrapper< MCEXT > MCExceptMaker (const MCEXT &ex, const char *file, int line)
 Create an MCThrowWrapper (derived from MCEXT which in turn is derived from MCExcept) with a file/line pair.
MCNetAddr MCGetInetAddr (const MCString &name, mcuint16 port=MCAnyPort)
 Get a specific port on a specific host.
MCNetAddr MCGetInetAddrAny (mcuint16 port=MCAnyPort)
 Get a specific port on all current and future ip address on the host.
MCNetAddr MCGetPathAddr (const MCString &path)
 Get a path address.
void MCInit ()
void MCLog (MCMsg::msglevel_t lvl)
 Set the system log output level.
void MCLog (const MCMsg &msg)
 Log a message to the system log at the default level.
void MCLog (MCMsg::msglevel_t lvl, const char *fmt,...)
 Log to the system log at the specific level using printf semantics.
void MCLog (const char *fmt,...)
 Log to the system log at the default level using printf semantics.
void MCLogExcept (const std::exception &ex)
 Log an exception.
void MCLogTo (const MCString &fileName)
 Set the system log output file to a file name.
void MCLogTo (MCFile::EStdHandle hdl)
 Set the system log output file to a standard handle.
mcintn mcprint (MCFile::EStdHandle hdl, const char *fmt,...)
 fprintf to the standard handle with a new-line at the end
mcintn mcprintf (MCFile::EStdHandle hdl, const char *fmt,...)
 fprintf to the standard handle
mcintn mcprintf (const char *fmt,...)
 printf to stdout
template<typename T>
void MCSingletonMaker (T *)
 Ensure a singleton has been constructed.
MCString mcsprintf (const char *fmt,...)
 Sprintf to produce an MCString.
template<typename T>
void MCThreadSingletonMaker (T *, const MCString &key)
 Ensure a thread singleton has been constructed.
mcintn mcvprint (MCFile::EStdHandle hdl, const char *fmt, va_list ap)
 vfprintf to the standard handle with a new-line at the end
mcintn mcvprintf (MCFile::EStdHandle hdl, const char *fmt, va_list ap)
 vfprintf to the standard handle
mcintn mcvprintf (const char *fmt, va_list ap)
 vprintf to stdout
MCString mcvsprintf (const char *fmt, va_list ap)
 VSprintf to produce an MCString.

Variables

const mcuint16 MCAnyPort
 Any port.
MCEvent::MCEventId MCEV_POSTREMOVELISTENER
 The last listener has been removed for an event.
MCEvent::MCEventId MCEV_PREADDLISTENER
 The first listener is about to be added for an event.
MCEvent::MCEventId MCEV_TERMINATE
 The terminate event delivered asynchronously by the OS when it wants the application to terminate.
MCEvent::MCEventId MCEV_THREADEXITLISTENER
 A thread has exited.
MCEvent::MCEventId MCEV_THREADSTARTLISTENER
 A thread has been started.
const mcinterval_t MCIntervalInfinite
 Constant specifying an infinite interval (wait forever).
const mcinterval_t MCIntervalMax
 Constant specifying the maximum (finite) interval.
const mcinterval_t MCIntervalNone
 Constant specifying no interval (don't wait).


Detailed Description

The mcllib namespace contains all public exported symbols for the General System Library.

Typedef Documentation

typedef mcuint32 mcinterval_t
 

Time interval type (in milliseconds).

Can be used to represent intervals of around 24 days


Enumeration Type Documentation

enum MCEAddrType
 

Address type (or family).

Enumeration values:
MCAFRAW  Raw address.
MCAFINET  IP address.
MCAFINETV6  IPV6 address.
MCAFPATH  Filesystem path address (for example UNIX domain socket).


Function Documentation

bool MCConfigExists const MCString &  sectionName,
const MCString &  key
 

Return true if the section and key exist in the system config file Determine whether a section and key exists in the system configuration file.

Parameters:
sectionName the section to test
key the key within the section to test for existence
Returns:
true if the key exists within the section in the system configuration file

bool MCConfigExists const MCString &  sectionName  ) 
 

Determine whether a section exists in the system configuration file.

Parameters:
sectionName the section to test for existence
Returns:
true if the section exists in the system configuration file

bool MCConfigExists  ) 
 

Determine whether the system configuration file exists.

Returns:
true if the system configuration file exists

MCString MCConfigExpand const MCString &  str  ) 
 

Expand a string which may contain variable references.

Parameters:
str the string to expand
Returns:
the string with variable references replaced by their value obtained from the system configuration file

MCString MCConfigGet const MCString &  sectionName,
const MCString &  key
 

Get the value for a section/key pair.

Parameters:
sectionName the section name
key the key within the section to obtain
Returns:
the value of the key within the section in the system configuration file

bool MCConfigGetBool const MCString &  sectionName,
const MCString &  key,
bool  defValue
 

Get the section/key as a bool value.

Parameters:
sectionName the section name
key the key within the section to obtain
defValue the default value. If the section/key pair does not exist in the system configuration file, this value is returned.
Returns:
the bool value of the key within the section in the system configuration file or the default value if the section/key pair does not exist

mcint32 MCConfigGetInt const MCString &  sectionName,
const MCString &  key,
const mcint32  minValue,
const mcint32  maxValue,
const mcint32  defValue
 

Get the section/key as an int constrained within a range.

in the range min to max.

Parameters:
sectionName the section name
key the key within the section to obtain
minValue the minimum permissible value of the result. If the section/key pair denotes a value less than minValue, this value is returned
maxValue the maximum permissible value of the result. If the section/key pair denotes a value greater than maxValue, this value is returned
defValue the default value. If the section/key pair does not exist in the system configuration file, this value is returned.
Returns:
the int value of the key within the section in the system configuration file according to the specified rules above

MCThrowWrapper<MCEXT> MCExceptMaker const MCEXT &  ex,
const char *  file,
int  line
 

Create an MCThrowWrapper (derived from MCEXT which in turn is derived from MCExcept) with a file/line pair.

Wrapper supports += with a MCStringStream which returns the type MCEXT.

MCNetAddr MCGetInetAddr const MCString &  name,
mcuint16  port = MCAnyPort
 

Get a specific port on a specific host.

Parameters:
name the host for which a network address is required
port the port on the host for which an network address is required
Returns:
a network address representing the requested host and port

MCNetAddr MCGetInetAddrAny mcuint16  port = MCAnyPort  ) 
 

Get a specific port on all current and future ip address on the host.

Parameters:
port the port on the host for which an network address is required
Returns:
a network address representing the requested port

MCNetAddr MCGetPathAddr const MCString &  path  ) 
 

Get a path address.

For UNIX domain socket this is equivalent to AF_UNIX.

Parameters:
path the path to obtain an address for
Returns:
a network address representing the requested path

void MCLog MCMsg::msglevel_t  lvl  ) 
 

Set the system log output level.

This dictates which system log message will be directed to the system log

void MCLogExcept const std::exception &  ex  ) 
 

Log an exception.

If the exception is an MCExcept derived class the log function calls getMsg() to get a source message which contains the file and line in the library where the exception is generated. In this case the log will contain these extra details. For this to work properly, run-time type information (RTTI) needs to be enabled in the compiler. The standard makefile(s) does this.

void MCThreadSingletonMaker T *  ,
const MCString &  key
 

Ensure a thread singleton has been constructed.

Note can only have one thread singleton of a given type (irrespective of the KEY that it used). The key must also be unique to prevent thread singletons of different types from clashing. It is recommended that the following form be used for key names - key.domain (e.g. key.my.com). Do not use the domain miba.co.uk.


Variable Documentation

const mcuint16 MCAnyPort
 

Any port.

When provided as the port argument to methods which require a port, it indicates that the operating system should use the next avaiable port.

MCEvent::MCEventId MCEV_POSTREMOVELISTENER
 

The last listener has been removed for an event.

This event is generated after the last listener has been removed. Event data contains the event id of the event being listened on.

MCEvent::MCEventId MCEV_PREADDLISTENER
 

The first listener is about to be added for an event.

This event is generated before the first listener has been added. Event data contains the event id of the event being listened on.

MCEvent::MCEventId MCEV_THREADEXITLISTENER
 

A thread has exited.

This event is generated after the MCRunnable::run() method of the thread's runnable has returned. Thread state may not be available.

MCEvent::MCEventId MCEV_THREADSTARTLISTENER
 

A thread has been started.

This event is generated after the thread has been started but before the MCRunnable::run() method of the thread's runnable has been called.


Generated on Wed Jan 12 19:05:49 2005 for MCLLIB by  doxygen 1.3.9.1