/*!\file MatrixParam.c * \brief: implementation of the MatrixParam object */ /*header files: */ /*{{{*/ #ifdef HAVE_CONFIG_H #include #else #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" #endif #include "../classes.h" #include "../../shared/shared.h" /*}}}*/ /*MatrixParam constructors and destructor*/ /*FUNCTION MatrixParam::MatrixParam(){{{*/ MatrixParam::MatrixParam(){ return; } /*}}}*/ /*FUNCTION MatrixParam::MatrixParam(int enum_type,Matrix* value){{{*/ MatrixParam::MatrixParam(int in_enum_type,Matrix* in_value){ enum_type=in_enum_type; value=NULL; if(in_value){ value=in_value->Duplicate(); } } /*}}}*/ /*FUNCTION MatrixParam::~MatrixParam(){{{*/ MatrixParam::~MatrixParam(){ delete value; } /*}}}*/ /*Object virtual functions definitions:*/ /*FUNCTION MatrixParam::Echo {{{*/ void MatrixParam::Echo(void){ _printf_("MatrixParam:\n"); _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n"); } /*}}}*/ /*FUNCTION MatrixParam::DeepEcho{{{*/ void MatrixParam::DeepEcho(void){ _printf_("MatrixParam:\n"); _printf_(" enum: " << this->enum_type << " (" << EnumToStringx(this->enum_type) << ")\n"); this->value->Echo(); } /*}}}*/ /*FUNCTION MatrixParam::Id{{{*/ int MatrixParam::Id(void){ return -1; } /*}}}*/ /*FUNCTION MatrixParam::ObjectEnum{{{*/ int MatrixParam::ObjectEnum(void){ return MatrixParamEnum; } /*}}}*/ /*FUNCTION MatrixParam::copy{{{*/ Object* MatrixParam::copy() { return new MatrixParam(this->enum_type,this->value); } /*}}}*/ /*MatrixParam virtual functions definitions: */ /*FUNCTION MatrixParam::GetParameterValue{{{*/ void MatrixParam::GetParameterValue(Matrix** poutput){ Matrix* output=NULL; if(value){ output=value->Duplicate(); } *poutput=output; } /*}}}*/ /*FUNCTION MatrixParam::SetValue{{{*/ void MatrixParam::SetValue(Matrix* matrix){ /*avoid leak: */ delete value; /*copy: */ value=matrix->Duplicate(); } /*}}}*/