COPASI API  4.40.278
CArrayElementReference Class Reference

#include <CArrayElementReference.h>

Inheritance diagram for CArrayElementReference:
[legend]

Public Member Functions

virtual bool applyData (const CData &data, CUndoData::CChangeSet &changes) override
 
 CArrayElementReference (const std::vector< std::string > &index, const CDataContainer *pParent, const CFlags< Flag > &flag=CFlags< Flag >::None)
 
virtual CCommonName getCN () const override
 
virtual std::string getObjectDisplayName () const override
 
virtual const CDataObjectgetValueObject () const override
 
virtual void * getValuePointer () const override
 
virtual void print (std::ostream *ostream) const override
 
virtual CData toData () const override
 
virtual ~CArrayElementReference ()
 
- Public Member Functions inherited from CDataObject
void addIssue (const CIssue &issue)
 
void addReference (const CDataContainer *pReference)
 
virtual void calculateValue () override
 
 CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL)
 
virtual void createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const override
 
virtual void destruct () override
 
virtual const CDataObjectgetDataObject () const override
 
virtual const std::string & getKey () const
 
virtual const CObjectInterfacegetObject (const CCommonName &cn) const override
 
CDataContainergetObjectAncestor (const std::string &type) const
 
CDataModelgetObjectDataModel () const
 
const CObjectInterfacegetObjectFromCN (const CCommonName &cn) const
 
const std::string & getObjectName () const
 
CDataContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const CObjectInterface::ObjectSetgetPrerequisites () const override
 
virtual const std::string getUnits () const
 
virtual const CValiditygetValidity () const override
 
bool hasFlag (const Flag &flag) const
 
virtual bool isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override
 
bool prerequisitsContains (const DataObjectSet &objects) const
 
void removeIssue (const CIssue &issue)
 
void removeReference (const CDataContainer *pReference)
 
bool setObjectName (const std::string &name)
 
virtual bool setObjectParent (const CDataContainer *pParent)
 
void validityChanged (const CValidity &changedValidity) override
 
void validityRemoved (const CValidity &changedValidity)
 
virtual ~CDataObject ()
 
- Public Member Functions inherited from CObjectInterface
 CObjectInterface ()
 
 CObjectInterface (const CObjectInterface &src)
 
virtual ~CObjectInterface ()
 
- Public Member Functions inherited from CUndoObjectInterface
 CUndoObjectInterface ()
 
 CUndoObjectInterface (const CUndoObjectInterface &src)
 
bool generateUuid ()
 
const xg::Guid & getUuid () const
 
virtual CUndoObjectInterfaceinsert (const CData &data)
 
bool setUuid (const std::string &uuid)
 
bool setUuid (const xg::Guid &uuid)
 
virtual void updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject)
 
virtual ~CUndoObjectInterface ()
 

Static Public Member Functions

static CArrayElementReferencefromData (const CData &data, CUndoObjectInterface *pParent)
 
- Static Public Member Functions inherited from CDataObject
static CDataObjectfromData (const CData &data, CUndoObjectInterface *pParent)
 
static void sanitizeObjectName (std::string &name)
 
- Static Public Member Functions inherited from CObjectInterface
static const CDataObjectDataObject (const CObjectInterface *pInterface)
 
static CObjectInterfaceGetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName)
 
- Static Public Member Functions inherited from CUndoObjectInterface
template<class CType >
static CType * fromData (const CData &, CUndoObjectInterface *)
 

Private Member Functions

 CArrayElementReference ()
 
 CArrayElementReference (const CArrayElementReference &src)
 
void updateObjectName ()
 

Private Attributes

bool mIgnoreUpdateObjectName
 
std::vector< CRegisteredCommonNamemIndex
 

Additional Inherited Members

- Public Types inherited from CDataObject
typedef std::set< const CDataObject * > DataObjectSet
 
enum  Flag {
  Container , Vector , Matrix , NameVector ,
  Reference , ValueBool , ValueInt , ValueInt64 ,
  ValueDbl , NonUniqueName , StaticString , ValueString ,
  Separator , DisplayName , ModelEntity , Array ,
  DataModel , Root , Gui , __SIZE
}
 
