Changeset 895 in Sophya for trunk/SophyaLib/SysTools


Ignore:
Timestamp:
Apr 12, 2000, 7:49:54 PM (25 years ago)
Author:
ansari
Message:

Documentation de fichiers - Reza 12/4/2000

Location:
trunk/SophyaLib/SysTools
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/SysTools/ctimer.cc

    r241 r895  
    11//
    2 // $Id: ctimer.cc,v 1.2 1999-04-21 13:11:59 ansari Exp $
     2// $Id: ctimer.cc,v 1.3 2000-04-12 17:49:40 ansari Exp $
    33//
    44
     
    88//++
    99// Class        Timer
    10 // Lib          Outils++
     10// Lib          SysTools
    1111// include      ctimer.h
    1212//
     
    3737//--
    3838
     39/*!
     40  \class SOPHYA::Timer
     41  This class implements a simple chronometer which can be used for
     42  measuring the CPU and elapsed time in functions. The constructor
     43  keeps the start time (and CPU time) and an optional message.
     44  The \b Split method displays the partial time, and destructor
     45  displays the total CPU and elapsed time since timer creation.
     46  The macro \b  TIMEF create a timer object with the function name.
     47  The macro \b  SPLITTIME calls the split methode for the timer created
     48  by TIMEF. A named timer can be created using the macro \b TIMEN(nom)
     49*/
     50
     51/*! Constructor with the specification of a optional name or message */
    3952Timer::Timer(const char* name)
    4053: timerName(name)
     
    5366//--
    5467
    55 
     68/*! Method which displays the partial CPU and elapsed time
     69    An optional message can be passed to be used instead of the
     70    timer name
     71*/
    5672void Timer::Split(const char* comm)
    5773{
     
    6581  int etmt = elapse - elapse0;
    6682
    67   cout << "***Timing " << (comm ? comm : timerName) << endl;
     83  cout << "***Timing " << (comm ? comm : timerName.c_str()) << endl;
    6884
    6985// Pour des formats comme ca, la syntaxe printf est plus agreable.
  • trunk/SophyaLib/SysTools/ctimer.h

    r241 r895  
    11// This may look like C code, but it is really -*- C++ -*-
    22//
    3 // $Id: ctimer.h,v 1.2 1999-04-21 13:12:00 ansari Exp $
     3// $Id: ctimer.h,v 1.3 2000-04-12 17:49:41 ansari Exp $
    44//
    55
     
    88#define CTIMER_SEEN
    99
     10#include "machdefs.h"
    1011#include <sys/types.h>
    1112#include <time.h>
    1213#include <iostream.h>
    1314#include <stdio.h>
    14 #include "machdefs.h"
     15#include <string>
    1516
    1617// <summary> Permet de chronometrer des fonctions. </summary>
     
    2223
    2324// La macro SPLITTIME lui permet d'afficher des temps partiels.
     25namespace SOPHYA {
     26
     27//! Simple chronometer class
    2428class Timer  {
    2529public:
     
    3539
    3640  // Sert a eviter que GNU ne pretende qu'on utilise pas l'objet...
     41  /*! To avoid not used object compiler warnings */
    3742  void Nop() {}
    3843
     
    4045  clock_t cpu0, cpuSplit;
    4146  time_t  elapse0, elapseSplit;
    42   const char* timerName;
     47  string timerName;
    4348};
     49
     50} // namespace SOPHYA
    4451
    4552#define TIMEN(x)  Timer timer(x); timer.Nop();
  • trunk/SophyaLib/SysTools/pdlmgr.cc

    r480 r895  
    1818string*  PDynLinkMgr::tmpDir = NULL;
    1919
     20/*!
     21  \class SOPHYA::PDynLinkMgr
     22  This classes handles the run-time operations related to using shared
     23  libraries. The present version has been adapted for different Unix
     24  flavours (Linux, Compaq/Digital Unix, SGI IRIX, IBM AIX, Sun Solaris).
     25*/
     26
    2027/* --Methode-Static-- */
     28/*! Sets the path for a temporary space where shared libraries are copied.
     29    The path is appended to \b LD_LIBRARY_PATH
     30*/
    2131void PDynLinkMgr::SetTmpDir(string const & path)
    2232{
     
    6373
    6474/* --Methode-Static-- */
     75/*! Returns the temporary space path */
    6576string& PDynLinkMgr::GetTmpDir()
    6677{
     
    6879  tmpDir = new string("");
    6980  char* varenv;
    70   if ( (varenv=getenv("PEIDA_TMP")) != NULL )  *tmpDir = varenv;
     81  if ( (varenv=getenv("SOPHYA_TMP")) != NULL )  *tmpDir = varenv;
    7182  else if ( (varenv=getenv("TMPDIR")) != NULL )  *tmpDir = varenv;
    7283  }
     
    7586
    7687/* --Methode-Static-- */
     88/*! Compiles the C source file named \b fname and creates the
     89    corresponding shared library linking against the standard
     90    C library (-lc) and the math library (-lm).
     91    Returns a pointer to the created PDynLinkMgr object (by new).
     92    Returns the NULL pointer in case of errors.
     93*/
    7794PDynLinkMgr* PDynLinkMgr::BuildFromCFile(string const & fname)
    7895{
     
    131148
    132149/* --Methode-- */
     150/*! The constructor.
     151    \param soname : Name of the shared library. ".so" is appended
     152    to the name if no dot "." is found in the name.
     153    \param cp : if true, copies the shared library in the temporary space.
     154*/
    133155PDynLinkMgr::PDynLinkMgr(string& soname, bool cp)
    134156{
     
    181203
    182204/* --Methode-- */
     205/*! Destructor. Closes the shared library. Removes the file if it had been
     206    copied in the temporary space, or generated by \b BuildFromCFile */
    183207PDynLinkMgr::~PDynLinkMgr()
    184208{
     
    196220
    197221/* --Methode-- */
     222/*! Returns a handle to the function named \b funcname.
     223    Returns the NULL pointer in case of error          */
    198224DlFunction PDynLinkMgr::GetFunction(string const & funcname)
    199225{
  • trunk/SophyaLib/SysTools/pdlmgr.h

    r480 r895  
    1616#endif
    1717
     18namespace SOPHYA {
     19
    1820typedef void (* DlFunction) (void);
    1921
     22//! Dynamic Link Manager.
    2023class PDynLinkMgr {
    2124public:
     
    4548};
    4649
     50} // namespace SOPHYA
     51
    4752#endif
  • trunk/SophyaLib/SysTools/periodic.h

    r480 r895  
    77#include <list>
    88
     9namespace SOPHYA {
     10
    911class Periodic;
    1012typedef list<Periodic*> PeriodicList;
     
    1214typedef void (* UsPeriodicAction) (void *);
    1315
     16//! Class for the execution of a periodic action
    1417class Periodic
    1518{
     
    2326  virtual void SetIntervalms(int dtms);
    2427
     28/*! Returns the time interval in seconds >= 1 sec */
    2529  inline int Interval() { return(mDt); }
     30/*! Returns the time interval in milli-second */
    2631  inline int Intervalms() { return(mDtms); }
    2732
     
    4146};
    4247
     48} // namespace SOPHYA
    4349
    4450#endif
Note: See TracChangeset for help on using the changeset viewer.