Description

Base class for all Chrono objects.

Each object receives a unique identifier and can be named and/or tagged.

#include <ChObject.h>

Inheritance diagram for chrono::ChObj:

Public Member Functions

 ChObj (const ChObj &other)
 
virtual ChObjClone () const =0
 "Virtual" copy constructor.
 
int GetIdentifier () const
 Get the unique integer identifier of this object. More...
 
void SetTag (int tag)
 Set an object integer tag (default: -1). More...
 
int GetTag () const
 Get the tag of this object.
 
void SetName (const std::string &myname)
 Set the name of this object.
 
const std::string & GetName () const
 Get the name of this object.
 
double GetChTime () const
 Gets the simulation time of this object.
 
void SetChTime (double m_time)
 Sets the simulation time of this object.
 
virtual void ArchiveOut (ChArchiveOut &archive_out)
 Method to allow serialization of transient data to archives.
 
virtual void ArchiveIn (ChArchiveIn &archive_in)
 Method to allow de-serialization of transient data from archives.
 
virtual std::string & ArchiveContainerName ()
 

Protected Member Functions

int GenerateUniqueIdentifier ()
 

Protected Attributes

double ChTime
 object simulation time
 
std::string m_name
 object name
 
int m_identifier
 object unique identifier
 
int m_tag
 user-supplied tag
 

Member Function Documentation

◆ GetIdentifier()

int chrono::ChObj::GetIdentifier ( ) const
inline

Get the unique integer identifier of this object.

Object identifiers are generated automatically in incremental order based on the order in which objects are created. These identifiers are transient and as such are not serialized. However, user code can cache the identifier of any Chrono object and use it later (e.g., to search the item in a ChAssembly).

◆ SetTag()

void chrono::ChObj::SetTag ( int  tag)
inline

Set an object integer tag (default: -1).

Unlike the object identifier, this tag is completely under user control and not used anywhere else in Chrono. Tags are serialized and de-serialized.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/physics/ChObject.h
  • /builds/uwsbel/chrono/src/chrono/physics/ChObject.cpp