Skip to content

Commit

Permalink
[ecore][cpp] Fix tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
nlsMasa committed Oct 26, 2023
1 parent d5b3daa commit 324ca10
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
5 changes: 5 additions & 0 deletions ecore/lib/src/ecore/ext/EClassifierBaseExt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,14 @@ namespace ecore::ext
virtual ~EClassifierBaseExt();

virtual bool isInstance( const ecore::Any& object ) const;
virtual const std::string& getInstanceTypeName() const;
virtual void setInstanceTypeName( const std::string& newInstanceTypeName );

protected:
virtual int initClassifierID();

private:
std::string instanceTypeName_;
};

}
Expand Down
16 changes: 15 additions & 1 deletion ecore/lib/src/ecore/ext/EClassifierBaseExt.inl
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,18 @@ namespace ecore::ext
return getEPackage() ? static_cast<int>(getEPackage()->getEClassifiers()->indexOf(getThisPtr())) : -1;
}

}
template <typename... I>
const std::string& EClassifierBaseExt<I...>::getInstanceTypeName() const
{
return instanceTypeName_;
}

template <typename... I>
void EClassifierBaseExt<I...>::setInstanceTypeName( const std::string& newInstanceTypeName )
{
auto oldInstanceTypeName = instanceTypeName_;
instanceTypeName_ = newInstanceTypeName;
if( eNotificationRequired() )
eNotify( std::make_shared<ecore::impl::Notification>(getThisAsEObject(), ecore::ENotification::SET, EcorePackage::ECLASSIFIER__INSTANCE_TYPE_NAME, oldInstanceTypeName, newInstanceTypeName));
}
}

0 comments on commit 324ca10

Please sign in to comment.