#if !defined(_INLINE)
static char cvsid[] = "@(#)$Id$";
static char debugFileId[] = __FILE__;
#endif
#include "ObjectFactory.hpp"
#include "LinkManager.hpp"
#include "String.hpp"
#include "Debug.hpp"
ObjectFactory::ObjectFactory( const Top *aMatrix ) :
matrix( aMatrix )
{
preC_( aMatrix != null );
LinkManager::reg( this, matrix );
}
ObjectFactory::~ObjectFactory()
{
LinkManager::free( this, matrix );
}
Top *ObjectFactory::create()
{
return( matrix -> clone() );
}
boolean ObjectFactory::equals( const Top *anOther ) const
{
ObjectFactory *other;
other = DCAST( anOther, ObjectFactory );
if( other == ( ObjectFactory * ) NIL )
{
return false;
}
else
{
return( matrix -> equals( other -> matrix ) );
}
}
Top *ObjectFactory::clone() const
{
return ( Top * ) new ObjectFactory( matrix );
}
String ObjectFactory::toString() const
{
return Object::toString() +
" matrix: " + matrix -> toString();
}
String ObjectFactory::getClassName() const
{
return "ObjectFactory";
}
#if defined(_INLINE)
#include "../src/Debug.ipp"
#endif