00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __COUTVECT_H
00021 #define __COUTVECT_H
00022
00023 #include <stdio.h>
00024 #include "cobject.h"
00025
00026
00032 typedef void (*RecordFunc)(void *, double, double);
00033
00034 class TOutVectorInspector;
00035 class TOutVectorWindow;
00036
00037
00045 class SIM_API cOutVector : public cObject
00046 {
00047 protected:
00048 bool enabled;
00049 int tupl;
00050 void *handle;
00051 long num_received;
00052 long num_stored;
00053
00054
00055 RecordFunc record_in_inspector;
00056 void *data_for_inspector;
00057
00058 public:
00059
00060 void setCallback(RecordFunc f, void *d) {record_in_inspector=f; data_for_inspector=d;}
00061
00062 public:
00065
00069 explicit cOutVector(const char *name=NULL, int tuple=1);
00070
00074 cOutVector(const cOutVector& r) : cObject() {setName(r.name());operator=(r);}
00075
00079 virtual ~cOutVector();
00080
00084 cOutVector& operator=(const cOutVector&) {copyNotSupported();return *this;}
00086
00089
00094 virtual void setName(const char *name);
00095
00100 virtual cObject *dup() const {return new cOutVector(*this);}
00101
00106 virtual std::string info() const;
00107
00112 virtual void netPack(cCommBuffer *buffer);
00113
00118 virtual void netUnpack(cCommBuffer *buffer);
00120
00123
00132 virtual bool record(double value);
00133
00142 virtual bool record(double value1, double value2);
00143
00147 virtual void enable() {enabled=true;}
00148
00153 virtual void disable() {enabled=false;}
00154
00158 virtual bool isEnabled() {return enabled;}
00159
00165 long valuesReceived() {return num_received;}
00166
00172 long valuesStored() {return num_stored;}
00173
00177 int tuple() {return tupl;}
00179 };
00180
00181 #endif
00182
00183