CeylanSystem.h File Reference

#include "CeylanTypes.h"
#include "CeylanException.h"
#include "CeylanFeatures.h"
#include <ctime>
#include <string>
#include <iosfwd>
#include <map>

Include dependency graph for CeylanSystem.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Classes

class  Ceylan::System::SystemException
 Exception raised when system operation fails. More...
class  Ceylan::System::IOException
 Exception raised when basic input/output operation fails. More...

Namespaces

namespace  Ceylan
 This part of the Ceylan namespace gathers some convenient string manipulation facilities to be widely used.
namespace  Ceylan::System
 General system calls and properties.

Typedefs

typedef size_t Ceylan::System::Size
 Unsigned size, in bytes, for example for file operations.
typedef long Ceylan::System::Position
 Unsigned position, in bytes, for example for file operations.
typedef ssize_t Ceylan::System::SignedSize
 Signed size, in bytes, for example for file operations.
typedef Uint32 Ceylan::System::Second
 Records seconds, even for long periods of time (more than a century).
typedef Uint32 Ceylan::System::Millisecond
 Records milliseconds, which last 10^3 second.
typedef Uint32 Ceylan::System::Microsecond
 Records microseconds, which last 10^6 second.
typedef Uint32 Ceylan::System::Nanosecond
 Records nanoseconds, which last 10^9 second.
typedef int Ceylan::System::FileDescriptor
 UNIX File descriptor type, they have to be transformed into the StreamID datatype to comply with the Stream interface.
typedef int Ceylan::System::ErrorCode
 Error number as defined by errno.
typedef int Ceylan::System::InterruptMask
 Masks describing which interrupts are enabled.
typedef void(* Ceylan::System::IRQHandler )(void)
 Signature of an interrupt handler.

Functions

CEYLAN_DLL ErrorCode Ceylan::System::getError ()
 Returns the error ID (errno).
CEYLAN_DLL std::string Ceylan::System::explainError (ErrorCode errorID)
 Returns the diagnosis string corresponding to errorID (errno).
CEYLAN_DLL std::string Ceylan::System::explainError ()
 Returns the diagnosis string corresponding to current error ID (errno).
CEYLAN_DLL std::string Ceylan::System::getShellName ()
 Returns the name of the default shell, if found, otherwise returns an empty string.
CEYLAN_DLL void Ceylan::System::InitializeInterrupts (bool force=false)
 On platforms requiring it (ex: the Nintendo DS), initializes the interrupt system by using a default handler.
CEYLAN_DLL InterruptMask Ceylan::System::SetEnabledInterrupts (InterruptMask newMask=AllInterruptsDisabled)
 On platforms supporting it (ex: the Nintendo DS on the ARM9), sets the current set of interrupts enabled.
CEYLAN_DLL void Ceylan::System::InitializeIPC ()
 On platforms requiring it (ex: the Nintendo DS), initializes the IPC system (Inter-Process Communication), by setting up the FIFO infrastructure (creation and activation).
template<typename T >
T * Ceylan::System::ConvertToNonCacheable (T *sourceAddress)
 Converts specified address, expected to be in main RAM, into a mirrored address in the non-cacheable RAM mirror.
CEYLAN_DLL Ceylan::ByteCeylan::System::CacheProtectedNew (Size numberOfBytes)
 Reserves the specified size of memory so that it is compliant with the Nintendo DS ARM9 data cache, i.e.
CEYLAN_DLL void Ceylan::System::CacheProtectedDelete (Ceylan::Byte *cacheProtectedBuffer)
 Deallocates the specified cache-protected buffer.
CEYLAN_DLL bool Ceylan::System::HasAvailableData (FileDescriptor fd)
 Tells whether there is data available on specified file descriptor.
CEYLAN_DLL Size Ceylan::System::FDRead (FileDescriptor fd, Ceylan::Byte *dataBuffer, Size toReadBytesNumber)
 Reads from fd stream to dataBuffer toReadBytesNumber bytes.