- Public Types inherited from CObjectInterface
typedef std::vector< const CDataContainer * > ContainerList
 
typedef std::set< const CObjectInterface * > ObjectSet
 
- Protected Member Functions inherited from CDataObject
 CDataObject ()
 
 CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None)
 
- Protected Attributes inherited from CDataObject
ObjectSet mPrerequisits
 
std::set< CDataContainer * > mReferences
 
- Protected Attributes inherited from CObjectInterface
CValidity mValidity
 

Detailed Description

Class CArrayElementReference

This class is used to make an element of an array accessible as a CDataObject. Usually an object from this class will be a child of a CArrayAnnotation and will reference a single element of the array that the CArrayAnnotation points to.

Constructor & Destructor Documentation

◆ CArrayElementReference() [1/3]

CArrayElementReference::CArrayElementReference ( )
private

make the default constructor unaccessible

Referenced by fromData().

◆ CArrayElementReference() [2/3]

CArrayElementReference::CArrayElementReference ( const CArrayElementReference src)
private

make the copy constructor unaccessible

◆ CArrayElementReference() [3/3]

CArrayElementReference::CArrayElementReference ( const std::vector< std::string > &  index,
const CDataContainer pParent,
const CFlags< Flag > &  flag = CFlagsFlag >::None 
)

create an element reference with a given index. The index is passed as a string, e.g. "[3][2]" The object name will be the index string, the type is "ElementReference" pParent may not be NULL.

References updateObjectName().

◆ ~CArrayElementReference()

virtual CArrayElementReference::~CArrayElementReference ( )
inlinevirtual

Member Function Documentation

◆ applyData()

bool CArrayElementReference::applyData ( const CData data,
CUndoData::CChangeSet changes 
)
overridevirtual

Apply the provided data to the object

Parameters
constCData & data
Returns
bool success

Reimplemented from CDataObject.

References CDataObject::applyData(), CData::ARRAY_ELEMENT_INDEX, CData::getProperty(), CData::isSetProperty(), mIndex, and CDataValue::toDataValues().

◆ fromData()

CArrayElementReference * CArrayElementReference::fromData ( const CData data,
CUndoObjectInterface pParent 
)
static

◆ getCN()

CCommonName CArrayElementReference::getCN ( ) const
overridevirtual

Retrieve the CN of the object

Returns
CCommonName

Reimplemented from CDataObject.

References CDataObject::getCN(), CDataObject::getObjectName(), CDataObject::getObjectParent(), and updateObjectName().

◆ getObjectDisplayName()

std::string CArrayElementReference::getObjectDisplayName ( ) const
overridevirtual

◆ getValueObject()

virtual const CDataObject* CArrayElementReference::getValueObject ( ) const
inlineoverridevirtual

Reimplemented from CDataObject.

◆ getValuePointer()

void * CArrayElementReference::getValuePointer ( ) const
overridevirtual

returns a pointer to the numerical values of the array element this will be a *C_FLOAT64 for this class.

Reimplemented from CDataObject.

References CDataObject::getObjectParent(), and mIndex.

Referenced by print().

◆ print()

void CArrayElementReference::print ( std::ostream *  ostream) const
overridevirtual

This is the output method for any object. The default implementation provided with CDataObject uses the ostream operator<< of the object to print the object.To override this default behavior one needs to reimplement the virtual print function.

Parameters
std::ostream* ostream

Reimplemented from CDataObject.

References getValuePointer().

◆ toData()

CData CArrayElementReference::toData ( ) const
overridevirtual

Retrieve the data describing the object

Returns
CData data

Reimplemented from CDataObject.

References CData::addProperty(), CData::ARRAY_ELEMENT_INDEX, mIndex, and CDataObject::toData().

◆ updateObjectName()

Member Data Documentation

◆ mIgnoreUpdateObjectName

bool CArrayElementReference::mIgnoreUpdateObjectName
private

Referenced by updateObjectName().

◆ mIndex

std::vector< CRegisteredCommonName > CArrayElementReference::mIndex
private

this contains the index in string format, e.g. "[2][7]"

Referenced by applyData(), getValuePointer(), toData(), and updateObjectName().


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