Commit 3c2ec469 authored by Ken Martin's avatar Ken Martin
Browse files

mods to the user define functions

parent 6a5a5a58
......@@ -41,13 +41,17 @@ public:
void SetStartMethod(void (*f)(void *), void *arg);
void SetEndMethod(void (*f)(void *), void *arg);
void SetStartMethodArgDelete(void (*f)(void *));
void SetEndMethodArgDelete(void (*f)(void *));
protected:
vlDataSet *Input;
char Updating;
void (*StartMethod)(void *);
void (*StartMethodArgDelete)(void *);
void *StartMethodArg;
void (*EndMethod)(void *);
void (*EndMethodArgDelete)(void *);
void *EndMethodArg;
vlTimeStamp ExecuteTime;
......
......@@ -22,8 +22,10 @@ vlFilter::vlFilter()
this->Input = NULL;
this->StartMethod = NULL;
this->StartMethodArgDelete = NULL;
this->StartMethodArg = NULL;
this->EndMethod = NULL;
this->EndMethodArgDelete = NULL;
this->EndMethodArg = NULL;
this->Updating = 0;
......@@ -79,6 +81,11 @@ void vlFilter::SetStartMethod(void (*f)(void *), void *arg)
{
if ( f != this->StartMethod || arg != this->StartMethodArg )
{
// delete the current arg if there is one and a delete meth
if ((this->StartMethodArg)&&(this->StartMethodArgDelete))
{
(*this->StartMethodArgDelete)(this->StartMethodArg);
}
this->StartMethod = f;
this->StartMethodArg = arg;
this->_Modified();
......@@ -92,12 +99,39 @@ void vlFilter::SetEndMethod(void (*f)(void *), void *arg)
{
if ( f != this->EndMethod || arg != this->EndMethodArg )
{
// delete the current arg if there is one and a delete meth
if ((this->EndMethodArg)&&(this->EndMethodArgDelete))
{
(*this->EndMethodArgDelete)(this->EndMethodArg);
}
this->EndMethod = f;
this->EndMethodArg = arg;
this->_Modified();
}
}
// Description:
// Set the arg delete method. This is used to free user memory.
void vlFilter::SetStartMethodArgDelete(void (*f)(void *))
{
if ( f != this->StartMethodArgDelete)
{
this->StartMethodArgDelete = f;
this->_Modified();
}
}
// Description:
// Set the arg delete method. This is used to free user memory.
void vlFilter::SetEndMethodArgDelete(void (*f)(void *))
{
if ( f != this->EndMethodArgDelete)
{
this->EndMethodArgDelete = f;
this->_Modified();
}
}
void vlFilter::Execute()
{
cerr << "Execution of filter should be in derived class" << "\n";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment