#include "AdeptHeaders.hpp"

#include "Adder.hpp"

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
AdderOf<Scalar>::ClassData*
	AdderOf<Scalar>::CreateFactoryRequest(FactoryRequestParameters *parameters)
{
	Check_Object(parameters);

	//
	//-------------------------------------------------------------------------
	// Allocate enough room for what we need to write out, then call our parent
	//-------------------------------------------------------------------------
	//
	MemoryStream *component_stream = parameters->m_stream;
	Check_Object(component_stream);
	component_stream->AllocateBytes(sizeof(AdderOf<Scalar>));
	bool result =
		ChannelOf<Scalar>::CreateFactoryRequest(parameters) != NULL;

	//
	//-------------------
	// Read in the inputs
	//-------------------
	//
	if (!ReadInputsFromPage(parameters, ChannelOf<Scalar>::DefaultData))
		result = false;

	Check_Object(DefaultData);
	return (result) ? DefaultData : NULL;
}
