itom 2.0.0
D:/git-itom/sources/itom/common/apiFunctionsInc.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2013, Institut für Technische Optik (ITO),
00005     Universität Stuttgart, Germany
00006 
00007     This file is part of itom and its software development toolkit (SDK).
00008 
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013    
00014     In addition, as a special exception, the Institut für Technische
00015     Optik (ITO) gives you certain additional rights.
00016     These rights are described in the ITO LGPL Exception version 1.0,
00017     which can be found in the file LGPL_EXCEPTION.txt in this package.
00018 
00019     itom is distributed in the hope that it will be useful, but
00020     WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00022     General Public Licence for more details.
00023 
00024     You should have received a copy of the GNU Library General Public License
00025     along with itom. If not, see <http://www.gnu.org/licenses/>.
00026 *********************************************************************** */
00027 
00028 #ifndef APIFUNCTIONSINC_H
00029 #define APIFUNCTIONSINC_H
00030 
00031 #ifndef Q_MOC_RUN
00032 namespace ito 
00033 {
00034 
00035     #if defined(ITOM_IMPORT_API) && !defined(ITOM_CORE)
00036         void **ITOM_API_FUNCS;
00037     #else
00038         extern void **ITOM_API_FUNCS;
00039     #endif
00040 
00061 
00062 
00068     #define apiFilterGetFunc \
00069         (*(ito::RetVal (*)(const QString &name, ito::AddInAlgo::FilterDef *&filterDef)) ito::ITOM_API_FUNCS[0])
00070     
00072 
00085     #define apiFilterCall \
00086         (*(ito::RetVal (*)(const QString &name, QVector<ito::ParamBase> *paramsMand, QVector<ito::ParamBase> *paramsOpt, QVector<ito::ParamBase> *paramsOut)) ito::ITOM_API_FUNCS[1])
00087 
00088     #define apiFilterParam \
00089         (*(ito::RetVal (*)(const QString &name, QVector<ito::Param> *paramsMand, QVector<ito::Param> *paramsOpt, QVector<ito::Param> *paramsOut)) ito::ITOM_API_FUNCS[2])
00090 
00091     #define apiFilterParamBase \
00092         (*(ito::RetVal (*)(const QString &name, QVector<ito::ParamBase> *paramsMand, QVector<ito::ParamBase> *paramsOpt, QVector<ito::ParamBase> *paramsOut)) ito::ITOM_API_FUNCS[3])
00093     
00095 
00105     #define apiAddInGetInitParams \
00106         (*(ito::RetVal (*)(const QString &pluginName, const int pluginType, int *pluginIdx, QVector<ito::Param> *&paramsMand, QVector<ito::Param> *&paramsOpt)) ito::ITOM_API_FUNCS[4])
00107 
00109 
00122     #define apiAddInOpenActuator \
00123         (*(ito::RetVal (*)(const QString &pluginName, const int pluginIdx, const bool autoLoadParams, QVector<ito::ParamBase> *paramsMand, QVector<ito::ParamBase> *paramsOpt, ito::AddInActuator *&instance)) ito::ITOM_API_FUNCS[5])
00124 
00126 
00139     #define apiAddInOpenDataIO \
00140         (*(ito::RetVal (*)(const QString &pluginName, const int pluginIdx, const bool autoLoadParams, QVector<ito::ParamBase> *paramsMand, QVector<ito::ParamBase> *paramsOpt, ito::AddInDataIO *&instance)) ito::ITOM_API_FUNCS[6])
00141 
00143 
00147     #define apiAddInClose \
00148         (*(ito::RetVal (*)(ito::AddInBase *instance)) ito::ITOM_API_FUNCS[31])
00149 
00151 
00158     #define apiValidateStringMeta \
00159         (*(ito::RetVal (*)(const ito::StringMeta *meta, const char* value, bool mandatory)) ito::ITOM_API_FUNCS[7])
00160 
00162 
00168     #define apiValidateDoubleMeta \
00169         (*(ito::RetVal (*)(const ito::DoubleMeta *meta, double value)) ito::ITOM_API_FUNCS[8])
00170 
00172 
00178     #define apiValidateIntMeta \
00179         (*(ito::RetVal (*)(const ito::IntMeta *meta, int value)) ito::ITOM_API_FUNCS[9])
00180 
00182 
00188     #define apiValidateCharMeta \
00189         (*(ito::RetVal (*)(const ito::CharMeta *meta, char value)) ito::ITOM_API_FUNCS[10])
00190 
00192 
00199     #define apiValidateDoubleArrayMeta \
00200         (*(ito::RetVal (*)(const ito::ParamMeta *meta, const double* values, size_t len)) ito::ITOM_API_FUNCS[28])
00201 
00203 
00210     #define apiValidateIntArrayMeta \
00211         (*(ito::RetVal (*)(const ito::ParamMeta *meta, const int* values, size_t len)) ito::ITOM_API_FUNCS[26])
00212 
00214 
00221     #define apiValidateCharArrayMeta \
00222         (*(ito::RetVal (*)(const ito::ParamMeta *meta, const char* values, size_t len)) ito::ITOM_API_FUNCS[25])
00223 
00225 
00233     #define apiValidateHWMeta \
00234         (*(ito::RetVal (*)(const ito::HWMeta *meta, ito::AddInBase *value, bool mandatory)) ito::ITOM_API_FUNCS[11])
00235 
00236     #define apiCompareParam \
00237         (*(ito::tCompareResult (*)(const ito::Param &paramTemplate, const ito::Param &param, ito::RetVal &ret)) ito::ITOM_API_FUNCS[12])
00238     
00240 
00257     #define apiValidateParam \
00258         (*(ito::RetVal (*)(const ito::Param &templateParam, const ito::ParamBase &param, bool strict, bool mandatory)) ito::ITOM_API_FUNCS[13])
00259 
00261 
00279     #define apiValidateAndCastParam \
00280         (*(ito::RetVal (*)(const ito::Param &templateParam, const ito::ParamBase &param, bool strict, bool mandatory, bool roundToStep)) ito::ITOM_API_FUNCS[25])
00281     
00283 
00294     #define apiGetParamFromMapByKey \
00295         (*(ito::RetVal (*)(QMap<QString,ito::Param> &paramMap, const QString &key, QMap<QString,ito::Param>::iterator &found, bool errorIfReadOnly)) ito::ITOM_API_FUNCS[14])
00296     
00298 
00316     #define apiParseParamName \
00317         (*(ito::RetVal (*)(const QString &name, QString &paramName, bool &hasIndex, int &index, QString &additionalTag)) ito::ITOM_API_FUNCS[15])
00318 
00319     #define apiGetItemFromParamArray \
00320         (*(ito::RetVal (*)(const ito::Param &arrayParam, const int index, ito::Param &itemParam)) ito::ITOM_API_FUNCS[16])
00321 
00322     #define apiGetParam \
00323         (*(ito::Param (*)(const ito::Param &param, const bool hasIndex, const int index, ito::RetVal &ret)) ito::ITOM_API_FUNCS[20])
00324     
00326 
00334     #define apiUpdateParameters \
00335         (*(ito::RetVal (*)(QMap<QString, ito::Param> &paramMap, const QVector<QSharedPointer<ito::ParamBase> > &values)) ito::ITOM_API_FUNCS[23])
00336 
00337     #define apiSaveQLIST2XML \
00338         (*(ito::RetVal (*)(QMap<QString, ito::Param> *paramList , QString id, QFile &paramFile)) ito::ITOM_API_FUNCS[17])
00339 
00340     #define apiLoadXML2QLIST \
00341         (*(ito::RetVal (*)(QMap<QString, ito::Param> *paramList , QString id, QFile &paramFile)) ito::ITOM_API_FUNCS[18])
00342     
00344 
00360     #define apiCreateFromDataObject \
00361         (* (ito::DataObject* (*)(const ito::DataObject *dObj, int nrDims, ito::tDataType type, int *sizeLimits, ito::RetVal *retval)) ito::ITOM_API_FUNCS[19])
00362 
00364 
00381     #define apiCreateFromNamedDataObject \
00382         (* (ito::DataObject* (*)(const ito::DataObject *dObj, int nrDims, ito::tDataType type, const char *name, int *sizeLimits, ito::RetVal *retval)) ito::ITOM_API_FUNCS[24])
00383     
00385 
00390     #define apiGetCurrentWorkingDir \
00391         (* (QString (*)(void)) ito::ITOM_API_FUNCS[21])
00392     
00394 
00403     #define apiShowConfigurationDialog \
00404         (* (ito::RetVal (*)(ito::AddInBase *plugin, ito::AbstractAddInConfigDialog *configDialogInstance)) ito::ITOM_API_FUNCS[22])
00405 
00406 
00408 
00419     #define apiSendParamToPyWorkspace \
00420         (* (ito::RetVal (*)(const QString &varname, const QSharedPointer<ito::ParamBase> &value)) ito::ITOM_API_FUNCS[29])
00421 
00423 
00434     #define apiSendParamsToPyWorkspace \
00435         (* (ito::RetVal (*)(const QStringList &varnames, const QVector<QSharedPointer<ito::ParamBase> > &values)) ito::ITOM_API_FUNCS[30])
00436 
00440 //#if defined(ITOM_IMPORT_API)
00441 //static int importItomApi(void** apiArray)
00442 //{
00443 //    ito::ITOM_API_FUNCS = apiArray;
00444 //    return 0;
00445 //}
00446 //#endif
00447 
00448 };
00449 
00450 #endif //Q_MOC_RUN
00451 
00452 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends