AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxPlot::TimeDataSeries Class Reference

#include <DataSeries.h>

+ Inheritance diagram for agxPlot::TimeDataSeries:

Public Types

enum  Settings { DATASERIES_SETTINGS_NONE = 0, DATASERIES_SETTINGS_ISTIME = 1 }
 

Public Member Functions

 TimeDataSeries (agxSDK::Simulation *)
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
void clearData ()
 Remove all values in stored. More...
 
void generateCurrentValue ()
 Fetches the current value from the specified way of generation and append it to the series. More...
 
const agx::RealVector & getAllValues () const
 Get all values that have been generated so far. More...
 
const agx::String & getDataPath () const
 
void getDescription (agxJson::Value &root) const
 Get the description of the following format. More...
 
agx::Uuid getEntityId () const
 
agx::UInt getID () const
 
bool getLogarithmic () const
 
const agx::String & getName () const
 Get the name of the data series. More...
 
size_t getNewValueMarker () const
 Get the index of the oldest new value. More...
 
int getReferenceCount () const
 
const agxUtil::Statistic * getStatistic () const
 Return the statistic, if any, through which data from generator is passed before being added to the data series. More...
 
const agx::String & getUnit () const
 Get the unit of the data series. More...
 
bool hasDataPath () const
 
bool hasImportedJournalData () const
 
void importedJournal ()
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool isTime () const
 Time works different, thus the time data series have this flag. More...
 
void push (agx::Real value)
 Manually add a value at the end of the DataSeries. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void resetDirty ()
 All current values are now observed and dirty flags can be cleaned up. More...
 
void setFromDescription (const agxJson::Value &root)
 Set from a description of the format from getDescription. More...
 
void setLogarithmic (bool isLogarithmic)
 Should the axis be logarithmic if displayed. More...
 
void setName (const agx::String &name)
 Set the name of the data series. More...
 
void setSettings (agx::UInt16 settings)
 Set special settings for the data series. More...
 
void setStatistic (agxUtil::Statistic *statistic)
 Pass data read from the data generator through the given statistic before adding it to the data series. More...
 
void setStatistic (agxUtil::StatisticHandleRef statistic)
 Pass data read from the data generator through the given statistic before adding it to the data series. More...
 
void setUnit (const agx::String &unit)
 Set a string representing the unit of the data series. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Static Public Member Functions

template<typename T >
static bool ValidateCast (const Referenced *object)
 

Public Attributes

agx::Event representationChanged
 

Protected Member Functions

virtual ~TimeDataSeries ()
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void init (DataGeneratorRef generator, const agx::String &name)
 

Static Protected Member Functions

static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Protected Attributes

Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Definition at line 254 of file DataSeries.h.

Member Enumeration Documentation

Enumerator
DATASERIES_SETTINGS_NONE 
DATASERIES_SETTINGS_ISTIME 

Definition at line 43 of file DataSeries.h.

Constructor & Destructor Documentation

agxPlot::TimeDataSeries::TimeDataSeries ( agxSDK::Simulation *  )
virtual agxPlot::TimeDataSeries::~TimeDataSeries ( )
protectedvirtual

Member Function Documentation

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
template<typename T >
T* agx::Referenced::as ( )
inherited

Subclass casting.

Template type must match actual type, dynamic_cast assertion will fail otherwise.

Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
void agxPlot::DataSeries::clearData ( )
inherited

Remove all values in stored.

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
void agxPlot::DataSeries::generateCurrentValue ( )
inherited

Fetches the current value from the specified way of generation and append it to the series.

const agx::RealVector& agxPlot::DataSeries::getAllValues ( ) const
inherited

Get all values that have been generated so far.

const agx::String& agxPlot::DataSeries::getDataPath ( ) const
inherited
static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
void agxPlot::DataSeries::getDescription ( agxJson::Value &  root) const
inherited

Get the description of the following format.

["name"] = the name of the data series (axis) ["unit"] = the unit of the data series ["isLogarithmic"] = should the data series be viewed as logarithmic ["isTime"] = the data series represents time ["id"] = the id of the data series

agx::Uuid agxPlot::DataSeries::getEntityId ( ) const
inherited
agx::UInt agxPlot::DataSeries::getID ( ) const
inherited
bool agxPlot::DataSeries::getLogarithmic ( ) const
inherited
const agx::String& agxPlot::DataSeries::getName ( ) const
inherited

Get the name of the data series.

size_t agxPlot::DataSeries::getNewValueMarker ( ) const
inherited

Get the index of the oldest new value.

All values after this are 'dirty'.

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
const agxUtil::Statistic* agxPlot::DataSeries::getStatistic ( ) const
inherited

Return the statistic, if any, through which data from generator is passed before being added to the data series.

May be nullptr.

const agx::String& agxPlot::DataSeries::getUnit ( ) const
inherited

Get the unit of the data series.

bool agxPlot::DataSeries::hasDataPath ( ) const
inherited
bool agxPlot::DataSeries::hasImportedJournalData ( ) const
inherited
void agxPlot::DataSeries::importedJournal ( )
inherited
void agxPlot::DataSeries::init ( DataGeneratorRef  generator,
const agx::String &  name 
)
protectedinherited
template<typename T >
bool agx::Referenced::is ( ) const
inherited
bool agxPlot::DataSeries::isTime ( ) const
inherited

Time works different, thus the time data series have this flag.

void agxPlot::DataSeries::push ( agx::Real  value)
inherited

Manually add a value at the end of the DataSeries.

Parameters
valuethe new value to append
void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.

This method should be used with care, always balanced with the same number of calls to unreference.

Referenced by agxData::Val< UInt >::Val().

void agxPlot::DataSeries::resetDirty ( )
inherited

All current values are now observed and dirty flags can be cleaned up.

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

void agxPlot::DataSeries::setFromDescription ( const agxJson::Value &  root)
inherited

Set from a description of the format from getDescription.

void agxPlot::DataSeries::setLogarithmic ( bool  isLogarithmic)
inherited

Should the axis be logarithmic if displayed.

void agxPlot::DataSeries::setName ( const agx::String &  name)
inherited

Set the name of the data series.

void agxPlot::DataSeries::setSettings ( agx::UInt16  settings)
inherited

Set special settings for the data series.

void agxPlot::DataSeries::setStatistic ( agxUtil::Statistic *  statistic)
inherited

Pass data read from the data generator through the given statistic before adding it to the data series.

This DataSeries will take ownership of the given statistic object and will call delete on it when destroyed.

void agxPlot::DataSeries::setStatistic ( agxUtil::StatisticHandleRef  statistic)
inherited

Pass data read from the data generator through the given statistic before adding it to the data series.

This DataSeries will take ownership of the statitic in the given statistic handle and will call delete on it when destroyed. The given statistic handle will be empty and cannot be reused when setStatistic returns.

void agxPlot::DataSeries::setUnit ( const agx::String &  unit)
inherited

Set a string representing the unit of the data series.

void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.

This method should be used with care, always balanced with the same number of calls to reference.

void agx::Referenced::unreference_nodelete ( ) const
inherited

Decrement the reference count by one, indicating that a pointer to this object is referencing it.

However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

agx::Event agxPlot::DataSeries::representationChanged
inherited

Definition at line 211 of file DataSeries.h.


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