Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members  

coutvect.h

00001 //==========================================================================
00002 //   COUTVECT.H - header for
00003 //                             OMNeT++
00004 //            Discrete System Simulation in C++
00005 //
00006 //
00007 //  Declaration of the following classes:
00008 //    cOutVector         : represents an output vector
00009 //    cOutputVectorManager  : actually records for cOutVector objects
00010 //
00011 //==========================================================================
00012 
00013 #ifndef __COUTVECT_H
00014 #define __COUTVECT_H
00015 
00016 #include <stdio.h>
00017 #include "cobject.h"
00018 
00019 
00025 typedef void (*RecordFunc)(void *, double, double);
00026 
00027 class TOutVectorInspector;
00028 class TOutVectorWindow;
00029 
00030 
00038 class SIM_API cOutVector : public cObject
00039 {
00040   protected:
00041     bool enabled;        // if false, record() method will do nothing
00042     int tuple;           // values: 1 or 2
00043     void *handle;        // identifies output vector for the output vector manager
00044     long num_received;   // total number of values passed to the output vector object
00045     long num_stored;     // number of values actually stored
00046 
00047     // the following members will be used directly by inspectors
00048     friend class TOutVectorInspector;
00049     friend class TOutVectorWindow;
00050     RecordFunc record_in_inspector; // to notify inspector about file writes
00051     void *data_for_inspector;       // FIXME: why not via a setCallback() function??
00052 
00053   public:
00056 
00060     explicit cOutVector(const char *name=NULL, int tuple=1);
00061 
00065     cOutVector(const cOutVector& r) : cObject(r) {setName(r.name());operator=(r);}
00066 
00070     virtual ~cOutVector();
00071 
00075     cOutVector& operator=(const cOutVector&)  {copyNotSupported();return *this;}
00077 
00080 
00085     virtual void setName(const char *name);
00086 
00090     virtual const char *className() const {return "cOutVector";}
00091 
00096     virtual cObject *dup() const    {return new cOutVector(*this);}
00097 
00102     virtual void info(char *buf);
00103 
00108     virtual const char *inspectorFactoryName() const {return "cOutVectorIFC";}
00110 
00113 
00122     virtual bool record(double value);
00123 
00132     virtual bool record(double value1, double value2);
00133 
00137     virtual void enable()  {enabled=true;}
00138 
00143     virtual void disable()  {enabled=false;}
00144 
00148     virtual bool isEnabled()  {return enabled;}
00149 
00155     long valuesReceived()  {return num_received;}
00156 
00162     long valuesStored()  {return num_stored;}
00164 };
00165 
00166 #endif
00167 
00168 

Generated at Sat May 4 15:45:48 2002 for OMNeT++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001