Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

mpcl::system::ISystem Class Reference

Base class for an operating system wrapper. More...

#include <system.hh>

Inheritance diagram for mpcl::system::ISystem:

mpcl::system::TSystem List of all members.

Public Types

enum  ELogLevel {
  eEmerg, eAlert, eCrit, eErr,
  eWarning, eNotice, eInfo, eDebug
}
enum  ELogFacility {
  eAuthPriv, eCron, eDaemon, eKern,
  eLocal0, eLocal1, eLocal2, eLocal3,
  eLocal4, eLocal5, eLocal6, eLocal7,
  eLpr, eMail, eNews, eUser,
  eUucp
}

Public Methods

virtual ~ISystem (void)
 Destroys the instance.

virtual TString getCurrentDirectory (void) const=0
virtual char getDirectorySeparator (void) const=0
virtual std::size_t getFileSize (const char *pkcFILE_NAME) const=0
virtual vector< TString > getPathItems (const string &rkySOURCE_PATH_COLLECTION) const
virtual char getPathSeparator (void) const=0
virtual int getProcessId (void) const=0
virtual void sleep (std::size_t zSECONDS, std::size_t zNANOSECONDS=0) const=0
virtual void writeLogEntry (const string &rkyMESSAGE, ELogLevel eLEVEL=eNotice, ELogFacility eFACILITY=eUser) const=0
virtual void yield (void) const=0

Detailed Description

Base class for an operating system wrapper.

Definition at line 48 of file system.hh.


Member Enumeration Documentation

enum mpcl::system::ISystem::ELogFacility
 

The facility is used to specify what type of program is logging the message. This lets the configuration file specify that messages from different facilities will be handled differently.

See also:
writeLogEntry().
Enumeration values:
eAuthPriv  Security/authorization messages (private).
eCron  Clock daemon (CRON and AT).
eDaemon  Other system daemons.
eKern  Kernel messages.
eLocal0  Reserved for local use.
eLocal1  Reserved for local use.
eLocal2  Reserved for local use.
eLocal3  Reserved for local use.
eLocal4  Reserved for local use.
eLocal5  Reserved for local use.
eLocal6  Reserved for local use.
eLocal7  Reserved for local use.
eLpr  Line printer subsystem.
eMail  Mail subsystem.
eNews  USENET news subsystem.
eUser  Generic user-level messages.
eUucp  UUCP subsystem.

Definition at line 76 of file system.hh.

enum mpcl::system::ISystem::ELogLevel
 

This determines the importance of the message. The levels are, in order of decreasing importance:

See also:
writeLogEntry().
Enumeration values:
eEmerg  The system is unusable.
eAlert  The action must be taken immediately.
eCrit  Critical conditions.
eErr  Error conditions.
eWarning  Warning conditions.
eNotice  A normal, but significant, condition.
eInfo  An informational message.
eDebug  A debug-level message.

Definition at line 58 of file system.hh.


Member Function Documentation

virtual TString mpcl::system::ISystem::getCurrentDirectory void    const [pure virtual]
 

Get current directory.

Returns:
Current directory.

Implemented in mpcl::system::TSystem.

virtual char mpcl::system::ISystem::getDirectorySeparator void    const [pure virtual]
 

Get symbol for directory separator.

Returns:
The directory separator.

Implemented in mpcl::system::TSystem.

Referenced by getPathItems().

virtual std::size_t mpcl::system::ISystem::getFileSize const char *    pkcFILE_NAME const [pure virtual]
 

Get file size.

Parameters:
pkcFILE_NAME  File name.
Returns:
Size of pkcFILE_NAME.

Implemented in mpcl::system::TSystem.

std::vector< mpcl::text::TString > mpcl::system::ISystem::getPathItems const string &    rkySOURCE_PATH_COLLECTION const [virtual]
 

Split a search path string into the path components. The components must be separated using the symbol returned by getPathSeparator(). Path items with zero length will be omitted. Returned paths will always be symbol terminated.

Parameters:
rkySOURCE_PATH_COLLECTION  String with symbol-separated paths.
Returns:
Vector with path items.
See also:
getPathSeparator().

Definition at line 101 of file system.cc.

References getDirectorySeparator(), getPathSeparator(), and mpcl::text::Split().

virtual char mpcl::system::ISystem::getPathSeparator void    const [pure virtual]
 

Get symbol for path separator.

Returns:
The path separator.

Implemented in mpcl::system::TSystem.

Referenced by getPathItems().

virtual int mpcl::system::ISystem::getProcessId void    const [pure virtual]
 

Gets an unique integer value that identifies the current process.

Returns:
The process identifier.

Implemented in mpcl::system::TSystem.

virtual void mpcl::system::ISystem::sleep std::size_t    zSECONDS,
std::size_t    zNANOSECONDS = 0
const [pure virtual]
 

Sleeps the process or thread zSECONDS seconds and zNANOSECONDS nanoseconds.

Parameters:
zSECONDS  Number of seconds to sleep.
zNANOSECONDS  Number of nanoseconds to sleep.

Implemented in mpcl::system::TSystem.

virtual void mpcl::system::ISystem::writeLogEntry const string &    rkyMESSAGE,
ELogLevel    eLEVEL = eNotice,
ELogFacility    eFACILITY = eUser
const [pure virtual]
 

Sends a message to the system logger.

Parameters:
rkyMESSAGE  Message to log. It is a format, as in std::printf(3) and any arguments required by the format, except that the two character m will be replaced by the error message string (std::strerror()) corresponding to the present value of std::errno.
eFACILITY  Log facility of the message.
eLEVEL  Log level of the message.
See also:
std::errno, std::printf(), std::strerror(), std::syslog().

virtual void mpcl::system::ISystem::yield void    const [pure virtual]
 

Yields yield the processor. A process can relinquish the processor voluntarily without blocking by calling yield(). The process will then be moved to the end of the queue for its static priority and a new process gets to run.

See also:
std::sched_yield().

Implemented in mpcl::system::TSystem.


The documentation for this class was generated from the following files:
Generated on Mon Oct 13 02:35:25 2003 for MPCL by doxygen1.2.18