Back to index

salome-kernel  6.5.0
Classes | Namespaces | Defines | Enumerations | Functions
Basics_Utils.hxx File Reference
#include "SALOME_Basics.hxx"
#include <string>
#include <iostream>
#include <sys/time.h>
#include <sstream>
#include <stdlib.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

protocol  Kernel_Utils::BASICS_EXPORT

Namespaces

namespace  Kernel_Utils

Defines

#define START_TIMING(name)
#define END_TIMING(name, NUMBER)
#define STDLOG(msg)   {std::cerr<<std::flush<<__FILE__<<" ["<<__LINE__<<"] : "<<msg<<std::endl<<std::flush;}
#define LOG   STDLOG

Enumerations

enum  Kernel_Utils::GUIDtype { Kernel_Utils::DefUserID = 1, Kernel_Utils::ObjectdID }
 GUID type. More...

Functions

std::string Kernel_Utils::GetHostname ()
std::string Kernel_Utils::GetGUID (GUIDtype)
 Get predefined GUID.
void Kernel_Utils::print_traceback ()
template<class T >
std::string ToString (const T &arg)
template<class T >
double ToDouble (const T &arg)

Define Documentation

#define END_TIMING (   name,
  NUMBER 
)
Value:
name##tcount=name##tcount+1;gettimeofday(&name##tv,0); \
                                name##cumul=name##cumul+name##tv.tv_usec+name##tv.tv_sec*1000000 -name##tt0; \
                                if(name##tcount==NUMBER){ \
                                  std::cerr <<__FILE__<<":"<<__LINE__<<":"<<#name<<" temps CPU(mus): "<< name##cumul<<std::endl; \
                                  name##tcount=0;name##cumul=0;}

Definition at line 78 of file Basics_Utils.hxx.

#define LOG   STDLOG

Definition at line 131 of file Basics_Utils.hxx.

#define START_TIMING (   name)
Value:
static long name##tcount=0;static long name##cumul;long name##tt0; timeval name##tv; gettimeofday(&name##tv,0); \
                           name##tt0=name##tv.tv_usec+name##tv.tv_sec*1000000; \
                           if(name##tcount==0)std::cerr<<__FILE__<<":"<<__LINE__<<":"<<#name<<std::endl;

Definition at line 74 of file Basics_Utils.hxx.

#define STDLOG (   msg)    {std::cerr<<std::flush<<__FILE__<<" ["<<__LINE__<<"] : "<<msg<<std::endl<<std::flush;}

Definition at line 127 of file Basics_Utils.hxx.


Function Documentation

template<class T >
double ToDouble ( const T &  arg)

Definition at line 115 of file Basics_Utils.hxx.

                              {
  std::stringstream out;
  out << arg;
  double value = atof(out.str().c_str());
  return value;
}
template<class T >
std::string ToString ( const T &  arg)

Definition at line 107 of file Basics_Utils.hxx.

{
  std::stringstream out;
  out << arg;
  return(out.str());
}