CEYLAN_DLL Size Ceylan::System::FDWrite (FileDescriptor fd, const Ceylan::Byte *dataBuffer, Size toWriteBytesNumber)
 Writes to fd stream from dataBuffer toWriteBytesNumber bytes.
CEYLAN_DLL Second Ceylan::System::getTime ()
 Returns the current time since the Epoch (00:00:00 UTC, January 1, 1970), measured in seconds.
CEYLAN_DLL std::string Ceylan::System::timeToString (const time_t &t)
 Converts the time moment into a human readable string.
CEYLAN_DLL std::string Ceylan::System::durationToString (Second startingSecond, Microsecond startingMicrosecond, Second stoppingSecond, Microsecond stoppingMicrosecond)
CEYLAN_DLL Microsecond Ceylan::System::getDurationBetween (Second startingSecond, Microsecond startingMicrosecond, Second stoppingSecond, Microsecond stoppingMicrosecond)
 Returns the duration, in microseconds, between the two specified times, i.e.
CEYLAN_DLL void Ceylan::System::getPreciseTime (Second &seconds, Microsecond &microsec)
 Returns the time since the Epoch (00:00:00 UTC, January 1, 1970), with up to a one microsecond accuracy, expressed as a pair containing the number of seconds and the number of microseconds elapsed.
CEYLAN_DLL Microsecond Ceylan::System::getAccuracyOfPreciseTime (Microsecond *minGap=0, Microsecond *maxGap=0)
 Returns the mean runtime-computed actual accuracy if the precise time measurement, expressed in microseconds.
CEYLAN_DLL Microsecond Ceylan::System::getPreciseTimeCallDuration ()
 Returns the mean duration of a call to getPreciseTime.
CEYLAN_DLL void Ceylan::System::sleepForSeconds (Second secondCount)
 Sleeps for the specified number of seconds.
CEYLAN_DLL bool Ceylan::System::areSubSecondSleepsAvailable ()
 Tells whether sub-second sleeps can be performed.
CEYLAN_DLL void Ceylan::System::atomicSleep ()
 Makes the process sleep for a quite small duration, which is probably the smallest possible duration on the system, scheduler-wise, i.e.
CEYLAN_DLL void Ceylan::System::basicSleep (Second secondCount, Nanosecond nanoCount)
 Makes the process basically sleep for (at least) specified duration.
CEYLAN_DLL void Ceylan::System::basicSleep (Microsecond micros)
 Makes the process basically sleep for (at least) specified duration.
CEYLAN_DLL bool Ceylan::System::smartSleep (Second secondCount, Microsecond microCount)
 Makes the process smartly sleep for the specified duration.
CEYLAN_DLL bool Ceylan::System::smartSleepUntil (Second secondCount, Microsecond microCount)
 Makes the process smartly sleep until the specified time arrives.
CEYLAN_DLL Microsecond Ceylan::System::getActualDurationForSleep (Microsecond requestedMicroseconds, Second requestedSeconds=0)
 Sleeps, and returns the actual sleeping time corresponding to the requested sleeping time, expressed in seconds and microseconds.
CEYLAN_DLL Microsecond Ceylan::System::getSchedulingGranularity ()
 Returns the run-time computed scheduling granularity of the time slice enforced by the operating system.
CEYLAN_DLL bool Ceylan::System::setLegacyStreamSynchronization (bool synchronized)
 Sets whether the C++ standard streams (cin, cout, cerr, clog, and their wide-character counterparts) should be synchronized with their C-stream counterparts (this is the default situation).

Variables

CEYLAN_DLL const InterruptMask Ceylan::System::AllInterruptsDisabled = 0
 To specify that all interrupts are to disabled (null value).
CEYLAN_DLL const Second Ceylan::System::MaximumDurationWithMicrosecondAccuracy = 4100
 The maximum number of seconds for durations to be evaluated with a microsecond accuracy, before an overflow may occur.


Generated on Thu Jun 4 20:39:55 2009 for Ceylan by  doxygen 1.5.8