nidas  v1.2-1520
Classes | Namespaces | Macros | Functions
UTime.h File Reference
#include <sys/types.h>
#include <sys/time.h>
#include <ctime>
#include <iostream>
#include <cctype>
#include <cmath>
#include <climits>
#include <locale>
#include <string>
#include "ThreadSupport.h"
#include "ParseException.h"
#include "time_constants.h"
#include "IOException.h"

Go to the source code of this file.

Classes

class  nidas::util::UTime
 A class for parsing, formatting and doing operations on time, based on Unix time conventions, where leap seconds are ignored, so that there are always 60 seconds in a minute, 3600 seconds in an hour and 86400 seconds in a day. More...
 
class  nidas::util::UTime_stream_manip< charT >
 class for changing output format of UTime on ostream, in a way like the standard stream manipulator classes. More...
 

Namespaces

 nidas
 Root namespace for the NCAR In-Situ Data Acquisition Software.
 
 nidas::util
 General utility classes. nidas::util contains classes of general utility, like Socket, Thread, etc. The classes use only the standard Unix system libraries and libstdc++, and have no dependency on other external packages such as an XML parser, or a logging package.
 

Macros

#define UTIME_BASIC_STREAM_IO
 If UTIME_BASIC_STREAM_IO is defined, then the UTime class supports output to the std::basic_ostream<charT> template class. More...
 

Functions

template<typename charT >
std::basic_ostream< charT,
std::char_traits< charT > > & 
nidas::util::operator<< (std::basic_ostream< charT, std::char_traits< charT > > &os, const UTime &x)
 
template<typename charT >
std::basic_ostream< charT,
std::char_traits< charT > > & 
nidas::util::operator<< (std::basic_ostream< charT, std::char_traits< charT > > &os, const UTime_stream_manip< charT > &m)
 
template<typename charT >
UTime_stream_manip< charT > nidas::util::setDefaultFormat (const std::string &val)
 Function to set the default UTime output format on an ostream. More...
 
template<typename charT >
UTime_stream_manip< charT > nidas::util::setTZ (const std::string &val)
 Function to set the UTime timezone on an ostream. More...
 
long long nidas::util::getSystemTime ()
 Return the current unix system time, in microseconds since Jan 1, 1970, 00:00 GMT. More...
 
long long nidas::util::timeCeiling (long long t, long long delta)
 Return smallest time that is an integral multiple of delta, that isn't less than or equal to argument t. More...
 
long long nidas::util::timeFloor (long long t, long long delta)
 Return largest time that is an integral multiple of delta, that isn't greater than argument t. More...
 
bool nidas::util::sleepUntil (unsigned int periodMsec, unsigned int offsetMsec=0) throw (IOException)
 Utility function, sleeps until the next even period + offset. More...
 

Macro Definition Documentation

#define UTIME_BASIC_STREAM_IO

If UTIME_BASIC_STREAM_IO is defined, then the UTime class supports output to the std::basic_ostream<charT> template class.

If it is not defined, then UTime only supports output to std::ostream, which is std::basic_ostream<char>. The general support for basic_ostream<charT> would only be useful if we want to support wide character output, which is not likely, but hey, we'll leave the code in for now.