Source: netlogwriter.h


Annotated List
Files
Globals
Hierarchy
Index
// ##########################################################################
// ####                                                                  ####
// ####                      RTP Audio Server Project                    ####
// ####                    ============================                  ####
// ####                                                                  ####
// #### NetLog Writer                                                    ####
// ####                                                                  ####
// #### Version 1.00  --  February 23, 2001                              ####
// ####                                                                  ####
// #### Copyright (C) 1999  Thomas Dreibholz                             ####
// ####               2000  Universität Bonn, Abt. IV                    ####
// ####               2001  EMail: Dreibholz@bigfoot.com                 ####
// ####                     WWW:   http://www.bigfoot.com/~dreibholz     ####
// ####                                                                  ####
// ##########################################################################


#ifndef NETLOGWRITER_H
#define NETLOGWRITER_H


#include "system.h"
#include "timedthread.h"
#include "networkmonitorinterface.h"
#include "streammonitorreport.h"


namespace Coral {


/**
 * This class implements a writer for NetworkMonitorReports. The reports will
 * be written to a file in given intervals.
 *
 * @short   Network Log Writer
 * @author  Thomas Dreibholz (Dreibholz@bigfoot.com)
 * @version 1.0
 */       
class NetLogWriter : public TimedThread
{
   // ====== Constructor/Destructor =========================================
   public:
   /**
     * Constructor for a new NetLogWriter. Note: NetLogWriter will *not*
     * be started automatically. You have to call start()!
     *
     * @param name Name of log file to write.
     * @param interval Interval in microseonds the log is written.
     * @param maxCount Number of entries to be written.
     * @param monitor NetworkMonitorInterface to get the reports from.
     * @param smReport StreamMonitorReport (default NULL).
     *
     * @see Thread#start
     */
   NetLogWriter(const char*              name,
                const card64             interval,
                NetworkMonitorInterface* monitor,
                StreamMonitorReport*     smReport = NULL);

   /**
     * Destructor.
     */
   ~NetLogWriter();


   // ====== Status functions ===============================================
   /**
     * Check, if NetLogWriter is ready.
     *
     * @return true, if ready; false, if not.
     */  
   inline bool ready() const;

   /**
     * Get time stamp of file (seconds since 01-Jan-1970).
     *
     * @return Time stamp.
     */
   inline card64 getTimeStamp() const; 

   /**
     * Get interval of the entries in file.
     *
     * @return Interval in microseconds.
     */
   inline card64 getInterval() const;

   /**
     * Get number of entries written into file.
     *
     * @return Number of entries written.
     */
   inline card64 getCount() const;
   

   // ====== Private data ===================================================
   private:
   void timerEvent();
   
   
   FILE*                    FileDescriptor;
   NetworkMonitorInterface* Monitor;
   StreamMonitorReport*     SMReport;
   card64                   Count;
   card64                   TimeStamp;
   card64                   Interval;
};


}


#include "netlogwriter.icc"


#endif

Generated by: viper@odin on Fri Feb 23 12:41:26 2001, using kdoc 2.0a36.