Skip to content

Commit

Permalink
Remaining files to fix MacOS X compilation.
Browse files Browse the repository at this point in the history
  • Loading branch information
shoops committed Mar 20, 2024
1 parent 6cf78c4 commit 0f7ec1a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 20 additions & 0 deletions copasi/core/CDataContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,26 @@ class CDataContainer: public CDataObject
CDataContainer(const CDataContainer & src);

public:
template < class CType > static bool findObjectAncestor(const CDataObject * pObject, CType *& pAncestor)
{
pAncestor = nullptr;

CDataObject * p = const_cast< CDataObject * >(pObject);

while (p != nullptr)
{
if (dynamic_cast< CType * >(p) != nullptr)
{
pAncestor = static_cast< CType * >(p);
return true;
}

p = p->getObjectParent();
}

return false;
}

/**
* Static method to create a CDataObject based on the provided data
* @param const CData & data
Expand Down
20 changes: 0 additions & 20 deletions copasi/core/CDataObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,26 +245,6 @@ class CDataObject: public CObjectInterface, public CUndoObjectInterface

CDataContainer * getObjectAncestor(const std::string & type) const;

template < class CType > static bool findObjectAncestor(const CDataObject * pObject, CType *& pAncestor)
{
pAncestor = nullptr;

CDataObject * p = const_cast< CDataObject * >(pObject);

while (p != nullptr)
{
if (dynamic_cast< CType * >(p) != nullptr)
{
pAncestor = static_cast< CType * >(p);
return true;
}

p = p->getObjectParent();
}

return false;
}

bool prerequisitsContains(const DataObjectSet & objects) const;

/**
Expand Down

0 comments on commit 0f7ec1a

Please sign in to comment.