Responsible for recording an "output vector" into the simulation results file. An output vector is a time series where each value is recorded with its own timestamp. Time stamps are monotonically increasing. The vector is registered in the result file with the module (the owner of this object), a vector name, and optional attributes. The first two identify the vector, and the attributes convey additional meta information that may be used by result analysis tools.
Before recording values, the output vector needs to be registered, i.e. declared with its name and attributes. After registration, the name and attributes cannot be changed, e.g. new attribute cannot be added. This class allows attributes to be specified up front as a string map (which allows registering the vector immediately), or one by one using the setAttribute() call. In the latter case, the setAttribute() calls must be followed by an registerVector() call. If the registerVector() call is omitted, the vector will be registered when the first data item is recorded into the vector; if no data is recorded, the vector will be missing from the result file.
Public Member Functions | |
Constructors, destructor, assignment | |
cOutVector (const char *name=nullptr) | |
cOutVector (const char *name, const opp_string_map &attributes) | |
virtual | ~cOutVector () |
Redefined cObject member functions. | |
virtual void | setName (const char *name) override |
virtual std::string | str () const override |
Metadata annotations. | |
virtual void | setAttributes (const opp_string_map &attributes) |
virtual void | setAttribute (const char *name, const char *value) |
virtual void | registerVector () |
virtual void | setEnum (const char *registeredEnumName) |
virtual void | setEnum (cEnum *enumDecl) |
virtual void | setUnit (const char *unit) |
virtual void | setType (Type type) |
virtual void | setInterpolationMode (InterpolationMode mode) |
virtual void | setMin (double minValue) |
virtual void | setMax (double maxValue) |
Writing to output vectors. | |
virtual bool | record (double value) |
virtual bool | record (SimTime value) |
virtual bool | recordWithTimestamp (simtime_t t, double value) |
virtual bool | recordWithTimestamp (simtime_t t, SimTime value) |
virtual void | enable () |
virtual void | disable () |
virtual void | setEnabled (bool b) |
virtual bool | isEnabled () const |
virtual void | setRecordDuringWarmupPeriod (bool b) |
virtual bool | getRecordDuringWarmupPeriod () const |
long | getValuesReceived () const |
long | getValuesStored () const |
Public Member Functions inherited from cNoncopyableOwnedObject | |
cNoncopyableOwnedObject (const char *name=nullptr, bool namepooling=true) | |
virtual cNoncopyableOwnedObject * | dup () const override |
Public Member Functions inherited from cOwnedObject | |
cOwnedObject () | |
cOwnedObject (const char *name, bool namepooling=true) | |
cOwnedObject (const cOwnedObject &obj) | |
virtual | ~cOwnedObject () |
cOwnedObject & | operator= (const cOwnedObject &o) |
virtual cObject * | getOwner () const override |
virtual bool | isOwnedObject () const override |
Public Member Functions inherited from cNamedObject | |
cNamedObject () | |
cNamedObject (const char *name, bool namepooling=true) | |
cNamedObject (const cNamedObject &obj) | |
virtual | ~cNamedObject () |
cNamedObject & | operator= (const cNamedObject &o) |
virtual const char * | getName () const override |
virtual void | setNamePooling (bool b) |
virtual bool | getNamePooling () |
Public Member Functions inherited from cObject | |
cObject () | |
cObject (const cObject &other)=default | |
virtual | ~cObject () |
virtual const char * | getClassName () const |
bool | isName (const char *s) const |
virtual const char * | getFullName () const |
virtual std::string | getFullPath () const |
virtual std::string | getClassAndFullName () const |
virtual std::string | getClassAndFullPath () const |
const cObject * | getThisPtr () const |
virtual std::ostream & | printOn (std::ostream &os) const |
virtual bool | isSoftOwner () const |
virtual void | forEachChild (cVisitor *v) |
cObject * | findObject (const char *name, bool deep=true) |
virtual cClassDescriptor * | getDescriptor () const |
void | copyNotSupported () const |
Additional Inherited Members | |
Static Public Member Functions inherited from cOwnedObject | |
static long | getTotalObjectCount () |
static long | getLiveObjectCount () |
static void | resetObjectCounters () |
static cSoftOwner * | getOwningContext () |
Protected Member Functions inherited from cObject | |
virtual void | take (cOwnedObject *obj) |
virtual void | drop (cOwnedObject *obj) |
void | dropAndDelete (cOwnedObject *obj) |
|
explicit |
Construct an output vector with a name. Attributes may be added later, in one step, or one-by-one. In the latter case, or if no attributes will be added, registerVector() should be called.
|
explicit |
Construct an output vector with a name and attributes, and register it immediately.
|
virtual |
Destructor.
|
overridevirtual |
Sets the name of the object. It is not possible to call this method after the first call to record().
Reimplemented from cNamedObject.
|
overridevirtual |
|
virtual |
Sets the vector attributes in one step, and registers the vector.
|
virtual |
Sets the specified vector attribute. This method may only be called when the vector is not yet registered. The last setAttribute() call should be followed by an registerVector() call.
|
virtual |
Registers the vector if it has not been registered yet. After this call, no more attributes can be added to the vector. If this call is omitted, the vector will be registered when the first data item is recorded into it, or if no data is recorded, the vector will be missing from the result file.
|
virtual |
Associates the vector with a cEnum, by setting the "enum" and "enumname" vector attributes. The enum name as well as the symbols and their integer values will be recorded. cOutVector does not verify that recorded values actually comply with this annotation.
|
virtual |
Associates the vector with a cEnum, by setting the "enum" and "enumname" vector attributes. The enum name as well as the symbols and their integer values will be recorded. cOutVector does not verify that recorded values actually comply with this annotation.
|
virtual |
Annotate the vector with a physical unit (like "s", "mW" or "bytes"), by setting the "unit" vector attribute.
|
virtual |
Annotate the vector with a data type, by setting the "type" vector attribute. cOutVector does not verify that recorded values actually comply with this annotation.
|
virtual |
Annotate the vector with an interpolation mode, by setting the "interpolationmode" vector attribute. This information may be used by result analysis tools as a hint for choosing a plotting style.
|
virtual |
Annotate the vector with a minimum value, by setting the "min" vector attribute. cOutVector does not verify that recorded values actually comply with this annotation.
|
virtual |
Annotate the vector with a maximum value, by setting the "max" vector attribute. cOutVector does not verify that recorded values actually comply with this annotation.
|
virtual |
Records the value with the current simulation time as timestamp.
The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.)
|
inlinevirtual |
Convenience method, delegates to record(double).
References SimTime::dbl(), and cOutVector::record().
Referenced by cOutVector::record().
|
virtual |
Records the value with the given time as timestamp. Values must be recorded in increasing timestamp order, that is, it is not possible to record a value with a timestamp that is less than that of the last recorded value.
The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.)
Convenience method, delegates to recordWithTimestamp(simtime_t, double).
References SimTime::dbl(), and cOutVector::recordWithTimestamp().
Referenced by cOutVector::recordWithTimestamp().
|
inlinevirtual |
Enables recording data via this object. (It is enabled by default.)
|
inlinevirtual |
Disables recording data via this object. record() methods will return false without doing anything.
|
inlinevirtual |
|
inlinevirtual |
Returns true if recording the data is enabled, false otherwise.
|
inlinevirtual |
Enables/disables recording data during the warm-up period. When set to false, record() calls will be ignored during warm-up period.
|
inlinevirtual |
Returns true if the object will record data during the warm-up period.
|
inline |
|
inline |
Returns the number of values actually stored by this output vector object. The values passed while the object was disabled (via disable(), environment configuration, filtering, etc.) do not count.