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

more::sys Namespace Reference

Miscellaneous interfaces to the system. More...

Compounds

Typedefs

Enumerations

Functions


Detailed Description

Miscellaneous interfaces to the system.

Here are only interfaces which does not fit in any other categories (in particular flow and io).


Typedef Documentation

typedef double more::sys::time_t
 

A floating point type used to represent time.

Some philosopies regards time as a discrete sequence of moments. A more common view is that time is continuous.

Precision. Assume this is a 64 bits double with a 53 bits mantissa. If we use 33 bits for the year, 2↑33 s ≃ 272 y, i.e. in year 2242 there is still 20 bits left for subsecond precision down to 2^(-20) s = 0.95 μs. For relative time within 12 days ≃ 2↑20 s the precision is about 0.1 ns, but at the moment the OS calls limit the precision to 1 μs.


Enumeration Type Documentation

enum more::sys::cfg_t
 

Enumeration values:
cfg_PREFIX 
cfg_EXEC_PREFIX 
cfg_BINDIR 
cfg_SBINDIR 
cfg_LIBEXECDIR 
cfg_DATADIR 
cfg_SYSCONFDIR 
cfg_SHAREDSTATEDIR 
cfg_LOCALSTATEDIR 
cfg_LIBDIR 
cfg_INCLUDEDIR 
cfg_LIBTOOL 
cfg_CC 
cfg_CPP 
cfg_CXX 
cfg_CXXCPP 
cfg_CCLD 
cfg_CXXLD 
cfg_INSTALL 
cfg_INSTALL_DATA 
cfg_INSTALL_PROGRAM 
cfg_end 


Function Documentation

char const* c_str std::string const &    s [inline]
 

char const* c_str char const *    s [inline]
 

time_t current_time time_t const &    t_ref
 

Return the current real-world time relative to t_ref.

By supplying a reference point close to the current time, time differences may be calculated with better precision then when using Epoch times. (At the moment the precision is most likely limited by the OS call, though.)

time_t current_time  
 

The current real-world time.

More precisely, the time difference in seconds between present and Epoch (1970-01-01 00:00:00 UTC). If the gettimeofday is available on your system, the returned time will have 1 μs precision, otherwise it will have 1 s precision.

char const* getcfg cfg_t   
 

void print_time_nicely std::ostream &    out,
double    t
 

time_t process_time  
 

Return the processor time spent in this process.

If getrusage is not available clock(), which may overflow, is used.

void setcfg cfg_t   ,
char const *   
 

void sleep double   
 

Sleep for the given time.

If nanosleep is available on the system, the precision may be down to ns, else if setitimer is available, the precision may be down to μs, otherwise the precision is down to s, but in any case the precision is limited by the scheduler.

template<typename Iterator>
int system std::string    prgname,
Iterator    args_beg,
Iterator    args_end,
io::redirection const &    redir = io::redirection()
[inline]
 

Executes a program prgname with arguments given by the iterator range.

The value type of the Iterator type must be std::string or char const*. If prgname does not contain a '/', the program is search for in an OS dependent way (e.g. using $PATH on Unix). For secure applications, use absolute path names (starting with '/') if possible. The program name shall not be included in the argument list.

int system char const *const *    argv,
io::redirection const &    redir
 

Executes the program in argv[0] with arguments from the remaining of the null-terminated array.

Check out the overloads with more arguments for a higher level iterface.

int system std::string   
 

Executes a system specific interpreted command.

Be careful if you use in a secure program, as the string is interpreted by the shell. Better, use one of the other overloads of this name if you don't need the shell-functionality.


Generated on Sat Sep 7 19:13:13 2002 for more with Doxygen 1.2.13.1. Doxygen 1.2.13.1 is written and copyright 1997-2002 by Dimitri van Heesch.