// // Programmer: Craig Stuart Sapp // Creation Date: Sat Apr 19 20:48:50 GMT-0800 1997 // Last Modified: Sat Apr 19 20:48:53 GMT-0800 1997 // Filename: ...sig/maint/code/Generator/Function/Function.cpp // Web Address: http://sig.sapp.org/src/sigSignal/Function.cpp // Documentation: http://sig.sapp.org/doc/classes/Function // Syntax: C++ // #include "Function.h" #ifndef OLDCPP #include using namespace std; #else #include #endif static sampleType aSimpleFunction(double input = 0.0) { return input; } ////////////////////////////// // // Function::Function -- // Function::Function(funcPtr aFunction = aSimpleFunction) { setName("Function"); outputValue = 0; setFunction(aFunction); reset(); brandname = GENERATOR; } ////////////////////////////// // // Function::~Function -- // Function::~Function() { } ////////////////////////////// // // Function::action -- // void Function::action(void) { outputValue = generatingFunction(timeVariable); timeVariable += 1.0; } ////////////////////////////// // // Function::output -- // sampleType Function::output(int channel) { return outputValue; } ////////////////////////////// // // Function::printState -- // void Function::printState(void) { } ////////////////////////////// // // Function::reset -- // default variable: newTime = 0; // void Function::reset(double newTime) { timeVariable = newTime; } ////////////////////////////// // // Function::setFunction -- // void Function::setFunction(funcPtr aNewFunction) { generatingFunction = aNewFunction; } // md5sum: bc7a4cdf78f6123b94156bf3ab4a06ee Function.cpp [20010708]