*
*/
/*--------------------------------------------------------------------------*/
-
-#include "execvisitor.hxx"
#include "double.hxx"
#include "signalprocessingfunctions.hxx"
+#include "configvariable.hxx"
+#include "function.hxx"
extern "C"
{
/*--------------------------------------------------------------------------*/
-std::map<__threadId, Signalprocessingfunctions*> Signalprocessing::m_mapSignalprocessingfunctions;
+Signalprocessingfunctions* Signalprocessing::m_Signalprocessingfunctions;
void Signalprocessing::addSignalprocessingfunctions(Signalprocessingfunctions* _spFunction)
{
- types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
- m_mapSignalprocessingfunctions[pThread->getThreadId()] = _spFunction;
+ m_Signalprocessingfunctions = _spFunction;
}
void Signalprocessing::removeSignalprocessingfunctions()
{
- types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
- m_mapSignalprocessingfunctions.erase(pThread->getThreadId());
+ m_Signalprocessingfunctions = NULL;
}
Signalprocessingfunctions* Signalprocessing::getSignalprocessingfunctions()
{
- types::ThreadId* pThread = ConfigVariable::getLastRunningThread();
- return m_mapSignalprocessingfunctions[pThread->getThreadId()];
+ return m_Signalprocessingfunctions;
}
-Signalprocessingfunctions::Signalprocessingfunctions(std::wstring callerName)
+Signalprocessingfunctions::Signalprocessingfunctions(const std::string& callerName)
{
- m_wstrCaller = callerName;
+ m_strCaller = callerName;
m_pCallDgetx = NULL;
m_pCallDgety = NULL;
m_pStringDgetyStatic = NULL;
// init static functions
- if (callerName == L"corr")
+ if (callerName == "corr")
{
- m_staticFunctionMap[L"corexx"] = (void*) C2F(corexx);
- m_staticFunctionMap[L"corexy"] = (void*) C2F(corexy);
+ m_staticFunctionMap["corexx"] = (void*)C2F(corexx);
+ m_staticFunctionMap["corexy"] = (void*)C2F(corexy);
}
}
ConfigVariable::EntryPointStr* func = ConfigVariable::getEntryPoint(m_pStringDgetxDyn->get(0));
if (func == NULL)
{
- sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringDgetxDyn->get(0));
+ sprintf(errorMsg, _("Undefined function '%ls'.\n"), m_pStringDgetxDyn->get(0));
throw ast::InternalError(errorMsg);
}
((dgetx_f_t)(func->functionPtr))(x, siz, iss);
ConfigVariable::EntryPointStr* func = ConfigVariable::getEntryPoint(m_pStringDgetyDyn->get(0));
if (func == NULL)
{
- sprintf(errorMsg, _("Undefined fonction '%ls'.\n"), m_pStringDgetyDyn->get(0));
+ sprintf(errorMsg, _("Undefined function '%ls'.\n"), m_pStringDgetyDyn->get(0));
throw ast::InternalError(errorMsg);
}
((dgety_f_t)(func->functionPtr))(y, siz, iss);
int one = 1;
int iRetCount = 1;
- typed_list in;
- typed_list out;
+ types::typed_list in;
+ types::typed_list out;
types::optional_list opt;
- ast::ExecVisitor execFunc;
types::Double* pDblY = new types::Double(*siz);
in.push_back(m_FArgs[i]);
}
- bool bOk = m_pCallDgety->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ bool bOk = m_pCallDgety->call(in, opt, iRetCount, out) == types::Function::OK;
for (int i = 0; i < (int)m_FArgs.size(); i++)
{
if (out.size() != iRetCount)
{
- char* pstrName = wide_string_to_UTF8(m_pCallDgety->getName().c_str());
+ const char* pstrName = m_pCallDgety->getName().c_str();
sprintf(errorMsg, _("%s: Wrong number of input argument(s): %d expected.\n"), pstrName, iRetCount);
- FREE(pstrName);
throw ast::InternalError(errorMsg);
}
if (out[0]->isDouble() == false)
{
- char* pstrName = wide_string_to_UTF8(m_pCallDgety->getName().c_str());
+ const char* pstrName = m_pCallDgety->getName().c_str();
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
- FREE(pstrName);
throw ast::InternalError(errorMsg);
}
types::Double* pDblOut = out[0]->getAs<types::Double>();
if (pDblOut->isComplex())
{
- char* pstrName = wide_string_to_UTF8(m_pCallDgety->getName().c_str());
+ const char* pstrName = m_pCallDgety->getName().c_str();
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
- FREE(pstrName);
throw ast::InternalError(errorMsg);
}
int one = 1;
int iRetCount = 1;
- typed_list in;
- typed_list out;
+ types::typed_list in;
+ types::typed_list out;
types::optional_list opt;
- ast::ExecVisitor execFunc;
types::Double* pDblX = new types::Double(*siz);
in.push_back(m_FArgs[i]);
}
- bool bOk = m_pCallDgetx->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
+ bool bOk = m_pCallDgetx->call(in, opt, iRetCount, out) == types::Function::OK;
for (int i = 0; i < (int)m_FArgs.size(); i++)
{
if (out.size() != iRetCount)
{
- char* pstrName = wide_string_to_UTF8(m_pCallDgetx->getName().c_str());
+ const char* pstrName = m_pCallDgetx->getName().c_str();
sprintf(errorMsg, _("%s: Wrong number of input argument(s): %d expected.\n"), pstrName, iRetCount);
- FREE(pstrName);
throw ast::InternalError(errorMsg);
}
if (out[0]->isDouble() == false)
{
- char* pstrName = wide_string_to_UTF8(m_pCallDgetx->getName().c_str());
+ const char* pstrName = m_pCallDgetx->getName().c_str();
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
- FREE(pstrName);
throw ast::InternalError(errorMsg);
}
types::Double* pDblOut = out[0]->getAs<types::Double>();
if (pDblOut->isComplex())
{
- char* pstrName = wide_string_to_UTF8(m_pCallDgetx->getName().c_str());
+ const char* pstrName = m_pCallDgetx->getName().c_str();
sprintf(errorMsg, _("%s: Wrong type for output argument #%d: Real matrix expected.\n"), pstrName, 1);
- FREE(pstrName);
throw ast::InternalError(errorMsg);
}