# cOutVector Class Reference
[Statistical data collection]

`#include <coutvect.h>`

Inheritance diagram for cOutVector:

List of all members.

## Detailed Description

Responsible for recording vector simuotation results (an output vector).

A cOutVector object can write doubles to the output vector file (or any another device determined by the current cOutputVectorManager).

## Public Member Functions

Constructors, destructor, assignment
| cOutVector (const char *name=NULL, int tuple=1)
| cOutVector (const cOutVector &r)
virtual | ~cOutVector ()
cOutVector & | operator= (const cOutVector &)
Redefined cObject member functions.
virtual void | setName (const char *name)
virtual cPolymorphic * | dup () const
virtual std::string | info () const
virtual void | netPack (cCommBuffer *buffer)
virtual void | netUnpack (cCommBuffer *buffer)
Configuring and writing to output vectors.
virtual bool | record (double value)
virtual bool | record (double value1, double value2)
virtual bool | recordWithTimestamp (simtime_t t, double value)
virtual bool | recordWithTimestamp (simtime_t t, double value1, double value2)
virtual void | enable ()
virtual void | disable ()
virtual bool | isEnabled ()
long | valuesReceived ()
long | valuesStored ()
int | tuple ()

## Constructor & Destructor Documentation

cOutVector::cOutVector | ( | const char * | name = `NULL`,
|  | int | tuple = `1`
| ) | `[explicit]`

| Constructor. Accepts the object name, and tuple which can be 1 or 2 (2 is discouraged).

cOutVector::cOutVector | ( | const cOutVector & | r | ) | `[inline]`

| Copy constructor.

virtual cOutVector::~cOutVector | ( |  | ) | `[virtual]`

| Destructor.

## Member Function Documentation

virtual void cOutVector::disable | ( |  | ) | `[inline, virtual]`

| Disables recording data via this object. record() methods will return false without doing anything.

virtual cPolymorphic* cOutVector::dup | ( |  | ) | const`[inline, virtual]`

| Dupping is not implemented for cOutVector. This function gives an error (throws cRuntimeError) when called. Reimplemented from cObject.

virtual void cOutVector::enable | ( |  | ) | `[inline, virtual]`

| Enables recording data via this object. (It is enabled by default.)

virtual std::string cOutVector::info | ( |  | ) | const`[virtual]`

| Produces a one-line description of object contents into the buffer passed as argument. See cObject for more details. Reimplemented from cPolymorphic.

virtual bool cOutVector::isEnabled | ( |  | ) | `[inline, virtual]`

| Returns true if recording the data is enabled, false otherwise.

virtual void cOutVector::netPack | ( | cCommBuffer * | buffer | ) | `[virtual]`

| Packing and unpacking cannot be supported with this class. This methods raises an error. Reimplemented from cObject.

virtual void cOutVector::netUnpack | ( | cCommBuffer * | buffer | ) | `[virtual]`

| Packing and unpacking cannot be supported with this class. This methods raises an error. Reimplemented from cObject.

cOutVector& cOutVector::operator= | ( | const cOutVector & |  | ) | `[inline]`

| Assignment is not supported by this class: this method throws a cRuntimeError when called.

virtual bool cOutVector::record | ( | double | value1,
|  | double | value2
| ) | `[virtual]`

| Records two values with the current simulation time as timestamp. This method can be used with cOutVectors created with tuple=2. The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.)

virtual bool cOutVector::record | ( | double | value | ) | `[virtual]`

| Records the value with the current simulation time as timestamp. This method can be used with cOutVectors created with tuple=1. The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.)

virtual bool cOutVector::recordWithTimestamp | ( | simtime_t | t,
|  | double | value1,
|  | double | value2
| ) | `[virtual]`

Records two values 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.

This method can be used with cOutVectors created with tuple=2.

The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.)

virtual bool cOutVector::recordWithTimestamp | ( | simtime_t | t,
|  | double | value
| ) | `[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.

This method can be used with cOutVectors created with tuple=1.

The return value is true if the data was actually recorded, and false if it was not recorded (because of filtering, etc.)

virtual void cOutVector::setName | ( | const char * | name | ) | `[virtual]`

| Sets the name of the object. It is not possible to call this method after the first call to record(). Reimplemented from cObject.

int cOutVector::tuple | ( |  | ) | `[inline]`

| Returns the tuple parameter passed to the constructor.

long cOutVector::valuesReceived | ( |  | ) | `[inline]`

| Returns the total number of values passed to the record() method of this output vector object. This includes the values passed while the object was disabled (see disable()).

long cOutVector::valuesStored | ( |  | ) | `[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.

The documentation for this class was generated from the following file:

- coutvect.h