diff --git a/AUTHORS.txt b/AUTHORS.txt index b4d8399d..53a973d7 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,2 +1,2 @@ -Pelipenko Ivan (peri4) peri4ko@gmail.com -Bychkov Andrey (blizer) wapmobil@gmail.com +Pelipenko Ivan (peri4) peri4ko@yandex.ru +Bychkov Andrey () work.a.b@yandex.ru diff --git a/CMakeLists.txt b/CMakeLists.txt index 9fb4bd90..f966417f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ project(pip) cmake_minimum_required(VERSION 2.6) include_directories(${CMAKE_CURRENT_SOURCE_DIR} .) include(CheckFunctionExists) -set(VERSION "0.0308") +set(VERSION "0.0400") set(SOVERSION ${VERSION}) set(CMAKE_BUILD_TYPE "Release") set(LIBS) @@ -83,7 +83,8 @@ else () if (NOT APPLE) list(APPEND LIBS rt) endif() - add_definitions("-Wall -g3") + add_definitions("-Wall") + add_definitions("-g3") add_library(pip SHARED ${CPPS}) endif () endif () @@ -92,11 +93,11 @@ target_link_libraries(pip ${LIBS}) # Test program -#find_package(Qt4 REQUIRED) -#include_directories(${QT_INCLUDES}) +find_package(Qt4 REQUIRED) +include_directories(${QT_INCLUDES}) add_executable(pip_test "main.cpp") -#target_link_libraries(pip_test pip ${QT_QTCORE_LIBRARY}) -target_link_libraries(pip_test pip) +target_link_libraries(pip_test pip ${QT_QTCORE_LIBRARY}) +#target_link_libraries(pip_test pip) add_subdirectory(system_test) diff --git a/Doxyfile b/Doxyfile index 6a696887..baaafbaa 100644 --- a/Doxyfile +++ b/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = PIP # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.3.8 +PROJECT_NUMBER = 0.4.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/clean.bat b/clean.bat old mode 100755 new mode 100644 diff --git a/code_model_generator/main.cpp b/code_model_generator/main.cpp index 92ba0c98..a082c8f9 100644 --- a/code_model_generator/main.cpp +++ b/code_model_generator/main.cpp @@ -112,7 +112,7 @@ void writeModel(PICodeParser & parser, const PIString out) { PIFile f(out + ".cpp"); f.clear(); f.open(PIIODevice::WriteOnly); - f << "// Generated by \"PIP Code model generator\" " << currentDateTime().toString("dd.MM.yyyy hh:mm:ss\n\n"); + f << "// Generated by \"PIP Code model generator\" " << PIDateTime::current().toString("dd.MM.yyyy hh:mm:ss\n\n"); f << "#include \n#include \"" << out << ".h\"\n\nusing namespace PICodeInfo;\n\n"; piForeachC (PIString & i, inc_files) f << "#include \"" << i << "\"\n"; @@ -180,7 +180,7 @@ void writeModel(PICodeParser & parser, const PIString out) { f.setPath(out + ".h"); f.clear(); f.open(PIIODevice::WriteOnly); - f << "// Generated by \"PIP Code model generator\" " << currentDateTime().toString("dd.MM.yyyy hh:mm:ss\n\n"); + f << "// Generated by \"PIP Code model generator\" " << PIDateTime::current().toString("dd.MM.yyyy hh:mm:ss\n\n"); f << "#ifndef " << defname << "\n#define " << defname << "\n\n"; f << "#include \"pivariant.h\"\n#include \"picodeinfo.h\"\n\n"; piForeachC (PICodeParser::Entity * e, ventities) diff --git a/code_model_generator/main_test.cpp b/code_model_generator/main_test.cpp index f307d860..103aeb4f 100644 --- a/code_model_generator/main_test.cpp +++ b/code_model_generator/main_test.cpp @@ -37,11 +37,11 @@ int main(int argc, char * argv[]) { execFunction(&tm, "stop"); execFunction(&tm, "stop_"); piMSleep(1000);*/ - typedef std::pair mpair; + typedef PIMap::value_type mpair; piForeachC (mpair & i, *(PICodeInfo::classesInfo)) piCout << *i.second; piCout << "\n\n"; - typedef std::pair epair; + typedef PIMap::value_type epair; piForeachC (epair & i, *(PICodeInfo::enumsInfo)) piCout << *i.second; return 0; diff --git a/code_model_generator/test.cpp b/code_model_generator/test.cpp new file mode 100644 index 00000000..c3242a40 --- /dev/null +++ b/code_model_generator/test.cpp @@ -0,0 +1,7084 @@ +// Generated by "PIP Code model generator" 29.04.2014 18:03:05 + +#include +#include "test.h" + +using namespace PICodeInfo; + +#include "piusb.h" +#include "picli.h" +#include "pitime.h" +#include "pipeer.h" +#include "pimath.h" +#include "pifile.h" +#include "pichar.h" +#include "pitimer.h" +#include "pimutex.h" +#include "picodec.h" +#include "pithread.h" +#include "pistring.h" +#include "piserial.h" +#include "piobject.h" +#include "piconfig.h" +#include "pivariant.h" +#include "pisignals.h" +#include "piprocess.h" +#include "pimonitor.h" +#include "piconsole.h" +#include "piprotocol.h" +#include "piiodevice.h" +#include "piincludes.h" +#include "piethernet.h" +#include "pibitarray.h" +#include "pievaluator.h" +#include "pibytearray.h" +#include "pibinarylog.h" +#include "picollection.h" +#include "pikbdlistener.h" +#include "pidiagnostics.h" +#include "pisystemmonitor.h" +#include "pimultiprotocol.h" +#include "pipacketextractor.h" + + +PIVariant execFunction(PIMutex * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "lock") == 0) {object->lock(); return PIVariant();} + if (strcmp(function, "unlock") == 0) {object->unlock(); return PIVariant();} + if (strcmp(function, "tryLock") == 0) {return PIVariant::fromValue(object->tryLock());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIMutex\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIBitArray * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "bitSize") == 0) {return PIVariant::fromValue(object->bitSize());} + if (strcmp(function, "byteSize") == 0) {return PIVariant::fromValue(object->byteSize());} + if (strcmp(function, "data") == 0) {return PIVariant::fromValue(object->data());} + if (strcmp(function, "toUChar") == 0) {return PIVariant::fromValue(object->toUChar());} + if (strcmp(function, "toUShort") == 0) {return PIVariant::fromValue(object->toUShort());} + if (strcmp(function, "toUInt") == 0) {return PIVariant::fromValue(object->toUInt());} + if (strcmp(function, "toULong") == 0) {return PIVariant::fromValue(object->toULong());} + if (strcmp(function, "toULLong") == 0) {return PIVariant::fromValue(object->toULLong());} + if (strcmp(function, "at") == 0) {return PIVariant::fromValue(object->at(arg0.toValue()));} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIBitArray\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIHuffman * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "compress") == 0) {return PIVariant::fromValue >(object->compress(arg0.toValue >()));} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIHuffman\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIByteArray * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "resized") == 0) {return PIVariant::fromValue(object->resized(arg0.toValue()));} + if (strcmp(function, "toBase64") == 0) {return PIVariant::fromValue(object->toBase64());} + if (strcmp(function, "fromBase64") == 0) {return PIVariant::fromValue(object->fromBase64());} + if (strcmp(function, "compressedRLE") == 0) {return PIVariant::fromValue(object->compressedRLE(arg0.toValue()));} + if (strcmp(function, "decompressedRLE") == 0) {return PIVariant::fromValue(object->decompressedRLE(arg0.toValue()));} + if (strcmp(function, "checksumPlain8") == 0) {return PIVariant::fromValue(object->checksumPlain8());} + if (strcmp(function, "checksumPlain32") == 0) {return PIVariant::fromValue(object->checksumPlain32());} + if (strcmp(function, "checksumCRC8") == 0) {return PIVariant::fromValue(object->checksumCRC8());} + if (strcmp(function, "checksumCRC16") == 0) {return PIVariant::fromValue(object->checksumCRC16());} + if (strcmp(function, "checksumCRC32") == 0) {return PIVariant::fromValue(object->checksumCRC32());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIByteArray\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIChar * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "isDigit") == 0) {return PIVariant::fromValue(object->isDigit());} + if (strcmp(function, "isHex") == 0) {return PIVariant::fromValue(object->isHex());} + if (strcmp(function, "isGraphical") == 0) {return PIVariant::fromValue(object->isGraphical());} + if (strcmp(function, "isControl") == 0) {return PIVariant::fromValue(object->isControl());} + if (strcmp(function, "isLower") == 0) {return PIVariant::fromValue(object->isLower());} + if (strcmp(function, "isUpper") == 0) {return PIVariant::fromValue(object->isUpper());} + if (strcmp(function, "isPrint") == 0) {return PIVariant::fromValue(object->isPrint());} + if (strcmp(function, "isSpace") == 0) {return PIVariant::fromValue(object->isSpace());} + if (strcmp(function, "isAlpha") == 0) {return PIVariant::fromValue(object->isAlpha());} + if (strcmp(function, "isAscii") == 0) {return PIVariant::fromValue(object->isAscii());} + if (strcmp(function, "toInt") == 0) {return PIVariant::fromValue(object->toInt());} + if (strcmp(function, "toWCharPtr") == 0) {return PIVariant::fromValue(object->toWCharPtr());} + if (strcmp(function, "toCharPtr") == 0) {return PIVariant::fromValue(object->toCharPtr());} + if (strcmp(function, "toWChar") == 0) {return PIVariant::fromValue(object->toWChar());} + if (strcmp(function, "toAscii") == 0) {return PIVariant::fromValue(object->toAscii());} + if (strcmp(function, "unicode16Code") == 0) {return PIVariant::fromValue(object->unicode16Code());} + if (strcmp(function, "toUpper") == 0) {return PIVariant::fromValue(object->toUpper());} + if (strcmp(function, "toLower") == 0) {return PIVariant::fromValue(object->toLower());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIChar\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIString * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "mid") == 0) {return PIVariant::fromValue(object->mid(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "left") == 0) {return PIVariant::fromValue(object->left(arg0.toValue()));} + if (strcmp(function, "right") == 0) {return PIVariant::fromValue(object->right(arg0.toValue()));} + if (strcmp(function, "trimmed") == 0) {return PIVariant::fromValue(object->trimmed());} + if (strcmp(function, "replaced") == 0) {return PIVariant::fromValue(object->replaced(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "replaced") == 0) {return PIVariant::fromValue(object->replaced(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "replaceAll") == 0) {return PIVariant::fromValue(object->replaceAll(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "reversed") == 0) {return PIVariant::fromValue(object->reversed());} + if (strcmp(function, "takeMid") == 0) {return PIVariant::fromValue(object->takeMid(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "takeLeft") == 0) {return PIVariant::fromValue(object->takeLeft(arg0.toValue()));} + if (strcmp(function, "takeRight") == 0) {return PIVariant::fromValue(object->takeRight(arg0.toValue()));} + if (strcmp(function, "takeSymbol") == 0) {return PIVariant::fromValue(object->takeSymbol());} + if (strcmp(function, "takeWord") == 0) {return PIVariant::fromValue(object->takeWord());} + if (strcmp(function, "takeCWord") == 0) {return PIVariant::fromValue(object->takeCWord());} + if (strcmp(function, "takeLine") == 0) {return PIVariant::fromValue(object->takeLine());} + if (strcmp(function, "takeNumber") == 0) {return PIVariant::fromValue(object->takeNumber());} + if (strcmp(function, "takeRange") == 0) {return PIVariant::fromValue(object->takeRange(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "lengthAscii") == 0) {return PIVariant::fromValue(object->lengthAscii());} + if (strcmp(function, "data") == 0) {return PIVariant::fromValue(object->data());} + if (strcmp(function, "stdString") == 0) {return PIVariant::fromValue(object->stdString());} + if (strcmp(function, "toByteArray") == 0) {return PIVariant::fromValue(object->toByteArray());} + if (strcmp(function, "split") == 0) {return PIVariant::fromValue(object->split(arg0.toValue()));} + if (strcmp(function, "toUpperCase") == 0) {return PIVariant::fromValue(object->toUpperCase());} + if (strcmp(function, "toLowerCase") == 0) {return PIVariant::fromValue(object->toLowerCase());} + if (strcmp(function, "toNativeDecimalPoints") == 0) {return PIVariant::fromValue(object->toNativeDecimalPoints());} + if (strcmp(function, "find") == 0) {return PIVariant::fromValue(object->find(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "find") == 0) {return PIVariant::fromValue(object->find(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "find") == 0) {return PIVariant::fromValue(object->find(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "find") == 0) {return PIVariant::fromValue(object->find(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "findLast") == 0) {return PIVariant::fromValue(object->findLast(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "findLast") == 0) {return PIVariant::fromValue(object->findLast(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "findLast") == 0) {return PIVariant::fromValue(object->findLast(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "findLast") == 0) {return PIVariant::fromValue(object->findLast(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "findWord") == 0) {return PIVariant::fromValue(object->findWord(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "findCWord") == 0) {return PIVariant::fromValue(object->findCWord(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "startsWith") == 0) {return PIVariant::fromValue(object->startsWith(arg0.toValue()));} + if (strcmp(function, "endsWith") == 0) {return PIVariant::fromValue(object->endsWith(arg0.toValue()));} + if (strcmp(function, "length") == 0) {return PIVariant::fromValue(object->length());} + if (strcmp(function, "isEmpty") == 0) {return PIVariant::fromValue(object->isEmpty());} + if (strcmp(function, "toBool") == 0) {return PIVariant::fromValue(object->toBool());} + if (strcmp(function, "toChar") == 0) {return PIVariant::fromValue(object->toChar());} + if (strcmp(function, "toShort") == 0) {return PIVariant::fromValue(object->toShort(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "toUShort") == 0) {return PIVariant::fromValue(object->toUShort(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "toInt") == 0) {return PIVariant::fromValue(object->toInt(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "toUInt") == 0) {return PIVariant::fromValue(object->toUInt(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "toLong") == 0) {return PIVariant::fromValue(object->toLong(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "toULong") == 0) {return PIVariant::fromValue(object->toULong(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "toLLong") == 0) {return PIVariant::fromValue(object->toLLong(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "toULLong") == 0) {return PIVariant::fromValue(object->toULLong(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "toFloat") == 0) {return PIVariant::fromValue(object->toFloat());} + if (strcmp(function, "toDouble") == 0) {return PIVariant::fromValue(object->toDouble());} + if (strcmp(function, "toLDouble") == 0) {return PIVariant::fromValue(object->toLDouble());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIString\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIStringList * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "join") == 0) {return PIVariant::fromValue(object->join(arg0.toValue()));} + if (strcmp(function, "contentSize") == 0) {return PIVariant::fromValue(object->contentSize());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIStringList\"!"; + return PIVariant(); +} + +PIVariant execFunction(PISystemTime * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "toSeconds") == 0) {return PIVariant::fromValue(object->toSeconds());} + if (strcmp(function, "toMilliseconds") == 0) {return PIVariant::fromValue(object->toMilliseconds());} + if (strcmp(function, "toMicroseconds") == 0) {return PIVariant::fromValue(object->toMicroseconds());} + if (strcmp(function, "toNanoseconds") == 0) {return PIVariant::fromValue(object->toNanoseconds());} + if (strcmp(function, "sleep") == 0) {object->sleep(); return PIVariant();} + if (strcmp(function, "abs") == 0) {return PIVariant::fromValue(object->abs());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PISystemTime\"!"; + return PIVariant(); +} + +PIVariant execFunction(PITime * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "toString") == 0) {return PIVariant::fromValue(object->toString(arg0.toValue()));} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in struct \"PITime\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIDate * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "toString") == 0) {return PIVariant::fromValue(object->toString(arg0.toValue()));} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in struct \"PIDate\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIDateTime * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "normalized") == 0) {return PIVariant::fromValue(object->normalized());} + if (strcmp(function, "normalize") == 0) {object->normalize(); return PIVariant();} + if (strcmp(function, "toString") == 0) {return PIVariant::fromValue(object->toString(arg0.toValue()));} + if (strcmp(function, "toSecondSinceEpoch") == 0) {return PIVariant::fromValue(object->toSecondSinceEpoch());} + if (strcmp(function, "toSystemTime") == 0) {return PIVariant::fromValue(object->toSystemTime());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in struct \"PIDateTime\"!"; + return PIVariant(); +} + +PIVariant execFunction(Solver * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "solve") == 0) {object->solve(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "fromTF") == 0) {object->fromTF(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setMethod") == 0) {object->setMethod(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setTime") == 0) {object->setTime(arg0.toValue()); return PIVariant();} + if (strcmp(function, "solveEyler1") == 0) {object->solveEyler1(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "solveEyler2") == 0) {object->solveEyler2(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "solveRK4") == 0) {object->solveRK4(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "solveABM2") == 0) {object->solveABM2(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "solveABM3") == 0) {object->solveABM3(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "solveABM4") == 0) {object->solveABM4(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "solvePA") == 0) {object->solvePA(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "solvePA2") == 0) {object->solvePA2(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "solvePA3") == 0) {object->solvePA3(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "solvePA4") == 0) {object->solvePA4(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "solvePA5") == 0) {object->solvePA5(arg0.toValue(), arg1.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"Solver\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIFFT * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "calcFFT") == 0) {return PIVariant::fromValue * >(object->calcFFT(arg0.toValue >()));} + if (strcmp(function, "calcFFT") == 0) {return PIVariant::fromValue * >(object->calcFFT(arg0.toValue >()));} + if (strcmp(function, "calcFFTinverse") == 0) {return PIVariant::fromValue * >(object->calcFFTinverse(arg0.toValue >()));} + if (strcmp(function, "calcHilbert") == 0) {return PIVariant::fromValue * >(object->calcHilbert(arg0.toValue >()));} + if (strcmp(function, "getAmplitude") == 0) {return PIVariant::fromValue >(object->getAmplitude());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIFFT\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIVariant * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue()); return PIVariant();} + if (strcmp(function, "toBool") == 0) {return PIVariant::fromValue(object->toBool());} + if (strcmp(function, "toInt") == 0) {return PIVariant::fromValue(object->toInt());} + if (strcmp(function, "toLLong") == 0) {return PIVariant::fromValue(object->toLLong());} + if (strcmp(function, "toFloat") == 0) {return PIVariant::fromValue(object->toFloat());} + if (strcmp(function, "toDouble") == 0) {return PIVariant::fromValue(object->toDouble());} + if (strcmp(function, "toLDouble") == 0) {return PIVariant::fromValue(object->toLDouble());} + if (strcmp(function, "toComplexd") == 0) {return PIVariant::fromValue(object->toComplexd());} + if (strcmp(function, "toComplexld") == 0) {return PIVariant::fromValue(object->toComplexld());} + if (strcmp(function, "toTime") == 0) {return PIVariant::fromValue(object->toTime());} + if (strcmp(function, "toDate") == 0) {return PIVariant::fromValue(object->toDate());} + if (strcmp(function, "toDateTime") == 0) {return PIVariant::fromValue(object->toDateTime());} + if (strcmp(function, "toSystemTime") == 0) {return PIVariant::fromValue(object->toSystemTime());} + if (strcmp(function, "toString") == 0) {return PIVariant::fromValue(object->toString());} + if (strcmp(function, "toStringList") == 0) {return PIVariant::fromValue(object->toStringList());} + if (strcmp(function, "toBitArray") == 0) {return PIVariant::fromValue(object->toBitArray());} + if (strcmp(function, "toByteArray") == 0) {return PIVariant::fromValue(object->toByteArray());} + if (strcmp(function, "type") == 0) {return PIVariant::fromValue(object->type());} + if (strcmp(function, "typeName") == 0) {return PIVariant::fromValue(object->typeName());} + if (strcmp(function, "isValid") == 0) {return PIVariant::fromValue(object->isValid());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIVariant\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIObject * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "name") == 0) {return PIVariant::fromValue(object->name());} + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "debug") == 0) {return PIVariant::fromValue(object->debug());} + if (strcmp(function, "setName") == 0) {object->setName(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setDebug") == 0) {object->setDebug(arg0.toValue()); return PIVariant();} + if (strcmp(function, "properties") == 0) {return PIVariant::fromValue >(object->properties());} + if (strcmp(function, "propertiesCount") == 0) {return PIVariant::fromValue(object->propertiesCount());} + if (strcmp(function, "property") == 0) {return PIVariant::fromValue(object->property(arg0.toValue()));} + if (strcmp(function, "setProperty") == 0) {object->setProperty(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "isPropertyExists") == 0) {return PIVariant::fromValue(object->isPropertyExists(arg0.toValue()));} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIObject\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIThread * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "start") == 0) {return PIVariant::fromValue(object->start());} + if (strcmp(function, "start") == 0) {return PIVariant::fromValue(object->start(arg0.toValue()));} + if (strcmp(function, "start") == 0) {return PIVariant::fromValue(object->start(arg0.toValue()));} + if (strcmp(function, "start") == 0) {return PIVariant::fromValue(object->start(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "startOnce") == 0) {return PIVariant::fromValue(object->startOnce());} + if (strcmp(function, "startOnce") == 0) {return PIVariant::fromValue(object->startOnce(arg0.toValue()));} + if (strcmp(function, "stop") == 0) {object->stop(); return PIVariant();} + if (strcmp(function, "stop") == 0) {object->stop(arg0.toValue()); return PIVariant();} + if (strcmp(function, "terminate") == 0) {object->terminate(); return PIVariant();} + if (strcmp(function, "setData") == 0) {object->setData(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setSlot") == 0) {object->setSlot(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setPriority") == 0) {object->setPriority(arg0.toValue()); return PIVariant();} + if (strcmp(function, "priority") == 0) {return PIVariant::fromValue(object->priority());} + if (strcmp(function, "isRunning") == 0) {return PIVariant::fromValue(object->isRunning());} + if (strcmp(function, "isStopping") == 0) {return PIVariant::fromValue(object->isStopping());} + if (strcmp(function, "waitForStart") == 0) {return PIVariant::fromValue(object->waitForStart());} + if (strcmp(function, "waitForStart") == 0) {return PIVariant::fromValue(object->waitForStart(arg0.toValue()));} + if (strcmp(function, "waitForFinish") == 0) {return PIVariant::fromValue(object->waitForFinish());} + if (strcmp(function, "waitForFinish") == 0) {return PIVariant::fromValue(object->waitForFinish(arg0.toValue()));} + if (strcmp(function, "needLockRun") == 0) {object->needLockRun(arg0.toValue()); return PIVariant();} + if (strcmp(function, "lock") == 0) {object->lock(); return PIVariant();} + if (strcmp(function, "unlock") == 0) {object->unlock(); return PIVariant();} + if (strcmp(function, "started") == 0) {object->started(); return PIVariant();} + if (strcmp(function, "stopped") == 0) {object->stopped(); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIThread\"!"; + return PIVariant(); +} + +PIVariant execFunction(PITimer * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "setData") == 0) {object->setData(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setSlot") == 0) {object->setSlot(arg0.toValue()); return PIVariant();} + if (strcmp(function, "interval") == 0) {return PIVariant::fromValue(object->interval());} + if (strcmp(function, "reset") == 0) {object->reset(); return PIVariant();} + if (strcmp(function, "start") == 0) {object->start(arg0.toValue()); return PIVariant();} + if (strcmp(function, "start") == 0) {object->start(arg0.toValue()); return PIVariant();} + if (strcmp(function, "deferredStart") == 0) {object->deferredStart(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "deferredStart") == 0) {object->deferredStart(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "stop") == 0) {object->stop(); return PIVariant();} + if (strcmp(function, "addDelimiter") == 0) {object->addDelimiter(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "removeDelimiter") == 0) {object->removeDelimiter(arg0.toValue()); return PIVariant();} + if (strcmp(function, "removeDelimiter") == 0) {object->removeDelimiter(arg0.toValue()); return PIVariant();} + if (strcmp(function, "removeDelimiter") == 0) {object->removeDelimiter(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setDelimiterValue") == 0) {object->setDelimiterValue(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setDelimiterValue") == 0) {object->setDelimiterValue(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setDelimiterValue") == 0) {object->setDelimiterValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "delimiterValue") == 0) {return PIVariant::fromValue(object->delimiterValue(arg0.toValue()));} + if (strcmp(function, "delimiterValue") == 0) {return PIVariant::fromValue(object->delimiterValue(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "clearDelimiters") == 0) {object->clearDelimiters(); return PIVariant();} + if (strcmp(function, "elapsed_n") == 0) {return PIVariant::fromValue(object->elapsed_n());} + if (strcmp(function, "elapsed_u") == 0) {return PIVariant::fromValue(object->elapsed_u());} + if (strcmp(function, "elapsed_m") == 0) {return PIVariant::fromValue(object->elapsed_m());} + if (strcmp(function, "elapsed_s") == 0) {return PIVariant::fromValue(object->elapsed_s());} + if (strcmp(function, "reset_time_n") == 0) {return PIVariant::fromValue(object->reset_time_n());} + if (strcmp(function, "reset_time_u") == 0) {return PIVariant::fromValue(object->reset_time_u());} + if (strcmp(function, "reset_time_m") == 0) {return PIVariant::fromValue(object->reset_time_m());} + if (strcmp(function, "reset_time_s") == 0) {return PIVariant::fromValue(object->reset_time_s());} + if (strcmp(function, "reset_time") == 0) {return PIVariant::fromValue(object->reset_time());} + if (strcmp(function, "timeout") == 0) {object->timeout(arg0.toValue(), arg1.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PITimer\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIKbdListener * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "data") == 0) {return PIVariant::fromValue(object->data());} + if (strcmp(function, "setData") == 0) {object->setData(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setSlot") == 0) {object->setSlot(arg0.toValue()); return PIVariant();} + if (strcmp(function, "exitCaptured") == 0) {return PIVariant::fromValue(object->exitCaptured());} + if (strcmp(function, "exitKey") == 0) {return PIVariant::fromValue(object->exitKey());} + if (strcmp(function, "isActive") == 0) {return PIVariant::fromValue(object->isActive());} + if (strcmp(function, "enableExitCapture") == 0) {object->enableExitCapture(); return PIVariant();} + if (strcmp(function, "enableExitCapture") == 0) {object->enableExitCapture(arg0.toValue()); return PIVariant();} + if (strcmp(function, "disableExitCapture") == 0) {object->disableExitCapture(); return PIVariant();} + if (strcmp(function, "setActive") == 0) {object->setActive(); return PIVariant();} + if (strcmp(function, "setActive") == 0) {object->setActive(arg0.toValue()); return PIVariant();} + if (strcmp(function, "keyPressed") == 0) {object->keyPressed(arg0.toValue(), arg1.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIKbdListener\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIIODevice * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "mode") == 0) {return PIVariant::fromValue(object->mode());} + if (strcmp(function, "path") == 0) {return PIVariant::fromValue(object->path());} + if (strcmp(function, "setPath") == 0) {object->setPath(arg0.toValue()); return PIVariant();} + if (strcmp(function, "isReadable") == 0) {return PIVariant::fromValue(object->isReadable());} + if (strcmp(function, "isWriteable") == 0) {return PIVariant::fromValue(object->isWriteable());} + if (strcmp(function, "isInitialized") == 0) {return PIVariant::fromValue(object->isInitialized());} + if (strcmp(function, "isOpened") == 0) {return PIVariant::fromValue(object->isOpened());} + if (strcmp(function, "isClosed") == 0) {return PIVariant::fromValue(object->isClosed());} + if (strcmp(function, "canRead") == 0) {return PIVariant::fromValue(object->canRead());} + if (strcmp(function, "canWrite") == 0) {return PIVariant::fromValue(object->canWrite());} + if (strcmp(function, "setReopenEnabled") == 0) {object->setReopenEnabled(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setReopenTimeout") == 0) {object->setReopenTimeout(arg0.toValue()); return PIVariant();} + if (strcmp(function, "isReopenEnabled") == 0) {return PIVariant::fromValue(object->isReopenEnabled());} + if (strcmp(function, "reopenTimeout") == 0) {return PIVariant::fromValue(object->reopenTimeout());} + if (strcmp(function, "setThreadedReadSlot") == 0) {object->setThreadedReadSlot(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setThreadedReadData") == 0) {object->setThreadedReadData(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setThreadedReadBufferSize") == 0) {object->setThreadedReadBufferSize(arg0.toValue()); return PIVariant();} + if (strcmp(function, "threadedReadBufferSize") == 0) {return PIVariant::fromValue(object->threadedReadBufferSize());} + if (strcmp(function, "threadedReadBuffer") == 0) {return PIVariant::fromValue(object->threadedReadBuffer());} + if (strcmp(function, "isThreadedRead") == 0) {return PIVariant::fromValue(object->isThreadedRead());} + if (strcmp(function, "startThreadedRead") == 0) {object->startThreadedRead(); return PIVariant();} + if (strcmp(function, "startThreadedRead") == 0) {object->startThreadedRead(arg0.toValue()); return PIVariant();} + if (strcmp(function, "stopThreadedRead") == 0) {object->stopThreadedRead(); return PIVariant();} + if (strcmp(function, "isThreadedWrite") == 0) {return PIVariant::fromValue(object->isThreadedWrite());} + if (strcmp(function, "startThreadedWrite") == 0) {object->startThreadedWrite(); return PIVariant();} + if (strcmp(function, "stopThreadedWrite") == 0) {object->stopThreadedWrite(); return PIVariant();} + if (strcmp(function, "clearThreadedWriteQueue") == 0) {object->clearThreadedWriteQueue(); return PIVariant();} + if (strcmp(function, "start") == 0) {object->start(); return PIVariant();} + if (strcmp(function, "stop") == 0) {object->stop(arg0.toValue()); return PIVariant();} + if (strcmp(function, "read") == 0) {return PIVariant::fromValue(object->read(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "write") == 0) {return PIVariant::fromValue(object->write(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "read") == 0) {return PIVariant::fromValue(object->read(arg0.toValue()));} + if (strcmp(function, "readForTime") == 0) {return PIVariant::fromValue(object->readForTime(arg0.toValue()));} + if (strcmp(function, "write") == 0) {return PIVariant::fromValue(object->write(arg0.toValue()));} + if (strcmp(function, "writeThreaded") == 0) {return PIVariant::fromValue(object->writeThreaded(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "writeThreaded") == 0) {return PIVariant::fromValue(object->writeThreaded(arg0.toValue()));} + if (strcmp(function, "configure") == 0) {return PIVariant::fromValue(object->configure(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "open") == 0) {return PIVariant::fromValue(object->open());} + if (strcmp(function, "open") == 0) {return PIVariant::fromValue(object->open(arg0.toValue()));} + if (strcmp(function, "open") == 0) {return PIVariant::fromValue(object->open(arg0.toValue()));} + if (strcmp(function, "open") == 0) {return PIVariant::fromValue(object->open(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "close") == 0) {return PIVariant::fromValue(object->close());} + if (strcmp(function, "initialize") == 0) {return PIVariant::fromValue(object->initialize());} + if (strcmp(function, "flush") == 0) {object->flush(); return PIVariant();} + if (strcmp(function, "opened") == 0) {object->opened(); return PIVariant();} + if (strcmp(function, "closed") == 0) {object->closed(); return PIVariant();} + if (strcmp(function, "threadedReadEvent") == 0) {object->threadedReadEvent(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "threadedWriteEvent") == 0) {object->threadedWriteEvent(arg0.toValue(), arg1.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIIODevice\"!"; + return PIVariant(); +} + +PIVariant execFunction(PISerial * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "setSpeed") == 0) {object->setSpeed(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setOutSpeed") == 0) {object->setOutSpeed(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setInSpeed") == 0) {object->setInSpeed(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setDevice") == 0) {object->setDevice(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setParameters") == 0) {object->setParameters(arg0.toValue >()); return PIVariant();} + if (strcmp(function, "setParameter") == 0) {object->setParameter(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "isParameterSet") == 0) {return PIVariant::fromValue(object->isParameterSet(arg0.toValue()));} + if (strcmp(function, "parameters") == 0) {return PIVariant::fromValue >(object->parameters());} + if (strcmp(function, "setDataBitsCount") == 0) {object->setDataBitsCount(arg0.toValue()); return PIVariant();} + if (strcmp(function, "dataBitsCount") == 0) {return PIVariant::fromValue(object->dataBitsCount());} + if (strcmp(function, "setPin") == 0) {return PIVariant::fromValue(object->setPin(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "isPin") == 0) {return PIVariant::fromValue(object->isPin(arg0.toValue()));} + if (strcmp(function, "setLE") == 0) {return PIVariant::fromValue(object->setLE(arg0.toValue()));} + if (strcmp(function, "setDTR") == 0) {return PIVariant::fromValue(object->setDTR(arg0.toValue()));} + if (strcmp(function, "setRTS") == 0) {return PIVariant::fromValue(object->setRTS(arg0.toValue()));} + if (strcmp(function, "setCTS") == 0) {return PIVariant::fromValue(object->setCTS(arg0.toValue()));} + if (strcmp(function, "setST") == 0) {return PIVariant::fromValue(object->setST(arg0.toValue()));} + if (strcmp(function, "setSR") == 0) {return PIVariant::fromValue(object->setSR(arg0.toValue()));} + if (strcmp(function, "setCAR") == 0) {return PIVariant::fromValue(object->setCAR(arg0.toValue()));} + if (strcmp(function, "setRNG") == 0) {return PIVariant::fromValue(object->setRNG(arg0.toValue()));} + if (strcmp(function, "setDSR") == 0) {return PIVariant::fromValue(object->setDSR(arg0.toValue()));} + if (strcmp(function, "isLE") == 0) {return PIVariant::fromValue(object->isLE());} + if (strcmp(function, "isDTR") == 0) {return PIVariant::fromValue(object->isDTR());} + if (strcmp(function, "isRTS") == 0) {return PIVariant::fromValue(object->isRTS());} + if (strcmp(function, "isCTS") == 0) {return PIVariant::fromValue(object->isCTS());} + if (strcmp(function, "isST") == 0) {return PIVariant::fromValue(object->isST());} + if (strcmp(function, "isSR") == 0) {return PIVariant::fromValue(object->isSR());} + if (strcmp(function, "isCAR") == 0) {return PIVariant::fromValue(object->isCAR());} + if (strcmp(function, "isRNG") == 0) {return PIVariant::fromValue(object->isRNG());} + if (strcmp(function, "isDSR") == 0) {return PIVariant::fromValue(object->isDSR());} + if (strcmp(function, "setVTime") == 0) {object->setVTime(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setReadIsBlocking") == 0) {object->setReadIsBlocking(arg0.toValue()); return PIVariant();} + if (strcmp(function, "device") == 0) {return PIVariant::fromValue(object->device());} + if (strcmp(function, "outSpeed") == 0) {return PIVariant::fromValue(object->outSpeed());} + if (strcmp(function, "inSpeed") == 0) {return PIVariant::fromValue(object->inSpeed());} + if (strcmp(function, "VTime") == 0) {return PIVariant::fromValue(object->VTime());} + if (strcmp(function, "flush") == 0) {object->flush(); return PIVariant();} + if (strcmp(function, "read") == 0) {return PIVariant::fromValue(object->read(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "read") == 0) {return PIVariant::fromValue(object->read(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "read") == 0) {return PIVariant::fromValue(object->read(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "readData") == 0) {return PIVariant::fromValue(object->readData(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "write") == 0) {return PIVariant::fromValue(object->write(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue()));} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PISerial\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIFile * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "flush") == 0) {object->flush(); return PIVariant();} + if (strcmp(function, "seek") == 0) {object->seek(arg0.toValue()); return PIVariant();} + if (strcmp(function, "seekToBegin") == 0) {object->seekToBegin(); return PIVariant();} + if (strcmp(function, "seekToEnd") == 0) {object->seekToEnd(); return PIVariant();} + if (strcmp(function, "seekToLine") == 0) {object->seekToLine(arg0.toValue()); return PIVariant();} + if (strcmp(function, "readChar") == 0) {return PIVariant::fromValue(object->readChar());} + if (strcmp(function, "readLine") == 0) {return PIVariant::fromValue(object->readLine());} + if (strcmp(function, "readAll") == 0) {return PIVariant::fromValue(object->readAll(arg0.toValue()));} + if (strcmp(function, "readAll") == 0) {return PIVariant::fromValue(object->readAll(arg0.toValue()));} + if (strcmp(function, "setPath") == 0) {object->setPath(arg0.toValue()); return PIVariant();} + if (strcmp(function, "size") == 0) {return PIVariant::fromValue(object->size());} + if (strcmp(function, "pos") == 0) {return PIVariant::fromValue(object->pos());} + if (strcmp(function, "isEnd") == 0) {return PIVariant::fromValue(object->isEnd());} + if (strcmp(function, "isEmpty") == 0) {return PIVariant::fromValue(object->isEmpty());} + if (strcmp(function, "precision") == 0) {return PIVariant::fromValue(object->precision());} + if (strcmp(function, "setPrecision") == 0) {object->setPrecision(arg0.toValue()); return PIVariant();} + if (strcmp(function, "read") == 0) {return PIVariant::fromValue(object->read(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "write") == 0) {return PIVariant::fromValue(object->write(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "clear") == 0) {object->clear(); return PIVariant();} + if (strcmp(function, "remove") == 0) {object->remove(); return PIVariant();} + if (strcmp(function, "resize") == 0) {object->resize(arg0.toValue()); return PIVariant();} + if (strcmp(function, "resize") == 0) {object->resize(arg0.toValue(), arg1.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIFile\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIProcess * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "exitCode") == 0) {return PIVariant::fromValue(object->exitCode());} + if (strcmp(function, "pID") == 0) {return PIVariant::fromValue(object->pID());} + if (strcmp(function, "setGrabInput") == 0) {object->setGrabInput(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setGrabOutput") == 0) {object->setGrabOutput(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setGrabError") == 0) {object->setGrabError(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setInputFile") == 0) {object->setInputFile(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setOutputFile") == 0) {object->setOutputFile(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setErrorFile") == 0) {object->setErrorFile(arg0.toValue()); return PIVariant();} + if (strcmp(function, "unsetInputFile") == 0) {object->unsetInputFile(); return PIVariant();} + if (strcmp(function, "unsetOutputFile") == 0) {object->unsetOutputFile(); return PIVariant();} + if (strcmp(function, "unsetErrorFile") == 0) {object->unsetErrorFile(); return PIVariant();} + if (strcmp(function, "workingDirectory") == 0) {return PIVariant::fromValue(object->workingDirectory());} + if (strcmp(function, "setWorkingDirectory") == 0) {object->setWorkingDirectory(arg0.toValue()); return PIVariant();} + if (strcmp(function, "resetWorkingDirectory") == 0) {object->resetWorkingDirectory(); return PIVariant();} + if (strcmp(function, "readOutput") == 0) {return PIVariant::fromValue(object->readOutput());} + if (strcmp(function, "readError") == 0) {return PIVariant::fromValue(object->readError());} + if (strcmp(function, "environment") == 0) {return PIVariant::fromValue(object->environment());} + if (strcmp(function, "clearEnvironment") == 0) {object->clearEnvironment(); return PIVariant();} + if (strcmp(function, "removeEnvironmentVariable") == 0) {object->removeEnvironmentVariable(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setEnvironmentVariable") == 0) {object->setEnvironmentVariable(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "exec") == 0) {object->exec(arg0.toValue()); return PIVariant();} + if (strcmp(function, "exec") == 0) {object->exec(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "exec") == 0) {object->exec(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "exec") == 0) {object->exec(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue()); return PIVariant();} + if (strcmp(function, "exec") == 0) {object->exec(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "terminate") == 0) {object->terminate(); return PIVariant();} + if (strcmp(function, "waitForFinish") == 0) {return PIVariant::fromValue(object->waitForFinish());} + if (strcmp(function, "waitForFinish") == 0) {return PIVariant::fromValue(object->waitForFinish(arg0.toValue()));} + if (strcmp(function, "execStarted") == 0) {object->execStarted(arg0.toValue()); return PIVariant();} + if (strcmp(function, "execFinished") == 0) {object->execFinished(arg0.toValue(), arg1.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIProcess\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIEthernet * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "setReadAddress") == 0) {object->setReadAddress(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setReadAddress") == 0) {object->setReadAddress(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setReadIP") == 0) {object->setReadIP(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setReadPort") == 0) {object->setReadPort(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setSendAddress") == 0) {object->setSendAddress(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setSendAddress") == 0) {object->setSendAddress(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setSendIP") == 0) {object->setSendIP(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setSendPort") == 0) {object->setSendPort(arg0.toValue()); return PIVariant();} + if (strcmp(function, "readAddress") == 0) {return PIVariant::fromValue(object->readAddress());} + if (strcmp(function, "readIP") == 0) {return PIVariant::fromValue(object->readIP());} + if (strcmp(function, "readPort") == 0) {return PIVariant::fromValue(object->readPort());} + if (strcmp(function, "sendAddress") == 0) {return PIVariant::fromValue(object->sendAddress());} + if (strcmp(function, "sendIP") == 0) {return PIVariant::fromValue(object->sendIP());} + if (strcmp(function, "sendPort") == 0) {return PIVariant::fromValue(object->sendPort());} + if (strcmp(function, "setParameters") == 0) {object->setParameters(arg0.toValue >()); return PIVariant();} + if (strcmp(function, "setParameter") == 0) {object->setParameter(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "isParameterSet") == 0) {return PIVariant::fromValue(object->isParameterSet(arg0.toValue()));} + if (strcmp(function, "parameters") == 0) {return PIVariant::fromValue >(object->parameters());} + if (strcmp(function, "type") == 0) {return PIVariant::fromValue(object->type());} + if (strcmp(function, "joinMulticastGroup") == 0) {return PIVariant::fromValue(object->joinMulticastGroup(arg0.toValue()));} + if (strcmp(function, "leaveMulticastGroup") == 0) {return PIVariant::fromValue(object->leaveMulticastGroup(arg0.toValue()));} + if (strcmp(function, "multicastGroups") == 0) {return PIVariant::fromValue(object->multicastGroups());} + if (strcmp(function, "connect") == 0) {return PIVariant::fromValue(object->connect());} + if (strcmp(function, "connect") == 0) {return PIVariant::fromValue(object->connect(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "connect") == 0) {return PIVariant::fromValue(object->connect(arg0.toValue()));} + if (strcmp(function, "isConnected") == 0) {return PIVariant::fromValue(object->isConnected());} + if (strcmp(function, "listen") == 0) {return PIVariant::fromValue(object->listen());} + if (strcmp(function, "listen") == 0) {return PIVariant::fromValue(object->listen(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "listen") == 0) {return PIVariant::fromValue(object->listen(arg0.toValue()));} + if (strcmp(function, "client") == 0) {return PIVariant::fromValue(object->client(arg0.toValue()));} + if (strcmp(function, "clientsCount") == 0) {return PIVariant::fromValue(object->clientsCount());} + if (strcmp(function, "clients") == 0) {return PIVariant::fromValue >(object->clients());} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "read") == 0) {return PIVariant::fromValue(object->read(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "write") == 0) {return PIVariant::fromValue(object->write(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "write") == 0) {return PIVariant::fromValue(object->write(arg0.toValue()));} + if (strcmp(function, "newConnection") == 0) {object->newConnection(arg0.toValue()); return PIVariant();} + if (strcmp(function, "connected") == 0) {object->connected(); return PIVariant();} + if (strcmp(function, "disconnected") == 0) {object->disconnected(arg0.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIEthernet\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIPacketExtractor * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "device") == 0) {return PIVariant::fromValue(object->device());} + if (strcmp(function, "setDevice") == 0) {object->setDevice(arg0.toValue()); return PIVariant();} + if (strcmp(function, "bufferSize") == 0) {return PIVariant::fromValue(object->bufferSize());} + if (strcmp(function, "setBufferSize") == 0) {object->setBufferSize(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setHeaderCheckSlot") == 0) {object->setHeaderCheckSlot(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setPacketData") == 0) {object->setPacketData(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "missedBytes") == 0) {return PIVariant::fromValue(object->missedBytes());} + if (strcmp(function, "missedPackets") == 0) {return PIVariant::fromValue(object->missedPackets());} + if (strcmp(function, "missedBytes_ptr") == 0) {return PIVariant::fromValue(object->missedBytes_ptr());} + if (strcmp(function, "missedPackets_ptr") == 0) {return PIVariant::fromValue(object->missedPackets_ptr());} + if (strcmp(function, "lastHeader") == 0) {return PIVariant::fromValue(object->lastHeader());} + if (strcmp(function, "read") == 0) {return PIVariant::fromValue(object->read(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "write") == 0) {return PIVariant::fromValue(object->write(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "packetReceived") == 0) {object->packetReceived(arg0.toValue(), arg1.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIPacketExtractor\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIConfig * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "getValues") == 0) {return PIVariant::fromValue(object->getValues(arg0.toValue()));} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "entriesCount") == 0) {return PIVariant::fromValue(object->entriesCount());} + if (strcmp(function, "isEntryExists") == 0) {return PIVariant::fromValue(object->isEntryExists(arg0.toValue()));} + if (strcmp(function, "allTree") == 0) {return PIVariant::fromValue(object->allTree());} + if (strcmp(function, "allLeaves") == 0) {return PIVariant::fromValue(object->allLeaves());} + if (strcmp(function, "entryIndex") == 0) {return PIVariant::fromValue(object->entryIndex(arg0.toValue()));} + if (strcmp(function, "getName") == 0) {return PIVariant::fromValue(object->getName(arg0.toValue()));} + if (strcmp(function, "getValue") == 0) {return PIVariant::fromValue(object->getValue(arg0.toValue()));} + if (strcmp(function, "getType") == 0) {return PIVariant::fromValue(object->getType(arg0.toValue()));} + if (strcmp(function, "getComment") == 0) {return PIVariant::fromValue(object->getComment(arg0.toValue()));} + if (strcmp(function, "addEntry") == 0) {object->addEntry(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue()); return PIVariant();} + if (strcmp(function, "setName") == 0) {object->setName(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setValue") == 0) {object->setValue(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setType") == 0) {object->setType(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setComment") == 0) {object->setComment(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "removeEntry") == 0) {object->removeEntry(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "removeEntry") == 0) {object->removeEntry(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "clear") == 0) {object->clear(); return PIVariant();} + if (strcmp(function, "readAll") == 0) {object->readAll(); return PIVariant();} + if (strcmp(function, "writeAll") == 0) {object->writeAll(); return PIVariant();} + if (strcmp(function, "delimiter") == 0) {return PIVariant::fromValue(object->delimiter());} + if (strcmp(function, "setDelimiter") == 0) {object->setDelimiter(arg0.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIConfig\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIMultiProtocolBase * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIMultiProtocolBase\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIProtocol * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "startReceive") == 0) {object->startReceive(); return PIVariant();} + if (strcmp(function, "startReceive") == 0) {object->startReceive(arg0.toValue()); return PIVariant();} + if (strcmp(function, "stopReceive") == 0) {object->stopReceive(); return PIVariant();} + if (strcmp(function, "setExpectedFrequency") == 0) {object->setExpectedFrequency(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setReceiverDevice") == 0) {object->setReceiverDevice(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setReceiverData") == 0) {object->setReceiverData(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setReceiverDataHeader") == 0) {object->setReceiverDataHeader(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setReceiverAddress") == 0) {object->setReceiverAddress(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setReceiverParameters") == 0) {object->setReceiverParameters(arg0.toValue >()); return PIVariant();} + if (strcmp(function, "setReceiveSlot") == 0) {object->setReceiveSlot(arg0.toValue()); return PIVariant();} + if (strcmp(function, "expectedFrequency") == 0) {return PIVariant::fromValue(object->expectedFrequency());} + if (strcmp(function, "startSend") == 0) {object->startSend(); return PIVariant();} + if (strcmp(function, "startSend") == 0) {object->startSend(arg0.toValue()); return PIVariant();} + if (strcmp(function, "stopSend") == 0) {object->stopSend(); return PIVariant();} + if (strcmp(function, "setSenderFrequency") == 0) {object->setSenderFrequency(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setSenderDevice") == 0) {object->setSenderDevice(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setSenderData") == 0) {object->setSenderData(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setSenderAddress") == 0) {object->setSenderAddress(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setSenderIP") == 0) {object->setSenderIP(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setSenderPort") == 0) {object->setSenderPort(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setSenderParameters") == 0) {object->setSenderParameters(arg0.toValue >()); return PIVariant();} + if (strcmp(function, "senderFrequency") == 0) {return PIVariant::fromValue(object->senderFrequency());} + if (strcmp(function, "start") == 0) {object->start(); return PIVariant();} + if (strcmp(function, "stop") == 0) {object->stop(); return PIVariant();} + if (strcmp(function, "send") == 0) {object->send(); return PIVariant();} + if (strcmp(function, "send") == 0) {object->send(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "send") == 0) {object->send(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "setName") == 0) {object->setName(arg0.toValue()); return PIVariant();} + if (strcmp(function, "name") == 0) {return PIVariant::fromValue(object->name());} + if (strcmp(function, "setDisconnectTimeout") == 0) {object->setDisconnectTimeout(arg0.toValue()); return PIVariant();} + if (strcmp(function, "disconnectTimeout") == 0) {return PIVariant::fromValue(object->disconnectTimeout());} + if (strcmp(function, "disconnectTimeout_ptr") == 0) {return PIVariant::fromValue(object->disconnectTimeout_ptr());} + if (strcmp(function, "immediateFrequency") == 0) {return PIVariant::fromValue(object->immediateFrequency());} + if (strcmp(function, "integralFrequency") == 0) {return PIVariant::fromValue(object->integralFrequency());} + if (strcmp(function, "immediateFrequency_ptr") == 0) {return PIVariant::fromValue(object->immediateFrequency_ptr());} + if (strcmp(function, "integralFrequency_ptr") == 0) {return PIVariant::fromValue(object->integralFrequency_ptr());} + if (strcmp(function, "receiveCountPerSec") == 0) {return PIVariant::fromValue(object->receiveCountPerSec());} + if (strcmp(function, "receiveCountPerSec_ptr") == 0) {return PIVariant::fromValue(object->receiveCountPerSec_ptr());} + if (strcmp(function, "sendCountPerSec") == 0) {return PIVariant::fromValue(object->sendCountPerSec());} + if (strcmp(function, "sendCountPerSec_ptr") == 0) {return PIVariant::fromValue(object->sendCountPerSec_ptr());} + if (strcmp(function, "receiveBytesPerSec") == 0) {return PIVariant::fromValue(object->receiveBytesPerSec());} + if (strcmp(function, "receiveBytesPerSec_ptr") == 0) {return PIVariant::fromValue(object->receiveBytesPerSec_ptr());} + if (strcmp(function, "sendBytesPerSec") == 0) {return PIVariant::fromValue(object->sendBytesPerSec());} + if (strcmp(function, "sendBytesPerSec_ptr") == 0) {return PIVariant::fromValue(object->sendBytesPerSec_ptr());} + if (strcmp(function, "receiveCount") == 0) {return PIVariant::fromValue(object->receiveCount());} + if (strcmp(function, "receiveCount_ptr") == 0) {return PIVariant::fromValue(object->receiveCount_ptr());} + if (strcmp(function, "wrongCount") == 0) {return PIVariant::fromValue(object->wrongCount());} + if (strcmp(function, "wrongCount_ptr") == 0) {return PIVariant::fromValue(object->wrongCount_ptr());} + if (strcmp(function, "sendCount") == 0) {return PIVariant::fromValue(object->sendCount());} + if (strcmp(function, "sendCount_ptr") == 0) {return PIVariant::fromValue(object->sendCount_ptr());} + if (strcmp(function, "missedCount") == 0) {return PIVariant::fromValue(object->missedCount());} + if (strcmp(function, "missedCount_ptr") == 0) {return PIVariant::fromValue(object->missedCount_ptr());} + if (strcmp(function, "quality") == 0) {return PIVariant::fromValue(object->quality());} + if (strcmp(function, "quality_ptr") == 0) {return PIVariant::fromValue(object->quality_ptr());} + if (strcmp(function, "receiverDeviceName") == 0) {return PIVariant::fromValue(object->receiverDeviceName());} + if (strcmp(function, "senderDeviceName") == 0) {return PIVariant::fromValue(object->senderDeviceName());} + if (strcmp(function, "receiverDeviceState") == 0) {return PIVariant::fromValue(object->receiverDeviceState());} + if (strcmp(function, "receiverDeviceState_ptr") == 0) {return PIVariant::fromValue(object->receiverDeviceState_ptr());} + if (strcmp(function, "senderDeviceState") == 0) {return PIVariant::fromValue(object->senderDeviceState());} + if (strcmp(function, "senderDeviceState_ptr") == 0) {return PIVariant::fromValue(object->senderDeviceState_ptr());} + if (strcmp(function, "receiveSpeed") == 0) {return PIVariant::fromValue(object->receiveSpeed());} + if (strcmp(function, "receiveSpeed_ptr") == 0) {return PIVariant::fromValue(object->receiveSpeed_ptr());} + if (strcmp(function, "sendSpeed") == 0) {return PIVariant::fromValue(object->sendSpeed());} + if (strcmp(function, "sendSpeed_ptr") == 0) {return PIVariant::fromValue(object->sendSpeed_ptr());} + if (strcmp(function, "receiverHistorySize") == 0) {return PIVariant::fromValue(object->receiverHistorySize());} + if (strcmp(function, "receiverHistorySize_ptr") == 0) {return PIVariant::fromValue(object->receiverHistorySize_ptr());} + if (strcmp(function, "senderHistorySize") == 0) {return PIVariant::fromValue(object->senderHistorySize());} + if (strcmp(function, "senderHistorySize_ptr") == 0) {return PIVariant::fromValue(object->senderHistorySize_ptr());} + if (strcmp(function, "writeReceiverHistory") == 0) {return PIVariant::fromValue(object->writeReceiverHistory());} + if (strcmp(function, "writeReceiverHistory_ptr") == 0) {return PIVariant::fromValue(object->writeReceiverHistory_ptr());} + if (strcmp(function, "writeSenderHistory") == 0) {return PIVariant::fromValue(object->writeSenderHistory());} + if (strcmp(function, "writeSenderHistory_ptr") == 0) {return PIVariant::fromValue(object->writeSenderHistory_ptr());} + if (strcmp(function, "receiveData") == 0) {return PIVariant::fromValue(object->receiveData());} + if (strcmp(function, "sendData") == 0) {return PIVariant::fromValue(object->sendData());} + if (strcmp(function, "packetExtractor") == 0) {return PIVariant::fromValue(object->packetExtractor());} + if (strcmp(function, "lastHeader") == 0) {return PIVariant::fromValue(object->lastHeader());} + if (strcmp(function, "receiverStarted") == 0) {object->receiverStarted(); return PIVariant();} + if (strcmp(function, "receiverStopped") == 0) {object->receiverStopped(); return PIVariant();} + if (strcmp(function, "senderStarted") == 0) {object->senderStarted(); return PIVariant();} + if (strcmp(function, "senderStopped") == 0) {object->senderStopped(); return PIVariant();} + if (strcmp(function, "received") == 0) {object->received(arg0.toValue()); return PIVariant();} + if (strcmp(function, "qualityChanged") == 0) {object->qualityChanged(arg0.toValue(), arg1.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIProtocol\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIDiagnostics * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "immediateFrequency") == 0) {return PIVariant::fromValue(object->immediateFrequency());} + if (strcmp(function, "integralFrequency") == 0) {return PIVariant::fromValue(object->integralFrequency());} + if (strcmp(function, "receiveCountPerSec") == 0) {return PIVariant::fromValue(object->receiveCountPerSec());} + if (strcmp(function, "sendCountPerSec") == 0) {return PIVariant::fromValue(object->sendCountPerSec());} + if (strcmp(function, "receiveBytesPerSec") == 0) {return PIVariant::fromValue(object->receiveBytesPerSec());} + if (strcmp(function, "sendBytesPerSec") == 0) {return PIVariant::fromValue(object->sendBytesPerSec());} + if (strcmp(function, "receiveCount") == 0) {return PIVariant::fromValue(object->receiveCount());} + if (strcmp(function, "wrongCount") == 0) {return PIVariant::fromValue(object->wrongCount());} + if (strcmp(function, "sendCount") == 0) {return PIVariant::fromValue(object->sendCount());} + if (strcmp(function, "quality") == 0) {return PIVariant::fromValue(object->quality());} + if (strcmp(function, "receiveSpeed") == 0) {return PIVariant::fromValue(object->receiveSpeed());} + if (strcmp(function, "sendSpeed") == 0) {return PIVariant::fromValue(object->sendSpeed());} + if (strcmp(function, "immediateFrequency_ptr") == 0) {return PIVariant::fromValue(object->immediateFrequency_ptr());} + if (strcmp(function, "integralFrequency_ptr") == 0) {return PIVariant::fromValue(object->integralFrequency_ptr());} + if (strcmp(function, "receiveCountPerSec_ptr") == 0) {return PIVariant::fromValue(object->receiveCountPerSec_ptr());} + if (strcmp(function, "sendCountPerSec_ptr") == 0) {return PIVariant::fromValue(object->sendCountPerSec_ptr());} + if (strcmp(function, "receiveBytesPerSec_ptr") == 0) {return PIVariant::fromValue(object->receiveBytesPerSec_ptr());} + if (strcmp(function, "sendBytesPerSec_ptr") == 0) {return PIVariant::fromValue(object->sendBytesPerSec_ptr());} + if (strcmp(function, "receiveCount_ptr") == 0) {return PIVariant::fromValue(object->receiveCount_ptr());} + if (strcmp(function, "wrongCount_ptr") == 0) {return PIVariant::fromValue(object->wrongCount_ptr());} + if (strcmp(function, "sendCount_ptr") == 0) {return PIVariant::fromValue(object->sendCount_ptr());} + if (strcmp(function, "quality_ptr") == 0) {return PIVariant::fromValue(object->quality_ptr());} + if (strcmp(function, "receiveSpeed_ptr") == 0) {return PIVariant::fromValue(object->receiveSpeed_ptr());} + if (strcmp(function, "sendSpeed_ptr") == 0) {return PIVariant::fromValue(object->sendSpeed_ptr());} + if (strcmp(function, "start") == 0) {object->start(); return PIVariant();} + if (strcmp(function, "start") == 0) {object->start(arg0.toValue()); return PIVariant();} + if (strcmp(function, "reset") == 0) {object->reset(); return PIVariant();} + if (strcmp(function, "received") == 0) {object->received(arg0.toValue()); return PIVariant();} + if (strcmp(function, "received") == 0) {object->received(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "sended") == 0) {object->sended(arg0.toValue()); return PIVariant();} + if (strcmp(function, "qualityChanged") == 0) {object->qualityChanged(arg0.toValue(), arg1.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIDiagnostics\"!"; + return PIVariant(); +} + +PIVariant execFunction(PISystemMonitor * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "startOnProcess") == 0) {return PIVariant::fromValue(object->startOnProcess(arg0.toValue()));} + if (strcmp(function, "startOnSelf") == 0) {return PIVariant::fromValue(object->startOnSelf());} + if (strcmp(function, "statistic") == 0) {return PIVariant::fromValue(object->statistic());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PISystemMonitor\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIConsole * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "addString") == 0) {object->addString(arg0.toValue(), arg1.toValue(), arg2.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue >()); return PIVariant();} + if (strcmp(function, "addEmptyLine") == 0) {object->addEmptyLine(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "getString") == 0) {return PIVariant::fromValue(object->getString(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "getShort") == 0) {return PIVariant::fromValue(object->getShort(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "getInt") == 0) {return PIVariant::fromValue(object->getInt(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "getFloat") == 0) {return PIVariant::fromValue(object->getFloat(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "getDouble") == 0) {return PIVariant::fromValue(object->getDouble(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "getString") == 0) {return PIVariant::fromValue(object->getString(arg0.toValue()));} + if (strcmp(function, "getShort") == 0) {return PIVariant::fromValue(object->getShort(arg0.toValue()));} + if (strcmp(function, "getInt") == 0) {return PIVariant::fromValue(object->getInt(arg0.toValue()));} + if (strcmp(function, "getFloat") == 0) {return PIVariant::fromValue(object->getFloat(arg0.toValue()));} + if (strcmp(function, "getDouble") == 0) {return PIVariant::fromValue(object->getDouble(arg0.toValue()));} + if (strcmp(function, "tabsCount") == 0) {return PIVariant::fromValue(object->tabsCount());} + if (strcmp(function, "currentTab") == 0) {return PIVariant::fromValue(object->currentTab());} + if (strcmp(function, "addTab") == 0) {return PIVariant::fromValue(object->addTab(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "removeTab") == 0) {object->removeTab(arg0.toValue()); return PIVariant();} + if (strcmp(function, "removeTab") == 0) {object->removeTab(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setTab") == 0) {return PIVariant::fromValue(object->setTab(arg0.toValue()));} + if (strcmp(function, "setTab") == 0) {return PIVariant::fromValue(object->setTab(arg0.toValue()));} + if (strcmp(function, "setTabBindKey") == 0) {return PIVariant::fromValue(object->setTabBindKey(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "setTabBindKey") == 0) {return PIVariant::fromValue(object->setTabBindKey(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "clearTabs") == 0) {object->clearTabs(arg0.toValue()); return PIVariant();} + if (strcmp(function, "addCustomStatus") == 0) {object->addCustomStatus(arg0.toValue()); return PIVariant();} + if (strcmp(function, "clearCustomStatus") == 0) {object->clearCustomStatus(); return PIVariant();} + if (strcmp(function, "defaultAlignment") == 0) {return PIVariant::fromValue(object->defaultAlignment());} + if (strcmp(function, "setDefaultAlignment") == 0) {object->setDefaultAlignment(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setColumnAlignment") == 0) {object->setColumnAlignment(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setColumnAlignmentToAll") == 0) {object->setColumnAlignmentToAll(arg0.toValue()); return PIVariant();} + if (strcmp(function, "fstr") == 0) {return PIVariant::fromValue(object->fstr(arg0.toValue >()));} + if (strcmp(function, "enableExitCapture") == 0) {object->enableExitCapture(arg0.toValue()); return PIVariant();} + if (strcmp(function, "disableExitCapture") == 0) {object->disableExitCapture(); return PIVariant();} + if (strcmp(function, "exitCaptured") == 0) {return PIVariant::fromValue(object->exitCaptured());} + if (strcmp(function, "exitKey") == 0) {return PIVariant::fromValue(object->exitKey());} + if (strcmp(function, "startServer") == 0) {object->startServer(arg0.toValue()); return PIVariant();} + if (strcmp(function, "stopPeer") == 0) {object->stopPeer(); return PIVariant();} + if (strcmp(function, "isServerStarted") == 0) {return PIVariant::fromValue(object->isServerStarted());} + if (strcmp(function, "clients") == 0) {return PIVariant::fromValue(object->clients());} + if (strcmp(function, "listenServers") == 0) {object->listenServers(); return PIVariant();} + if (strcmp(function, "availableServers") == 0) {return PIVariant::fromValue(object->availableServers());} + if (strcmp(function, "selectedServer") == 0) {return PIVariant::fromValue(object->selectedServer());} + if (strcmp(function, "connectToServer") == 0) {object->connectToServer(arg0.toValue()); return PIVariant();} + if (strcmp(function, "disconnect") == 0) {object->disconnect(); return PIVariant();} + if (strcmp(function, "isConnected") == 0) {return PIVariant::fromValue(object->isConnected());} + if (strcmp(function, "toUpperLeft") == 0) {object->toUpperLeft(); return PIVariant();} + if (strcmp(function, "moveRight") == 0) {object->moveRight(arg0.toValue()); return PIVariant();} + if (strcmp(function, "moveLeft") == 0) {object->moveLeft(arg0.toValue()); return PIVariant();} + if (strcmp(function, "moveTo") == 0) {object->moveTo(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "clearScreen") == 0) {object->clearScreen(); return PIVariant();} + if (strcmp(function, "clearScreenLower") == 0) {object->clearScreenLower(); return PIVariant();} + if (strcmp(function, "clearLine") == 0) {object->clearLine(); return PIVariant();} + if (strcmp(function, "newLine") == 0) {object->newLine(); return PIVariant();} + if (strcmp(function, "hideCursor") == 0) {object->hideCursor(); return PIVariant();} + if (strcmp(function, "showCursor") == 0) {object->showCursor(); return PIVariant();} + if (strcmp(function, "clearVariables") == 0) {object->clearVariables(); return PIVariant();} + if (strcmp(function, "clearVariables") == 0) {object->clearVariables(arg0.toValue()); return PIVariant();} + if (strcmp(function, "waitForFinish") == 0) {object->waitForFinish(); return PIVariant();} + if (strcmp(function, "start") == 0) {object->start(); return PIVariant();} + if (strcmp(function, "start") == 0) {object->start(arg0.toValue()); return PIVariant();} + if (strcmp(function, "stop") == 0) {object->stop(); return PIVariant();} + if (strcmp(function, "stop") == 0) {object->stop(arg0.toValue()); return PIVariant();} + if (strcmp(function, "keyPressed") == 0) {object->keyPressed(arg0.toValue(), arg1.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIConsole\"!"; + return PIVariant(); +} + +PIVariant execFunction(PICLI * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "addArgument") == 0) {object->addArgument(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "addArgument") == 0) {object->addArgument(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "addArgument") == 0) {object->addArgument(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "addArgument") == 0) {object->addArgument(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue()); return PIVariant();} + if (strcmp(function, "addArgument") == 0) {object->addArgument(arg0.toValue(), arg1.toValue(), arg2.toValue(), arg3.toValue()); return PIVariant();} + if (strcmp(function, "rawArgument") == 0) {return PIVariant::fromValue(object->rawArgument(arg0.toValue()));} + if (strcmp(function, "mandatoryArgument") == 0) {return PIVariant::fromValue(object->mandatoryArgument(arg0.toValue()));} + if (strcmp(function, "optionalArgument") == 0) {return PIVariant::fromValue(object->optionalArgument(arg0.toValue()));} + if (strcmp(function, "rawArguments") == 0) {return PIVariant::fromValue(object->rawArguments());} + if (strcmp(function, "mandatoryArguments") == 0) {return PIVariant::fromValue(object->mandatoryArguments());} + if (strcmp(function, "optionalArguments") == 0) {return PIVariant::fromValue(object->optionalArguments());} + if (strcmp(function, "programCommand") == 0) {return PIVariant::fromValue(object->programCommand());} + if (strcmp(function, "hasArgument") == 0) {return PIVariant::fromValue(object->hasArgument(arg0.toValue()));} + if (strcmp(function, "argumentValue") == 0) {return PIVariant::fromValue(object->argumentValue(arg0.toValue()));} + if (strcmp(function, "argumentShortKey") == 0) {return PIVariant::fromValue(object->argumentShortKey(arg0.toValue()));} + if (strcmp(function, "argumentFullKey") == 0) {return PIVariant::fromValue(object->argumentFullKey(arg0.toValue()));} + if (strcmp(function, "shortKeyPrefix") == 0) {return PIVariant::fromValue(object->shortKeyPrefix());} + if (strcmp(function, "fullKeyPrefix") == 0) {return PIVariant::fromValue(object->fullKeyPrefix());} + if (strcmp(function, "mandatoryArgumentsCount") == 0) {return PIVariant::fromValue(object->mandatoryArgumentsCount());} + if (strcmp(function, "optionalArgumentsCount") == 0) {return PIVariant::fromValue(object->optionalArgumentsCount());} + if (strcmp(function, "setShortKeyPrefix") == 0) {object->setShortKeyPrefix(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setFullKeyPrefix") == 0) {object->setFullKeyPrefix(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setMandatoryArgumentsCount") == 0) {object->setMandatoryArgumentsCount(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setOptionalArgumentsCount") == 0) {object->setOptionalArgumentsCount(arg0.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PICLI\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIEvaluatorContent * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "addFunction") == 0) {object->addFunction(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "addVariable") == 0) {object->addVariable(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "addCustomFunction") == 0) {object->addCustomFunction(arg0.toValue(), arg1.toValue(), arg2.toValue()); return PIVariant();} + if (strcmp(function, "functionsCount") == 0) {return PIVariant::fromValue(object->functionsCount());} + if (strcmp(function, "variablesCount") == 0) {return PIVariant::fromValue(object->variablesCount());} + if (strcmp(function, "customVariablesCount") == 0) {return PIVariant::fromValue(object->customVariablesCount());} + if (strcmp(function, "findFunction") == 0) {return PIVariant::fromValue(object->findFunction(arg0.toValue()));} + if (strcmp(function, "findVariable") == 0) {return PIVariant::fromValue(object->findVariable(arg0.toValue()));} + if (strcmp(function, "function") == 0) {return PIVariant::fromValue(object->function(arg0.toValue()));} + if (strcmp(function, "variable") == 0) {return PIVariant::fromValue(object->variable(arg0.toValue()));} + if (strcmp(function, "function") == 0) {return PIVariant::fromValue(object->function(arg0.toValue()));} + if (strcmp(function, "variable") == 0) {return PIVariant::fromValue(object->variable(arg0.toValue()));} + if (strcmp(function, "customVariable") == 0) {return PIVariant::fromValue(object->customVariable(arg0.toValue()));} + if (strcmp(function, "setVariableValue") == 0) {return PIVariant::fromValue(object->setVariableValue(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "setVariableName") == 0) {return PIVariant::fromValue(object->setVariableName(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "setVariableValue") == 0) {return PIVariant::fromValue(object->setVariableValue(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "setVariableName") == 0) {return PIVariant::fromValue(object->setVariableName(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "removeVariable") == 0) {object->removeVariable(arg0.toValue()); return PIVariant();} + if (strcmp(function, "removeVariable") == 0) {object->removeVariable(arg0.toValue()); return PIVariant();} + if (strcmp(function, "clearCustomVariables") == 0) {object->clearCustomVariables(); return PIVariant();} + if (strcmp(function, "sortVariables") == 0) {object->sortVariables(); return PIVariant();} + if (strcmp(function, "getBaseFunction") == 0) {return PIVariant::fromValue(object->getBaseFunction(arg0.toValue()));} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIEvaluatorContent\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIEvaluator * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "data") == 0) {return PIVariant::fromValue(object->data());} + if (strcmp(function, "setData") == 0) {object->setData(arg0.toValue()); return PIVariant();} + if (strcmp(function, "check") == 0) {return PIVariant::fromValue(object->check(arg0.toValue()));} + if (strcmp(function, "isCorrect") == 0) {return PIVariant::fromValue(object->isCorrect());} + if (strcmp(function, "setVariable") == 0) {return PIVariant::fromValue(object->setVariable(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "setVariable") == 0) {object->setVariable(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "setCustomVariableValue") == 0) {object->setCustomVariableValue(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "evaluate") == 0) {return PIVariant::fromValue(object->evaluate());} + if (strcmp(function, "removeVariable") == 0) {object->removeVariable(arg0.toValue()); return PIVariant();} + if (strcmp(function, "clearCustomVariables") == 0) {object->clearCustomVariables(); return PIVariant();} + if (strcmp(function, "variableIndex") == 0) {return PIVariant::fromValue(object->variableIndex(arg0.toValue()));} + if (strcmp(function, "unknownVariables") == 0) {return PIVariant::fromValue(object->unknownVariables());} + if (strcmp(function, "expression") == 0) {return PIVariant::fromValue(object->expression());} + if (strcmp(function, "error") == 0) {return PIVariant::fromValue(object->error());} + if (strcmp(function, "lastResult") == 0) {return PIVariant::fromValue(object->lastResult());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIEvaluator\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIMultiProtocol * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "addProtocol") == 0) {object->addProtocol(arg0.toValue()); return PIVariant();} + if (strcmp(function, "protocol") == 0) {return PIVariant::fromValue(object->protocol(arg0.toValue()));} + if (strcmp(function, "protocol") == 0) {return PIVariant::fromValue(object->protocol(arg0.toValue()));} + if (strcmp(function, "startSend") == 0) {object->startSend(); return PIVariant();} + if (strcmp(function, "startReceive") == 0) {object->startReceive(); return PIVariant();} + if (strcmp(function, "start") == 0) {object->start(); return PIVariant();} + if (strcmp(function, "stopSend") == 0) {object->stopSend(); return PIVariant();} + if (strcmp(function, "stopReceive") == 0) {object->stopReceive(); return PIVariant();} + if (strcmp(function, "stop") == 0) {object->stop(); return PIVariant();} + if (strcmp(function, "worseQuality") == 0) {return PIVariant::fromValue(object->worseQuality());} + if (strcmp(function, "bestQuality") == 0) {return PIVariant::fromValue(object->bestQuality());} + if (strcmp(function, "count") == 0) {return PIVariant::fromValue(object->count());} + if (strcmp(function, "clear") == 0) {object->clear(); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIMultiProtocol\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIRepeater * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "firstChannelName") == 0) {return PIVariant::fromValue(object->firstChannelName());} + if (strcmp(function, "secondChannelName") == 0) {return PIVariant::fromValue(object->secondChannelName());} + if (strcmp(function, "receiveCount") == 0) {return PIVariant::fromValue(object->receiveCount());} + if (strcmp(function, "receiveCount_ptr") == 0) {return PIVariant::fromValue(object->receiveCount_ptr());} + if (strcmp(function, "sendCount") == 0) {return PIVariant::fromValue(object->sendCount());} + if (strcmp(function, "sendCount_ptr") == 0) {return PIVariant::fromValue(object->sendCount_ptr());} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIRepeater\"!"; + return PIVariant(); +} + +PIVariant execFunction(PICodec * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "setFromCoding") == 0) {object->setFromCoding(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setToCoding") == 0) {object->setToCoding(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setCodings") == 0) {object->setCodings(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "availableCodecs") == 0) {return PIVariant::fromValue(object->availableCodecs());} + if (strcmp(function, "encode") == 0) {return PIVariant::fromValue(object->encode(arg0.toValue()));} + if (strcmp(function, "decode") == 0) {return PIVariant::fromValue(object->decode(arg0.toValue()));} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PICodec\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIPeer * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "send") == 0) {return PIVariant::fromValue(object->send(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "sendToAll") == 0) {object->sendToAll(arg0.toValue()); return PIVariant();} + if (strcmp(function, "sendToAll") == 0) {object->sendToAll(arg0.toValue()); return PIVariant();} + if (strcmp(function, "sendToAll") == 0) {object->sendToAll(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "isMulticastReceive") == 0) {return PIVariant::fromValue(object->isMulticastReceive());} + if (strcmp(function, "isBroadcastReceive") == 0) {return PIVariant::fromValue(object->isBroadcastReceive());} + if (strcmp(function, "allPeers") == 0) {return PIVariant::fromValue >(object->allPeers());} + if (strcmp(function, "isPeerExists") == 0) {return PIVariant::fromValue(object->isPeerExists(arg0.toValue()));} + if (strcmp(function, "getPeerByName") == 0) {return PIVariant::fromValue(object->getPeerByName(arg0.toValue()));} + if (strcmp(function, "lock") == 0) {object->lock(); return PIVariant();} + if (strcmp(function, "unlock") == 0) {object->unlock(); return PIVariant();} + if (strcmp(function, "dataReceivedEvent") == 0) {object->dataReceivedEvent(arg0.toValue(), arg1.toValue()); return PIVariant();} + if (strcmp(function, "peerConnectedEvent") == 0) {object->peerConnectedEvent(arg0.toValue()); return PIVariant();} + if (strcmp(function, "peerDisconnectedEvent") == 0) {object->peerDisconnectedEvent(arg0.toValue()); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIPeer\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIBinaryLog * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "playMode") == 0) {return PIVariant::fromValue(object->playMode());} + if (strcmp(function, "logDir") == 0) {return PIVariant::fromValue(object->logDir());} + if (strcmp(function, "filePrefix") == 0) {return PIVariant::fromValue(object->filePrefix());} + if (strcmp(function, "defaultID") == 0) {return PIVariant::fromValue(object->defaultID());} + if (strcmp(function, "playSpeed") == 0) {return PIVariant::fromValue(object->playSpeed());} + if (strcmp(function, "rapidStart") == 0) {return PIVariant::fromValue(object->rapidStart());} + if (strcmp(function, "setPlayMode") == 0) {object->setPlayMode(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setLogDir") == 0) {object->setLogDir(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setFilePrefix") == 0) {object->setFilePrefix(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setDefaultID") == 0) {object->setDefaultID(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setRapidStart") == 0) {object->setRapidStart(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setPlaySpeed") == 0) {object->setPlaySpeed(arg0.toValue()); return PIVariant();} + if (strcmp(function, "writeBinLog") == 0) {return PIVariant::fromValue(object->writeBinLog(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "writeBinLog") == 0) {return PIVariant::fromValue(object->writeBinLog(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "readBinLog") == 0) {return PIVariant::fromValue(object->readBinLog(arg0.toValue()));} + if (strcmp(function, "readBinLog") == 0) {return PIVariant::fromValue(object->readBinLog(arg0.toValue(), arg1.toValue(), arg2.toValue()));} + if (strcmp(function, "isEnd") == 0) {return PIVariant::fromValue(object->isEnd());} + if (strcmp(function, "isEmpty") == 0) {return PIVariant::fromValue(object->isEmpty());} + if (strcmp(function, "lastReadedID") == 0) {return PIVariant::fromValue(object->lastReadedID());} + if (strcmp(function, "read") == 0) {return PIVariant::fromValue(object->read(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "write") == 0) {return PIVariant::fromValue(object->write(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "restart") == 0) {object->restart(); return PIVariant();} + if (strcmp(function, "createNewFile") == 0) {return PIVariant::fromValue(object->createNewFile());} + if (strcmp(function, "fileEnd") == 0) {object->fileEnd(); return PIVariant();} + if (strcmp(function, "fileError") == 0) {object->fileError(); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIBinaryLog\"!"; + return PIVariant(); +} + +PIVariant execFunction(PIUSB * object, const char * function, const PIVariant & arg0, const PIVariant & arg1, const PIVariant & arg2, const PIVariant & arg3) { + if (strcmp(function, "className") == 0) {return PIVariant::fromValue(object->className());} + if (strcmp(function, "currentDescriptor") == 0) {return PIVariant::fromValue(object->currentDescriptor());} + if (strcmp(function, "currentConfiguration") == 0) {return PIVariant::fromValue(object->currentConfiguration());} + if (strcmp(function, "currentInterface") == 0) {return PIVariant::fromValue(object->currentInterface());} + if (strcmp(function, "vendorID") == 0) {return PIVariant::fromValue(object->vendorID());} + if (strcmp(function, "productID") == 0) {return PIVariant::fromValue(object->productID());} + if (strcmp(function, "deviceNumber") == 0) {return PIVariant::fromValue(object->deviceNumber());} + if (strcmp(function, "timeoutRead") == 0) {return PIVariant::fromValue(object->timeoutRead());} + if (strcmp(function, "timeoutWrite") == 0) {return PIVariant::fromValue(object->timeoutWrite());} + if (strcmp(function, "endpointRead") == 0) {return PIVariant::fromValue(object->endpointRead());} + if (strcmp(function, "endpointWrite") == 0) {return PIVariant::fromValue(object->endpointWrite());} + if (strcmp(function, "endpoints") == 0) {return PIVariant::fromValue >(object->endpoints());} + if (strcmp(function, "endpointsRead") == 0) {return PIVariant::fromValue >(object->endpointsRead());} + if (strcmp(function, "endpointsWrite") == 0) {return PIVariant::fromValue >(object->endpointsWrite());} + if (strcmp(function, "getEndpointByAddress") == 0) {return PIVariant::fromValue(object->getEndpointByAddress(arg0.toValue()));} + if (strcmp(function, "setVendorID") == 0) {object->setVendorID(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setProductID") == 0) {object->setProductID(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setConfiguration") == 0) {return PIVariant::fromValue(object->setConfiguration(arg0.toValue()));} + if (strcmp(function, "setInterface") == 0) {return PIVariant::fromValue(object->setInterface(arg0.toValue()));} + if (strcmp(function, "setEndpointRead") == 0) {object->setEndpointRead(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setEndpointWrite") == 0) {object->setEndpointWrite(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setDeviceNumber") == 0) {object->setDeviceNumber(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setTimeoutRead") == 0) {object->setTimeoutRead(arg0.toValue()); return PIVariant();} + if (strcmp(function, "setTimeoutWrite") == 0) {object->setTimeoutWrite(arg0.toValue()); return PIVariant();} + if (strcmp(function, "read") == 0) {return PIVariant::fromValue(object->read(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "write") == 0) {return PIVariant::fromValue(object->write(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "controlWrite") == 0) {return PIVariant::fromValue(object->controlWrite(arg0.toValue(), arg1.toValue()));} + if (strcmp(function, "flush") == 0) {object->flush(); return PIVariant();} + PICout(AddNewLine) << "Can`t find function \"" << function << "\" in class \"PIUSB\"!"; + return PIVariant(); +} + + +__ClassInfo_TEST_H_Initializer__::__ClassInfo_TEST_H_Initializer__() { + if (_inited_) return; + _inited_ = true; + + ClassInfo * ci; + TypeInfo * ni; + FunctionInfo * fi; + EnumInfo * ei; + +// Classes + + ci = new ClassInfo(); + (*classesInfo)["PIMonitor"] = ci; + ci->name = "PIMonitor"; + ci->variables << TypeInfo("containers", "int"); + ci->variables << TypeInfo("strings", "int"); + ci->variables << TypeInfo("threads", "int"); + ci->variables << TypeInfo("timers", "int"); + ci->variables << TypeInfo("serials", "int"); + ci->variables << TypeInfo("ethernets", "int"); + ci->variables << TypeInfo("files", "int"); + ci->variables << TypeInfo("objects", "int"); + + ci = new ClassInfo(); + (*classesInfo)["PIInit"] = ci; + ci->name = "PIInit"; + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fileExists"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("p", "string &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PICout"] = ci; + ci->name = "PICout"; + ci->variables << TypeInfo("fo_", "bool"); + ci->variables << TypeInfo("cc_", "bool"); + ci->variables << TypeInfo("fc_", "bool"); + ci->variables << TypeInfo("cnb_", "int"); + ci->variables << TypeInfo("attr_", "int"); + ci->variables << TypeInfo("co_", "PICoutControls"); + ci->variables << TypeInfo("cos_", "std::stack"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setControl"; fi->return_type = TypeInfo("", "PICout &"); + fi->arguments << TypeInfo("c", "PICoutControl"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setControl"; fi->return_type = TypeInfo("", "PICout &"); + fi->arguments << TypeInfo("c", "PICoutControls"); + fi->arguments << TypeInfo("save", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "saveControl"; fi->return_type = TypeInfo("", "PICout &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "restoreControl"; fi->return_type = TypeInfo("", "PICout &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "space"; fi->return_type = TypeInfo("", "PICout &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "quote"; fi->return_type = TypeInfo("", "PICout &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "newLine"; fi->return_type = TypeInfo("", "PICout &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "applyFormat"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("f", "PICoutFormat"); + + ci = new ClassInfo(); + (*classesInfo)["PIMutex"] = ci; + ci->name = "PIMutex"; + ci->variables << TypeInfo("mutex", "pthread_mutex_t"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "lock"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "unlock"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "tryLock"; fi->return_type = TypeInfo("", "bool"); + + ci = new ClassInfo(); + (*classesInfo)["PIMutexLocker"] = ci; + ci->name = "PIMutexLocker"; + ci->variables << TypeInfo("mutex", "PIMutex*"); + + ci = new ClassInfo(); + (*classesInfo)["PIBitArray"] = ci; + ci->name = "PIBitArray"; + ci->variables << TypeInfo("data_", "PIVector"); + ci->variables << TypeInfo("size_", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "bitSize"; fi->return_type = TypeInfo("", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "byteSize"; fi->return_type = TypeInfo("", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "resize"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("size", "uint &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearBit"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("index", "uint &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setBit"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("index", "uint &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBit"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("index", "uint &", Const); + fi->arguments << TypeInfo("value", "bool &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBit"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("index", "uint &", Const); + fi->arguments << TypeInfo("value", "uchar &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "push_back"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("value", "bool &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "push_back"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("value", "uchar &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "insert"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("index", "uint &", Const); + fi->arguments << TypeInfo("value", "bool &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "insert"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("index", "uint &", Const); + fi->arguments << TypeInfo("value", "uchar &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "push_front"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("value", "bool &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "push_front"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("value", "uchar &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "pop_back"; fi->return_type = TypeInfo("", "PIBitArray &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "pop_front"; fi->return_type = TypeInfo("", "PIBitArray &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "append"; fi->return_type = TypeInfo("", "PIBitArray &"); + fi->arguments << TypeInfo("ba", "PIBitArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "data"; fi->return_type = TypeInfo("", "uchar *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toUChar"; fi->return_type = TypeInfo("", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toUShort"; fi->return_type = TypeInfo("", "ushort"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toUInt"; fi->return_type = TypeInfo("", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toULong"; fi->return_type = TypeInfo("", "ulong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toULLong"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "at"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("index", "uint &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "bytesInBits"; fi->return_type = TypeInfo("", "uint"); + fi->arguments << TypeInfo("bits", "uint &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIHuffman"] = ci; + ci->name = "PIHuffman"; + ci->variables << TypeInfo("nodes", "PIVector"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "compress"; fi->return_type = TypeInfo("", "PIVector"); + fi->arguments << TypeInfo("src", "PIVector &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "nodeCompare"; fi->return_type = TypeInfo("", "int", Static); + fi->arguments << TypeInfo("f", "void *", Const); + fi->arguments << TypeInfo("s", "void *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "calcFrequencies"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("src", "PIVector &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIHuffman::node"] = ci; + ci->name = "PIHuffman::node"; + ci->variables << TypeInfo("freq", "int"); + ci->variables << TypeInfo("word", "PIVector"); + ci->variables << TypeInfo("path", "PIBitArray"); + ci->variables << TypeInfo("parent", "node*"); + ci->variables << TypeInfo("right", "node*"); + ci->variables << TypeInfo("left", "node*"); + + ci = new ClassInfo(); + (*classesInfo)["PIByteArray"] = ci; + ci->name = "PIByteArray"; + ci->variables << TypeInfo("base64HelpStruct", "union"); + ci->variables << TypeInfo("base64Table", "char[64]", Const | Static); + ci->variables << TypeInfo("base64InvTable", "char[256]", Const | Static); + ci->variables << TypeInfo("huffman", "PIHuffman", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "resized"; fi->return_type = TypeInfo("", "PIByteArray"); + fi->arguments << TypeInfo("new_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "convertToBase64"; fi->return_type = TypeInfo("", "PIByteArray &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "convertFromBase64"; fi->return_type = TypeInfo("", "PIByteArray &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toBase64"; fi->return_type = TypeInfo("", "PIByteArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromBase64"; fi->return_type = TypeInfo("", "PIByteArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "compressRLE"; fi->return_type = TypeInfo("", "PIByteArray &"); + fi->arguments << TypeInfo("threshold", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "decompressRLE"; fi->return_type = TypeInfo("", "PIByteArray &"); + fi->arguments << TypeInfo("threshold", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "compressedRLE"; fi->return_type = TypeInfo("", "PIByteArray"); + fi->arguments << TypeInfo("threshold", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "decompressedRLE"; fi->return_type = TypeInfo("", "PIByteArray"); + fi->arguments << TypeInfo("threshold", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "compressHuffman"; fi->return_type = TypeInfo("", "PIByteArray &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "append"; fi->return_type = TypeInfo("", "PIByteArray &"); + fi->arguments << TypeInfo("data_", "void *", Const); + fi->arguments << TypeInfo("size_", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "append"; fi->return_type = TypeInfo("", "PIByteArray &"); + fi->arguments << TypeInfo("data_", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checksumPlain8"; fi->return_type = TypeInfo("", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checksumPlain32"; fi->return_type = TypeInfo("", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checksumCRC8"; fi->return_type = TypeInfo("", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checksumCRC16"; fi->return_type = TypeInfo("", "ushort"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checksumCRC32"; fi->return_type = TypeInfo("", "uint"); + + ci = new ClassInfo(); + (*classesInfo)["PIByteArray::RawData"] = ci; + ci->name = "PIByteArray::RawData"; + ci->variables << TypeInfo("d", "void*"); + ci->variables << TypeInfo("s", "int"); + + ci = new ClassInfo(); + (*classesInfo)["PIChar"] = ci; + ci->name = "PIChar"; + ci->variables << TypeInfo("ch", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isDigit"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isHex"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isGraphical"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isControl"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isLower"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isUpper"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isPrint"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isSpace"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isAlpha"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isAscii"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toInt"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toWCharPtr"; fi->return_type = TypeInfo("", "const wchar_t *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toCharPtr"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toWChar"; fi->return_type = TypeInfo("", "wchar_t"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toAscii"; fi->return_type = TypeInfo("", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "unicode16Code"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toUpper"; fi->return_type = TypeInfo("", "PIChar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toLower"; fi->return_type = TypeInfo("", "PIChar"); + + ci = new ClassInfo(); + (*classesInfo)["PIString"] = ci; + ci->name = "PIString"; + ci->variables << TypeInfo("toBaseN", "char[]", Const | Static); + ci->variables << TypeInfo("fromBaseN", "int[]", Const | Static); + ci->variables << TypeInfo("data_", "PIByteArray", Mutable); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "mid"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("start", "int", Const); + fi->arguments << TypeInfo("len", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "left"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("len", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "right"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("len", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "cutMid"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("start", "int", Const); + fi->arguments << TypeInfo("len", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "cutLeft"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("len", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "cutRight"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("len", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "trim"; fi->return_type = TypeInfo("", "PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "trimmed"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "replace"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("from", "int", Const); + fi->arguments << TypeInfo("count", "int", Const); + fi->arguments << TypeInfo("with", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "replaced"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("from", "int", Const); + fi->arguments << TypeInfo("count", "int", Const); + fi->arguments << TypeInfo("with", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "replace"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("what", "PIString &", Const); + fi->arguments << TypeInfo("with", "PIString &", Const); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "replaced"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("what", "PIString &", Const); + fi->arguments << TypeInfo("with", "PIString &", Const); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "replaceAll"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("what", "PIString &", Const); + fi->arguments << TypeInfo("with", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "replaceAll"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("what", "PIString &", Const); + fi->arguments << TypeInfo("with", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "insert"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("index", "int", Const); + fi->arguments << TypeInfo("c", "PIChar &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "insert"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("index", "int", Const); + fi->arguments << TypeInfo("c", "char &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "insert"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("index", "int", Const); + fi->arguments << TypeInfo("str", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "insert"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("index", "int", Const); + fi->arguments << TypeInfo("c", "char *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "expandRightTo"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("len", "int", Const); + fi->arguments << TypeInfo("c", "PIChar &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "expandLeftTo"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("len", "int", Const); + fi->arguments << TypeInfo("c", "PIChar &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "reverse"; fi->return_type = TypeInfo("", "PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "reversed"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "takeMid"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("start", "int", Const); + fi->arguments << TypeInfo("len", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "takeLeft"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("len", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "takeRight"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("len", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "takeSymbol"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "takeWord"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "takeCWord"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "takeLine"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "takeNumber"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "takeRange"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("start", "PIChar &", Const); + fi->arguments << TypeInfo("end", "PIChar &", Const); + fi->arguments << TypeInfo("shield", "PIChar &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "lengthAscii"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "data"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stdString"; fi->return_type = TypeInfo("", "std::string"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toByteArray"; fi->return_type = TypeInfo("", "PIByteArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "split"; fi->return_type = TypeInfo("", "PIStringList"); + fi->arguments << TypeInfo("delim", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toUpperCase"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toLowerCase"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toNativeDecimalPoints"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "find"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("str", "char", Const); + fi->arguments << TypeInfo("start", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "find"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("str", "PIString", Const); + fi->arguments << TypeInfo("start", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "find"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("str", "char *", Const); + fi->arguments << TypeInfo("start", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "find"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("str", "string", Const); + fi->arguments << TypeInfo("start", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findLast"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("str", "char", Const); + fi->arguments << TypeInfo("start", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findLast"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("str", "PIString", Const); + fi->arguments << TypeInfo("start", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findLast"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("str", "char *", Const); + fi->arguments << TypeInfo("start", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findLast"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("str", "string", Const); + fi->arguments << TypeInfo("start", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findWord"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("word", "PIString &", Const); + fi->arguments << TypeInfo("start", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findCWord"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("word", "PIString &", Const); + fi->arguments << TypeInfo("start", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startsWith"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("str", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "endsWith"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("str", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "length"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isEmpty"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toBool"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toChar"; fi->return_type = TypeInfo("", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toShort"; fi->return_type = TypeInfo("", "short"); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toUShort"; fi->return_type = TypeInfo("", "ushort"); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toInt"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toUInt"; fi->return_type = TypeInfo("", "uint"); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toLong"; fi->return_type = TypeInfo("", "long"); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toULong"; fi->return_type = TypeInfo("", "ulong"); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toLLong"; fi->return_type = TypeInfo("", "llong"); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toULLong"; fi->return_type = TypeInfo("", "ullong"); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toFloat"; fi->return_type = TypeInfo("", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toDouble"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toLDouble"; fi->return_type = TypeInfo("", "ldouble"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "short", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "ushort", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "int", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "uint", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "long", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "ulong", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "llong &", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "ullong &", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "float", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "double &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setNumber"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("value", "ldouble &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReadableSize"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("bytes", "llong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "short", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "ushort", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "int", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "uint", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "long", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "ulong", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "llong &", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "ullong &", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "float", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "double &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumber"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "ldouble &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromBool"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "bool", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readableSize"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("bytes", "llong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeAll"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("v", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeAll"; fi->return_type = TypeInfo("", "PIString &"); + fi->arguments << TypeInfo("v", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumberBaseS"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "llong", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNumberBaseU"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("value", "ullong", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toNumberBase"; fi->return_type = TypeInfo("", "llong", Static); + fi->arguments << TypeInfo("value", "PIString &", Const); + fi->arguments << TypeInfo("base", "int"); + fi->arguments << TypeInfo("ok", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "appendFromChars"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("c", "char *", Const); + fi->arguments << TypeInfo("s", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "convertToStd"; fi->return_type = TypeInfo("", "string"); + + ci = new ClassInfo(); + (*classesInfo)["PIStringList"] = ci; + ci->name = "PIStringList"; + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "join"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("delim", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeStrings"; fi->return_type = TypeInfo("", "PIStringList &"); + fi->arguments << TypeInfo("value", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "remove"; fi->return_type = TypeInfo("", "PIStringList &"); + fi->arguments << TypeInfo("num", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "remove"; fi->return_type = TypeInfo("", "PIStringList &"); + fi->arguments << TypeInfo("num", "uint"); + fi->arguments << TypeInfo("count", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeDuplicates"; fi->return_type = TypeInfo("", "PIStringList &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "trim"; fi->return_type = TypeInfo("", "PIStringList &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "contentSize"; fi->return_type = TypeInfo("", "uint"); + + ci = new ClassInfo(); + (*classesInfo)["PISystemTime"] = ci; + ci->name = "PISystemTime"; + ci->variables << TypeInfo("seconds", "long"); + ci->variables << TypeInfo("nanoseconds", "long"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toSeconds"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toMilliseconds"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toMicroseconds"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toNanoseconds"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addSeconds"; fi->return_type = TypeInfo("", "PISystemTime &"); + fi->arguments << TypeInfo("v", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addMilliseconds"; fi->return_type = TypeInfo("", "PISystemTime &"); + fi->arguments << TypeInfo("v", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addMicroseconds"; fi->return_type = TypeInfo("", "PISystemTime &"); + fi->arguments << TypeInfo("v", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addNanoseconds"; fi->return_type = TypeInfo("", "PISystemTime &"); + fi->arguments << TypeInfo("v", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sleep"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "abs"; fi->return_type = TypeInfo("", "PISystemTime"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromSeconds"; fi->return_type = TypeInfo("", "PISystemTime", Static); + fi->arguments << TypeInfo("v", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromMilliseconds"; fi->return_type = TypeInfo("", "PISystemTime", Static); + fi->arguments << TypeInfo("v", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromMicroseconds"; fi->return_type = TypeInfo("", "PISystemTime", Static); + fi->arguments << TypeInfo("v", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromNanoseconds"; fi->return_type = TypeInfo("", "PISystemTime", Static); + fi->arguments << TypeInfo("v", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checkOverflows"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PITime"] = ci; + ci->name = "PITime"; + ci->variables << TypeInfo("milliseconds", "int"); + ci->variables << TypeInfo("seconds", "int"); + ci->variables << TypeInfo("minutes", "int"); + ci->variables << TypeInfo("hours", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toString"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("format", "PIString &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIDate"] = ci; + ci->name = "PIDate"; + ci->variables << TypeInfo("day", "int"); + ci->variables << TypeInfo("month", "int"); + ci->variables << TypeInfo("year", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toString"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("format", "PIString &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIDateTime"] = ci; + ci->name = "PIDateTime"; + ci->variables << TypeInfo("milliseconds", "int"); + ci->variables << TypeInfo("seconds", "int"); + ci->variables << TypeInfo("minutes", "int"); + ci->variables << TypeInfo("hours", "int"); + ci->variables << TypeInfo("day", "int"); + ci->variables << TypeInfo("month", "int"); + ci->variables << TypeInfo("year", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "normalized"; fi->return_type = TypeInfo("", "PIDateTime"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "normalize"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toString"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("format", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toSecondSinceEpoch"; fi->return_type = TypeInfo("", "time_t"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toSystemTime"; fi->return_type = TypeInfo("", "PISystemTime"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromSecondSinceEpoch"; fi->return_type = TypeInfo("", "PIDateTime", Static); + fi->arguments << TypeInfo("sec", "time_t", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromSystemTime"; fi->return_type = TypeInfo("", "PIDateTime", Static); + fi->arguments << TypeInfo("st", "PISystemTime &", Const); + + ci = new ClassInfo(); + (*classesInfo)["TransferFunction"] = ci; + ci->name = "TransferFunction"; + ci->variables << TypeInfo("vector_Bm", "PIVector"); + ci->variables << TypeInfo("vector_An", "PIVector"); + + ci = new ClassInfo(); + (*classesInfo)["Solver"] = ci; + ci->name = "Solver"; + ci->variables << TypeInfo("X", "PIMathVectord"); + ci->variables << TypeInfo("method_global", "Solver::Method", Static); + ci->variables << TypeInfo("methods_desc", "char[]", Const | Static); + ci->variables << TypeInfo("A", "PIMathMatrixd"); + ci->variables << TypeInfo("M", "PIMathMatrixd"); + ci->variables << TypeInfo("d", "PIMathVectord"); + ci->variables << TypeInfo("a1", "PIMathVectord"); + ci->variables << TypeInfo("b1", "PIMathVectord"); + ci->variables << TypeInfo("k1", "PIMathVectord"); + ci->variables << TypeInfo("k2", "PIMathVectord"); + ci->variables << TypeInfo("k3", "PIMathVectord"); + ci->variables << TypeInfo("k4", "PIMathVectord"); + ci->variables << TypeInfo("xx", "PIMathVectord"); + ci->variables << TypeInfo("XX", "PIMathVectord"); + ci->variables << TypeInfo("Y", "PIMathVectord"); + ci->variables << TypeInfo("pY", "PIMathVectord"); + ci->variables << TypeInfo("F", "PIVector"); + ci->variables << TypeInfo("times", "PIVector"); + ci->variables << TypeInfo("size", "uint"); + ci->variables << TypeInfo("step", "uint"); + ci->variables << TypeInfo("method", "Solver::Method"); + ci->variables << TypeInfo("sum", "double"); + ci->variables << TypeInfo("td", "double"); + ci->variables << TypeInfo("ct", "double"); + ci->variables << TypeInfo("lp", "double"); + ci->variables << TypeInfo("dh", "double"); + ci->variables << TypeInfo("t", "double"); + ci->variables << TypeInfo("x1", "double"); + ci->variables << TypeInfo("x0", "double"); + ci->variables << TypeInfo("ok", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solve"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fromTF"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("TF", "TransferFunction &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setMethod"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("m", "Method"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setTime"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("time", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solveEyler1"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solveEyler2"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solveRK4"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solveABM2"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solveABM3"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solveABM4"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solvePA"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + fi->arguments << TypeInfo("deg", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solvePA2"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solvePA3"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solvePA4"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "solvePA5"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("u", "double"); + fi->arguments << TypeInfo("h", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "moveF"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PIFFT"] = ci; + ci->name = "PIFFT"; + ci->variables << TypeInfo("result", "PIVector"); + ci->variables << TypeInfo("prepared", "bool"); + ci->variables << TypeInfo("curplan", "PIFFT::ftplan"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "calcFFT"; fi->return_type = TypeInfo("", "PIVector *"); + fi->arguments << TypeInfo("val", "PIVector &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "calcFFT"; fi->return_type = TypeInfo("", "PIVector *"); + fi->arguments << TypeInfo("val", "PIVector &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "calcFFTinverse"; fi->return_type = TypeInfo("", "PIVector *"); + fi->arguments << TypeInfo("val", "PIVector &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "calcHilbert"; fi->return_type = TypeInfo("", "PIVector *"); + fi->arguments << TypeInfo("val", "PIVector &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getAmplitude"; fi->return_type = TypeInfo("", "PIVector"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "calc_coefs"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("cnt2", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "calc_indexes"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("cnt2", "uint"); + fi->arguments << TypeInfo("deep2", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "coef"; fi->return_type = TypeInfo("", "complexd"); + fi->arguments << TypeInfo("n", "uint"); + fi->arguments << TypeInfo("k", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fftc1d"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("a", "PIVector &", Const); + fi->arguments << TypeInfo("n", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fftc1r"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("a", "PIVector &", Const); + fi->arguments << TypeInfo("n", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fftc1dinv"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("a", "PIVector &", Const); + fi->arguments << TypeInfo("n", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "createPlan"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("n", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbasegeneratecomplexfftplan"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("n", "uint"); + fi->arguments << TypeInfo("plan", "ftplan *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbase_ftbasegenerateplanrec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("n", "int"); + fi->arguments << TypeInfo("tasktype", "int"); + fi->arguments << TypeInfo("plan", "ftplan *"); + fi->arguments << TypeInfo("plansize", "int *"); + fi->arguments << TypeInfo("precomputedsize", "int *"); + fi->arguments << TypeInfo("planarraysize", "int *"); + fi->arguments << TypeInfo("tmpmemsize", "int *"); + fi->arguments << TypeInfo("stackmemsize", "int *"); + fi->arguments << TypeInfo("stackptr", "ae_int_t"); + fi->arguments << TypeInfo("debugi", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbase_ftbaseprecomputeplanrec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("plan", "ftplan *"); + fi->arguments << TypeInfo("entryoffset", "int"); + fi->arguments << TypeInfo("stackptr", "ae_int_t"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbasefactorize"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("n", "int"); + fi->arguments << TypeInfo("n1", "int *"); + fi->arguments << TypeInfo("n2", "int *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbase_ftbasefindsmoothrec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("n", "int"); + fi->arguments << TypeInfo("seed", "int"); + fi->arguments << TypeInfo("leastfactor", "int"); + fi->arguments << TypeInfo("best", "int *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbasefindsmooth"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("n", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbaseexecuteplan"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("a", "PIVector *"); + fi->arguments << TypeInfo("aoffset", "int"); + fi->arguments << TypeInfo("n", "int"); + fi->arguments << TypeInfo("plan", "ftplan *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbaseexecuteplanrec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("a", "PIVector *"); + fi->arguments << TypeInfo("aoffset", "int"); + fi->arguments << TypeInfo("plan", "ftplan *"); + fi->arguments << TypeInfo("entryoffset", "int"); + fi->arguments << TypeInfo("stackptr", "ae_int_t"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbase_internalcomplexlintranspose"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("a", "PIVector *"); + fi->arguments << TypeInfo("m", "int"); + fi->arguments << TypeInfo("n", "int"); + fi->arguments << TypeInfo("astart", "int"); + fi->arguments << TypeInfo("buf", "PIVector *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbase_ffticltrec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("a", "PIVector *"); + fi->arguments << TypeInfo("astart", "int"); + fi->arguments << TypeInfo("astride", "int"); + fi->arguments << TypeInfo("b", "PIVector *"); + fi->arguments << TypeInfo("bstart", "int"); + fi->arguments << TypeInfo("bstride", "int"); + fi->arguments << TypeInfo("m", "int"); + fi->arguments << TypeInfo("n", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbase_internalreallintranspose"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("a", "PIVector *"); + fi->arguments << TypeInfo("m", "int"); + fi->arguments << TypeInfo("n", "int"); + fi->arguments << TypeInfo("astart", "int"); + fi->arguments << TypeInfo("buf", "PIVector *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbase_fftirltrec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("a", "PIVector *"); + fi->arguments << TypeInfo("astart", "int"); + fi->arguments << TypeInfo("astride", "int"); + fi->arguments << TypeInfo("b", "PIVector *"); + fi->arguments << TypeInfo("bstart", "int"); + fi->arguments << TypeInfo("bstride", "int"); + fi->arguments << TypeInfo("m", "int"); + fi->arguments << TypeInfo("n", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ftbase_ffttwcalc"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("a", "PIVector *"); + fi->arguments << TypeInfo("aoffset", "int"); + fi->arguments << TypeInfo("n1", "int"); + fi->arguments << TypeInfo("n2", "int"); + + ci = new ClassInfo(); + (*classesInfo)["PIFFT::ftplan"] = ci; + ci->name = "PIFFT::ftplan"; + ci->variables << TypeInfo("plan", "PIVector"); + ci->variables << TypeInfo("precomputed", "PIVector"); + ci->variables << TypeInfo("tmpbuf", "PIVector"); + ci->variables << TypeInfo("stackbuf", "PIVector"); + + ci = new ClassInfo(); + (*classesInfo)["PIVariant"] = ci; + ci->name = "PIVariant"; + ci->variables << TypeInfo("nion", "u"); + ci->variables << TypeInfo("_vbitarray", "PIBitArray"); + ci->variables << TypeInfo("_vbytearray", "PIByteArray"); + ci->variables << TypeInfo("_vstring", "PIString"); + ci->variables << TypeInfo("_vstringlist", "PIStringList"); + ci->variables << TypeInfo("_vcustom", "PIByteArray"); + ci->variables << TypeInfo("type_", "PIVariant::Type"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "char *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "bool", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "char", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "uchar", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "short", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "ushort", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "int &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "uint &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "long &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "ulong &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "llong &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "ullong &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "float &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "double &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "ldouble &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "complexd &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "complexld &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "PIBitArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "PIStringList &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "PITime &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "PIDate &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "PIDateTime &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "PISystemTime &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toBool"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toInt"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toLLong"; fi->return_type = TypeInfo("", "llong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toFloat"; fi->return_type = TypeInfo("", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toDouble"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toLDouble"; fi->return_type = TypeInfo("", "ldouble"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toComplexd"; fi->return_type = TypeInfo("", "complexd"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toComplexld"; fi->return_type = TypeInfo("", "complexld"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toTime"; fi->return_type = TypeInfo("", "PITime"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toDate"; fi->return_type = TypeInfo("", "PIDate"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toDateTime"; fi->return_type = TypeInfo("", "PIDateTime"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toSystemTime"; fi->return_type = TypeInfo("", "PISystemTime"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toString"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toStringList"; fi->return_type = TypeInfo("", "PIStringList"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toBitArray"; fi->return_type = TypeInfo("", "PIBitArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toByteArray"; fi->return_type = TypeInfo("", "PIByteArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "type"; fi->return_type = TypeInfo("", "PIVariant::Type"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "typeName"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isValid"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "typeFromName"; fi->return_type = TypeInfo("", "PIVariant::Type", Static); + fi->arguments << TypeInfo("tname", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "typeName"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("type", "PIVariant::Type"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "destroy"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PIObject"] = ci; + ci->name = "PIObject"; + ci->variables << TypeInfo("connections", "PIVector"); + ci->variables << TypeInfo("properties_", "PIMap"); + ci->variables << TypeInfo("objects", "PIVector", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "name"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "debug"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setName"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDebug"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("debug", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "properties"; fi->return_type = TypeInfo("", "const PIMap &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "propertiesCount"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "property"; fi->return_type = TypeInfo("", "PIVariant"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setProperty"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "PIVariant &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isPropertyExists"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piConnect"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("src", "PIObject *"); + fi->arguments << TypeInfo("sig", "PIString &", Const); + fi->arguments << TypeInfo("dest", "void *"); + fi->arguments << TypeInfo("ev_h", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piConnect"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("src", "PIObject *"); + fi->arguments << TypeInfo("sig", "PIString &", Const); + fi->arguments << TypeInfo("dest", "void *"); + fi->arguments << TypeInfo("ev_h", "void *"); + fi->arguments << TypeInfo("e_h", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piConnect"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("src", "PIString &", Const); + fi->arguments << TypeInfo("sig", "PIString &", Const); + fi->arguments << TypeInfo("dest", "void *"); + fi->arguments << TypeInfo("ev_h", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piConnect"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("src", "PIObject *"); + fi->arguments << TypeInfo("sig", "PIString &", Const); + fi->arguments << TypeInfo("dest", "PIString &", Const); + fi->arguments << TypeInfo("ev_h", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piConnect"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("src", "PIString &", Const); + fi->arguments << TypeInfo("sig", "PIString &", Const); + fi->arguments << TypeInfo("dest", "PIString &", Const); + fi->arguments << TypeInfo("ev_h", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piDisconnect"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("src", "PIObject *"); + fi->arguments << TypeInfo("sig", "PIString &", Const); + fi->arguments << TypeInfo("dest", "void *"); + fi->arguments << TypeInfo("ev_h", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piDisconnect"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("src", "PIObject *"); + fi->arguments << TypeInfo("sig", "PIString &", Const); + fi->arguments << TypeInfo("dest", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piDisconnect"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("src", "PIObject *"); + fi->arguments << TypeInfo("sig", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piDisconnect"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("src", "PIObject *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "raiseEvent"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("sender", "PIObject *"); + fi->arguments << TypeInfo("event", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "raiseEvent"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("destObject", "PIString &", Const); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findByName"; fi->return_type = TypeInfo("", "PIObject *", Static); + fi->arguments << TypeInfo("name", "PIString &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIObject::Connection"] = ci; + ci->name = "PIObject::Connection"; + ci->variables << TypeInfo("slot", "void*"); + ci->variables << TypeInfo("signal", "void*"); + ci->variables << TypeInfo("event", "PIString"); + ci->variables << TypeInfo("dest", "void*"); + + ci = new ClassInfo(); + (*classesInfo)["PIThread"] = ci; + ci->name = "PIThread"; + ci->parents << "PIObject"; + ci->variables << TypeInfo("terminating", "bool", Volatile); + ci->variables << TypeInfo("running", "bool", Volatile); + ci->variables << TypeInfo("lockRun", "bool", Volatile); + ci->variables << TypeInfo("timer", "int"); + ci->variables << TypeInfo("policy", "int"); + ci->variables << TypeInfo("data_", "void*"); + ci->variables << TypeInfo("mutex_", "PIMutex"); + ci->variables << TypeInfo("priority_", "PIThread::Priority"); + ci->variables << TypeInfo("ret_func", "ThreadFunc"); + ci->variables << TypeInfo("thread", "pthread_t"); + ci->variables << TypeInfo("sparam", "sched_param"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("timer_delay", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("timer_delay", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("func", "ThreadFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("func", "ThreadFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("func", "ThreadFunc"); + fi->arguments << TypeInfo("timer_delay", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("func", "ThreadFunc"); + fi->arguments << TypeInfo("timer_delay", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_startOnce__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startOnce"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_startOnce__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("func", "ThreadFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startOnce"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("func", "ThreadFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_stop__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stop"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_stop__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("wait", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stop"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("wait", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_terminate__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "terminate"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("d", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSlot"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("func", "ThreadFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setPriority"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("prior", "PIThread::Priority"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "priority"; fi->return_type = TypeInfo("", "PIThread::Priority"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isRunning"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isStopping"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_waitForStart__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "waitForStart"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_waitForStart__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("timeout_msecs", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "waitForStart"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("timeout_msecs", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_waitForFinish__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "waitForFinish"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_waitForFinish__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("timeout_msecs", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "waitForFinish"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("timeout_msecs", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "needLockRun"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("need", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_lock__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "lock"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_unlock__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "unlock"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "mutex"; fi->return_type = TypeInfo("", "PIMutex &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_started__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "started"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_stopped__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stopped"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "thread_function"; fi->return_type = TypeInfo("", "void *", Static); + fi->arguments << TypeInfo("t", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "thread_function_once"; fi->return_type = TypeInfo("", "void *", Static); + fi->arguments << TypeInfo("t", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "begin"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "run"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "end"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PITimer"] = ci; + ci->name = "PITimer"; + ci->parents << "PIThread"; + ci->variables << TypeInfo("st_time", "PISystemTime"); + ci->variables << TypeInfo("inc_time", "PISystemTime"); + ci->variables << TypeInfo("deferred_", "bool"); + ci->variables << TypeInfo("running_", "bool"); + ci->variables << TypeInfo("interval_", "double"); + ci->variables << TypeInfo("t_st", "timespec"); + ci->variables << TypeInfo("t_cur", "timespec"); + ci->variables << TypeInfo("data", "void*"); + ci->variables << TypeInfo("ret_func", "TimerEvent"); + ci->variables << TypeInfo("ret_funcs", "PIVector"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data_", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSlot"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("slot", "TimerEvent"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "interval"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_reset__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "reset"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("msecs", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("msecs", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("msecs", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("msecs", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_deferredStart__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("interval_msecs", "double"); + fi->arguments << TypeInfo("delay_msecs", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "deferredStart"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("interval_msecs", "double"); + fi->arguments << TypeInfo("delay_msecs", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_deferredStart__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("interval_msecs", "double"); + fi->arguments << TypeInfo("start_datetime", "PIDateTime &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "deferredStart"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("interval_msecs", "double"); + fi->arguments << TypeInfo("start_datetime", "PIDateTime &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_stop__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stop"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addDelimiter"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("delim", "int"); + fi->arguments << TypeInfo("slot", "TimerEvent"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeDelimiter"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("delim", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeDelimiter"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("slot", "TimerEvent"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeDelimiter"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("delim", "int"); + fi->arguments << TypeInfo("slot", "TimerEvent"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDelimiterValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("delim", "int"); + fi->arguments << TypeInfo("value", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDelimiterValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("slot", "TimerEvent"); + fi->arguments << TypeInfo("value", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDelimiterValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("delim", "int"); + fi->arguments << TypeInfo("slot", "TimerEvent"); + fi->arguments << TypeInfo("value", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "delimiterValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("delim", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "delimiterValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("delim", "int"); + fi->arguments << TypeInfo("slot", "TimerEvent"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_clearDelimiters__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearDelimiters"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "elapsed_n"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "elapsed_u"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "elapsed_m"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "elapsed_s"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "reset_time_n"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "reset_time_u"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "reset_time_m"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "reset_time_s"; fi->return_type = TypeInfo("", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "reset_time"; fi->return_type = TypeInfo("", "PISystemTime"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "elapsed_system_n"; fi->return_type = TypeInfo("", "double", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "elapsed_system_u"; fi->return_type = TypeInfo("", "double", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "elapsed_system_m"; fi->return_type = TypeInfo("", "double", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "elapsed_system_s"; fi->return_type = TypeInfo("", "double", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_timeout__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("delimiter", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "timeout"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("delimiter", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "tick"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("delimiter", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "run"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "end"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PITimer::TimerSlot"] = ci; + ci->name = "PITimer::TimerSlot"; + ci->variables << TypeInfo("slot", "TimerEvent"); + ci->variables << TypeInfo("delim", "int"); + ci->variables << TypeInfo("tick", "int"); + + ci = new ClassInfo(); + (*classesInfo)["PIKbdListener"] = ci; + ci->name = "PIKbdListener"; + ci->parents << "PIThread"; + ci->variables << TypeInfo("exiting", "bool", Static); + ci->variables << TypeInfo("ret_func", "KBFunc"); + ci->variables << TypeInfo("exit_key", "char"); + ci->variables << TypeInfo("exit_enabled", "bool"); + ci->variables << TypeInfo("is_active", "bool"); + ci->variables << TypeInfo("data_", "void*"); + ci->variables << TypeInfo("rc", "int"); + ci->variables << TypeInfo("ret", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "data"; fi->return_type = TypeInfo("", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("_data", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSlot"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("slot", "KBFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exitCaptured"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exitKey"; fi->return_type = TypeInfo("", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isActive"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_enableExitCapture__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "enableExitCapture"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_enableExitCapture__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("key", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "enableExitCapture"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("key", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_disableExitCapture__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "disableExitCapture"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_setActive__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setActive"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_setActive__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("yes", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setActive"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("yes", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_keyPressed__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("key", "char"); + fi->arguments << TypeInfo("data", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "keyPressed"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("key", "char"); + fi->arguments << TypeInfo("data", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "begin"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "run"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "end"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PICollection"] = ci; + ci->name = "PICollection"; + ci->variables << TypeInfo("_groups", "PIVector*", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "groups"; fi->return_type = TypeInfo("", "PIStringList", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "groupElements"; fi->return_type = TypeInfo("", "PIVector", Static); + fi->arguments << TypeInfo("group", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addToGroup"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("group", "PIString &", Const); + fi->arguments << TypeInfo("element", "PIObject *", Const); + + ci = new ClassInfo(); + (*classesInfo)["PICollection::CollectionAdder"] = ci; + ci->name = "PICollection::CollectionAdder"; + + ci = new ClassInfo(); + (*classesInfo)["PICollection::Group"] = ci; + ci->name = "PICollection::Group"; + ci->variables << TypeInfo("name", "PIString"); + ci->variables << TypeInfo("elements", "PIVector"); + + ci = new ClassInfo(); + (*classesInfo)["__PICollectionInitializer"] = ci; + ci->name = "__PICollectionInitializer"; + ci->variables << TypeInfo("_inited_", "bool", Static); + + ci = new ClassInfo(); + (*classesInfo)["PIIODevice"] = ci; + ci->name = "PIIODevice"; + ci->parents << "PIThread"; + ci->variables << TypeInfo("mode_", "PIIODevice::DeviceMode"); + ci->variables << TypeInfo("ret_func_", "ReadRetFunc"); + ci->variables << TypeInfo("init_", "bool"); + ci->variables << TypeInfo("opened_", "bool"); + ci->variables << TypeInfo("thread_started_", "bool"); + ci->variables << TypeInfo("raise_threaded_read_", "bool"); + ci->variables << TypeInfo("ret_data_", "void*"); + ci->variables << TypeInfo("timer", "PITimer"); + ci->variables << TypeInfo("write_thread", "PIThread"); + ci->variables << TypeInfo("buffer_in", "PIByteArray"); + ci->variables << TypeInfo("buffer_tr", "PIByteArray"); + ci->variables << TypeInfo("write_queue", "PIQueue >"); + ci->variables << TypeInfo("tri", "ullong"); + ci->variables << TypeInfo("readed_", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "mode"; fi->return_type = TypeInfo("", "PIIODevice::DeviceMode"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "path"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setPath"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isReadable"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isWriteable"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isInitialized"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isOpened"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isClosed"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "canRead"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "canWrite"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReopenEnabled"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("yes", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReopenTimeout"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("msecs", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isReopenEnabled"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "reopenTimeout"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setThreadedReadSlot"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("func", "ReadRetFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setThreadedReadData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("d", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setThreadedReadBufferSize"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("new_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "threadedReadBufferSize"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "threadedReadBuffer"; fi->return_type = TypeInfo("", "const uchar *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isThreadedRead"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startThreadedRead"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startThreadedRead"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("func", "ReadRetFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stopThreadedRead"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isThreadedWrite"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startThreadedWrite"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stopThreadedWrite"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearThreadedWriteQueue"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stop"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("wait", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "read"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("read_to", "void *"); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "read"; fi->return_type = TypeInfo("", "PIByteArray"); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readForTime"; fi->return_type = TypeInfo("", "PIByteArray"); + fi->arguments << TypeInfo("timeout_ms", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeThreaded"; fi->return_type = TypeInfo("", "ullong"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeThreaded"; fi->return_type = TypeInfo("", "ullong"); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configure"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("config_file", "PIString &", Const); + fi->arguments << TypeInfo("section", "PIString &", Const); + fi->arguments << TypeInfo("parent_section", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "createFromFullPath"; fi->return_type = TypeInfo("", "PIIODevice *", Static); + fi->arguments << TypeInfo("full_path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_open__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "open"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_open__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("_path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "open"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("_path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_open__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("_type", "DeviceMode &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "open"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("_type", "DeviceMode &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_open__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("_path", "PIString &", Const); + fi->arguments << TypeInfo("_mode", "DeviceMode &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "open"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("_path", "PIString &", Const); + fi->arguments << TypeInfo("_mode", "DeviceMode &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_close__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "close"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_initialize__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "initialize"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_flush__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "flush"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_opened__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "opened"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_closed__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "closed"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_threadedReadEvent__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("readed", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "threadedReadEvent"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("readed", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_threadedWriteEvent__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("id", "ullong"); + fi->arguments << TypeInfo("written_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "threadedWriteEvent"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("id", "ullong"); + fi->arguments << TypeInfo("written_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "init"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configureDevice"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("e_main", "void *", Const); + fi->arguments << TypeInfo("e_parent", "void *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "openDevice"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "closeDevice"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "threadedRead"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("readed", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fullPathPrefix"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "constructFullPath"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configureFromFullPath"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("full_path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "terminate"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_check_start__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("delim", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "check_start"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("delim", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_write_func__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write_func"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "copy"; fi->return_type = TypeInfo("", "PIIODevice *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "_init"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "begin"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "run"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "end"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PISerial"] = ci; + ci->name = "PISerial"; + ci->parents << "PIIODevice"; + ci->variables << TypeInfo("desc", "termios"); + ci->variables << TypeInfo("sdesc", "termios"); + ci->variables << TypeInfo("readed", "uint"); + ci->variables << TypeInfo("fd", "int"); + ci->variables << TypeInfo("vtime", "int"); + ci->variables << TypeInfo("block_read", "bool"); + ci->variables << TypeInfo("timer", "PITimer"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "copy"; fi->return_type = TypeInfo("", "PIIODevice *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSpeed"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("speed", "PISerial::Speed"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setOutSpeed"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("speed", "PISerial::Speed"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setInSpeed"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("speed", "PISerial::Speed"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDevice"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("dev", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setParameters"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("parameters_", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setParameter"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("parameter", "PISerial::Parameters"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isParameterSet"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("parameter", "PISerial::Parameters"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "parameters"; fi->return_type = TypeInfo("", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDataBitsCount"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("bits", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "dataBitsCount"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setPin"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("number", "int"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isPin"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("number", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setLE"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDTR"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setRTS"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setCTS"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setST"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSR"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setCAR"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setRNG"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDSR"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isLE"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isDTR"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isRTS"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isCTS"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isST"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isSR"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isCAR"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isRNG"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isDSR"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setVTime"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("t", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReadIsBlocking"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("yes", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "device"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "outSpeed"; fi->return_type = TypeInfo("", "PISerial::Speed"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "inSpeed"; fi->return_type = TypeInfo("", "PISerial::Speed"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "VTime"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "flush"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "read"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("read_to", "void *"); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "read"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("read_to", "void *"); + fi->arguments << TypeInfo("max_size", "int"); + fi->arguments << TypeInfo("timeout_ms", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "read"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("size", "int"); + fi->arguments << TypeInfo("timeout_ms", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readData"; fi->return_type = TypeInfo("", "PIByteArray"); + fi->arguments << TypeInfo("size", "int"); + fi->arguments << TypeInfo("timeout_ms", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("max_size", "int"); + fi->arguments << TypeInfo("wait", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + fi->arguments << TypeInfo("wait", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("data", "PIString &", Const); + fi->arguments << TypeInfo("wait", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + fi->arguments << TypeInfo("wait", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "availableSpeeds"; fi->return_type = TypeInfo("", "PIVector", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "availableDevices"; fi->return_type = TypeInfo("", "PIStringList", Static); + fi->arguments << TypeInfo("test", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fullPathPrefix"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configureFromFullPath"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("full_path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configureDevice"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("e_main", "void *", Const); + fi->arguments << TypeInfo("e_parent", "void *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "received"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "_init"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "applySettings"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "convertSpeed"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("speed", "PISerial::Speed"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setBit"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("bit", "int"); + fi->arguments << TypeInfo("on", "bool"); + fi->arguments << TypeInfo("bname", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isBit"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("bit", "int"); + fi->arguments << TypeInfo("bname", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "openDevice"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "closeDevice"; fi->return_type = TypeInfo("", "bool"); + + ci = new ClassInfo(); + (*classesInfo)["PIFile"] = ci; + ci->name = "PIFile"; + ci->parents << "PIIODevice"; + ci->variables << TypeInfo("fd", "FILE*"); + ci->variables << TypeInfo("ret", "int"); + ci->variables << TypeInfo("prec_", "int"); + ci->variables << TypeInfo("prec_str", "string"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "copy"; fi->return_type = TypeInfo("", "PIIODevice *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "flush"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "seek"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("position", "llong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "seekToBegin"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "seekToEnd"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "seekToLine"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("line", "llong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readChar"; fi->return_type = TypeInfo("", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readLine"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readAll"; fi->return_type = TypeInfo("", "llong"); + fi->arguments << TypeInfo("data", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readAll"; fi->return_type = TypeInfo("", "PIByteArray"); + fi->arguments << TypeInfo("forceRead", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setPath"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "size"; fi->return_type = TypeInfo("", "llong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "pos"; fi->return_type = TypeInfo("", "llong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isEnd"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isEmpty"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "precision"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setPrecision"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("prec", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "read"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("read_to", "void *"); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeToBinLog"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("id", "ushort"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "char", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "short", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "long", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "llong", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "uchar", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "ushort", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "uint", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "ulong", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "ullong", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "float", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinary"; fi->return_type = TypeInfo("", "PIFile &"); + fi->arguments << TypeInfo("v", "double", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_clear__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clear"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_remove__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "remove"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_resize__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("new_size", "llong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "resize"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("new_size", "llong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_resize__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("new_size", "llong"); + fi->arguments << TypeInfo("fill", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "resize"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("new_size", "llong"); + fi->arguments << TypeInfo("fill", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "openTemporary"; fi->return_type = TypeInfo("", "PIFile", Static); + fi->arguments << TypeInfo("mode", "PIIODevice::DeviceMode"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isExists"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "remove"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fullPathPrefix"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configureFromFullPath"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("full_path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "openDevice"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "closeDevice"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "strType"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("type", "PIIODevice::DeviceMode", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIProcess"] = ci; + ci->name = "PIProcess"; + ci->parents << "PIThread"; + ci->variables << TypeInfo("args", "PIStringList"); + ci->variables << TypeInfo("env", "PIStringList"); + ci->variables << TypeInfo("wd", "PIString"); + ci->variables << TypeInfo("out", "PIByteArray"); + ci->variables << TypeInfo("f_in", "PIFile"); + ci->variables << TypeInfo("f_out", "PIFile"); + ci->variables << TypeInfo("f_err", "PIFile"); + ci->variables << TypeInfo("g_in", "bool"); + ci->variables << TypeInfo("g_out", "bool"); + ci->variables << TypeInfo("g_err", "bool"); + ci->variables << TypeInfo("t_in", "bool"); + ci->variables << TypeInfo("t_out", "bool"); + ci->variables << TypeInfo("t_err", "bool"); + ci->variables << TypeInfo("pid", "pid_t"); + ci->variables << TypeInfo("tf_in", "FILE*"); + ci->variables << TypeInfo("tf_out", "FILE*"); + ci->variables << TypeInfo("tf_err", "FILE*"); + ci->variables << TypeInfo("exit_code", "int"); + ci->variables << TypeInfo("sz", "int"); + ci->variables << TypeInfo("as", "int"); + ci->variables << TypeInfo("is_exec", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exitCode"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "pID"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setGrabInput"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("yes", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setGrabOutput"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("yes", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setGrabError"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("yes", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setInputFile"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setOutputFile"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setErrorFile"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "unsetInputFile"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "unsetOutputFile"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "unsetErrorFile"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "workingDirectory"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setWorkingDirectory"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "resetWorkingDirectory"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readOutput"; fi->return_type = TypeInfo("", "PIByteArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readError"; fi->return_type = TypeInfo("", "PIByteArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "environment"; fi->return_type = TypeInfo("", "PIStringList"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearEnvironment"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeEnvironmentVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("variable", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setEnvironmentVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("variable", "PIString &", Const); + fi->arguments << TypeInfo("value", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_exec__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("program", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("program", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_exec__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("program", "PIString &", Const); + fi->arguments << TypeInfo("arg", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("program", "PIString &", Const); + fi->arguments << TypeInfo("arg", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_exec__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("program", "PIString &", Const); + fi->arguments << TypeInfo("arg1", "PIString &", Const); + fi->arguments << TypeInfo("arg2", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("program", "PIString &", Const); + fi->arguments << TypeInfo("arg1", "PIString &", Const); + fi->arguments << TypeInfo("arg2", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_exec__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("program", "PIString &", Const); + fi->arguments << TypeInfo("arg1", "PIString &", Const); + fi->arguments << TypeInfo("arg2", "PIString &", Const); + fi->arguments << TypeInfo("arg3", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("program", "PIString &", Const); + fi->arguments << TypeInfo("arg1", "PIString &", Const); + fi->arguments << TypeInfo("arg2", "PIString &", Const); + fi->arguments << TypeInfo("arg3", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_exec__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("program", "PIString &", Const); + fi->arguments << TypeInfo("args_", "PIStringList &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exec"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("program", "PIString &", Const); + fi->arguments << TypeInfo("args_", "PIStringList &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_terminate__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "terminate"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_waitForFinish__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "waitForFinish"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_waitForFinish__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("timeout_msecs", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "waitForFinish"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("timeout_msecs", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_execStarted__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("program", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "execStarted"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("program", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_execFinished__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("program", "PIString"); + fi->arguments << TypeInfo("exit_code", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "execFinished"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("program", "PIString"); + fi->arguments << TypeInfo("exit_code", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "currentEnvironment"; fi->return_type = TypeInfo("", "PIStringList", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "currentPID"; fi->return_type = TypeInfo("", "int", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "run"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exec_"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PIEthernet"] = ci; + ci->name = "PIEthernet"; + ci->parents << "PIIODevice"; + ci->variables << TypeInfo("sock", "int"); + ci->variables << TypeInfo("sock_s", "int"); + ci->variables << TypeInfo("port_", "int"); + ci->variables << TypeInfo("port_s", "int"); + ci->variables << TypeInfo("port_c", "int"); + ci->variables << TypeInfo("wrote", "int"); + ci->variables << TypeInfo("connected_", "bool"); + ci->variables << TypeInfo("connecting_", "bool"); + ci->variables << TypeInfo("addr_", "sockaddr_in"); + ci->variables << TypeInfo("saddr_", "sockaddr_in"); + ci->variables << TypeInfo("ip_", "PIString"); + ci->variables << TypeInfo("ip_s", "PIString"); + ci->variables << TypeInfo("ip_c", "PIString"); + ci->variables << TypeInfo("server_thread_", "PIThread"); + ci->variables << TypeInfo("clients_", "PIVector"); + ci->variables << TypeInfo("mcast_queue", "PIQueue"); + ci->variables << TypeInfo("mcast_groups", "PIStringList"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "copy"; fi->return_type = TypeInfo("", "PIIODevice *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReadAddress"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ip", "PIString &", Const); + fi->arguments << TypeInfo("port", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReadAddress"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ip_port", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReadIP"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ip", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReadPort"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("port", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSendAddress"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ip", "PIString &", Const); + fi->arguments << TypeInfo("port", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSendAddress"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ip_port", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSendIP"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ip", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSendPort"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("port", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readAddress"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readIP"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readPort"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendAddress"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendIP"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendPort"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setParameters"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("parameters_", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setParameter"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("parameter", "PIEthernet::Parameters"); + fi->arguments << TypeInfo("on", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isParameterSet"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("parameter", "PIEthernet::Parameters"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "parameters"; fi->return_type = TypeInfo("", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "type"; fi->return_type = TypeInfo("", "PIEthernet::Type"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "joinMulticastGroup"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("group", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "leaveMulticastGroup"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("group", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "multicastGroups"; fi->return_type = TypeInfo("", "const PIStringList &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "connect"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "connect"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("ip", "PIString &", Const); + fi->arguments << TypeInfo("port", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "connect"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("ip_port", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isConnected"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "listen"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "listen"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("ip", "PIString &", Const); + fi->arguments << TypeInfo("port", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "listen"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("ip_port", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "client"; fi->return_type = TypeInfo("", "PIEthernet *"); + fi->arguments << TypeInfo("index", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clientsCount"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clients"; fi->return_type = TypeInfo("", "PIVector"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("ip", "PIString &", Const); + fi->arguments << TypeInfo("port", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + fi->arguments << TypeInfo("threaded", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("ip_port", "PIString &", Const); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + fi->arguments << TypeInfo("threaded", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + fi->arguments << TypeInfo("threaded", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + fi->arguments << TypeInfo("threaded", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "read"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("read_to", "void *"); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_newConnection__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("client", "PIEthernet *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "newConnection"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("client", "PIEthernet *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_connected__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "connected"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_disconnected__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("withError", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "disconnected"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("withError", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "interfaces"; fi->return_type = TypeInfo("", "PIEthernet::InterfaceList", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "interfaceAddress"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("interface_", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "allAddresses"; fi->return_type = TypeInfo("", "PIStringList", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "parseAddress"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("ipp", "PIString &", Const); + fi->arguments << TypeInfo("ip", "PIString *"); + fi->arguments << TypeInfo("port", "int *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "macFromBytes"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("mac", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "macToBytes"; fi->return_type = TypeInfo("", "PIByteArray", Static); + fi->arguments << TypeInfo("mac", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "applyMask"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("ip", "PIString &", Const); + fi->arguments << TypeInfo("mask", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getBroadcast"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("ip", "PIString &", Const); + fi->arguments << TypeInfo("mask", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fullPathPrefix"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configureFromFullPath"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("full_path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configureDevice"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("e_main", "void *", Const); + fi->arguments << TypeInfo("e_parent", "void *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "received"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "init"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "openDevice"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "closeDevice"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "closeSocket"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("sd", "int &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getSockAddr"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("s", "sockaddr *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "server_func"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("eth", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setType"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("t", "Type"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "ethErrorString"; fi->return_type = TypeInfo("", "std::string", Static); + + ci = new ClassInfo(); + (*classesInfo)["PIEthernet::Interface"] = ci; + ci->name = "PIEthernet::Interface"; + ci->variables << TypeInfo("index", "int"); + ci->variables << TypeInfo("name", "PIString"); + ci->variables << TypeInfo("mac", "PIString"); + ci->variables << TypeInfo("address", "PIString"); + ci->variables << TypeInfo("netmask", "PIString"); + ci->variables << TypeInfo("broadcast", "PIString"); + ci->variables << TypeInfo("ptp", "PIString"); + ci->variables << TypeInfo("flags", "InterfaceFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isActive"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isRunning"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isBroadcast"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isMulticast"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isLoopback"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isPTP"; fi->return_type = TypeInfo("", "bool"); + + ci = new ClassInfo(); + (*classesInfo)["PIEthernet::InterfaceList"] = ci; + ci->name = "PIEthernet::InterfaceList"; + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getByIndex"; fi->return_type = TypeInfo("", "const Interface *"); + fi->arguments << TypeInfo("index", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getByName"; fi->return_type = TypeInfo("", "const Interface *"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getByAddress"; fi->return_type = TypeInfo("", "const Interface *"); + fi->arguments << TypeInfo("address", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getLoopback"; fi->return_type = TypeInfo("", "const Interface *"); + + ci = new ClassInfo(); + (*classesInfo)["PIPacketExtractor"] = ci; + ci->name = "PIPacketExtractor"; + ci->parents << "PIIODevice"; + ci->variables << TypeInfo("dev", "PIIODevice*"); + ci->variables << TypeInfo("mheader", "PIByteArray"); + ci->variables << TypeInfo("buffer", "PIByteArray"); + ci->variables << TypeInfo("sbuffer", "PIByteArray"); + ci->variables << TypeInfo("ret_func_header", "HeaderCheckFunc"); + ci->variables << TypeInfo("headerPtr", "void*"); + ci->variables << TypeInfo("data", "void*"); + ci->variables << TypeInfo("buffer_size", "int"); + ci->variables << TypeInfo("dataSize", "int"); + ci->variables << TypeInfo("headerSize", "int"); + ci->variables << TypeInfo("packetSize", "int"); + ci->variables << TypeInfo("allReaded", "int"); + ci->variables << TypeInfo("addSize", "int"); + ci->variables << TypeInfo("curInd", "int"); + ci->variables << TypeInfo("missed", "ullong"); + ci->variables << TypeInfo("missed_packets", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "copy"; fi->return_type = TypeInfo("", "PIIODevice *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "device"; fi->return_type = TypeInfo("", "PIIODevice *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDevice"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("device_", "PIIODevice *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "bufferSize"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setBufferSize"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("new_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setHeaderCheckSlot"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("f", "HeaderCheckFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setPacketData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("recHeaderPtr", "void *"); + fi->arguments << TypeInfo("recHeaderSize", "int"); + fi->arguments << TypeInfo("recDataSize", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "missedBytes"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "missedPackets"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "missedBytes_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "missedPackets_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "lastHeader"; fi->return_type = TypeInfo("", "PIByteArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "read"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("read_to", "void *"); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_packetReceived__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("data", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "packetReceived"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "packetHeaderValidate"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("src", "uchar *"); + fi->arguments << TypeInfo("rec", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "packetValidate"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("rec", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "threadedRead"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("readed", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fullPathPrefix"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "openDevice"; fi->return_type = TypeInfo("", "bool"); + + ci = new ClassInfo(); + (*classesInfo)["PIConfig"] = ci; + ci->name = "PIConfig"; + ci->parents << "PIFile"; + ci->variables << TypeInfo("centry", "int"); + ci->variables << TypeInfo("delim", "PIString"); + ci->variables << TypeInfo("root", "PIConfig::Entry"); + ci->variables << TypeInfo("empty", "PIConfig::Entry"); + ci->variables << TypeInfo("lines", "uint"); + ci->variables << TypeInfo("other", "PIStringList"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIString &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIString &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "char *", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIStringList &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "bool", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "short", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "int", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "long", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uchar", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ushort", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uint", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ulong", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "float", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "double", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "char *", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIStringList &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "bool", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "short", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "int", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "long", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uchar", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ushort", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uint", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ulong", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "float", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "double", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValues"; fi->return_type = TypeInfo("", "PIConfig::Branch"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "PIString &", Const); + fi->arguments << TypeInfo("type", "PIString &", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "PIStringList &", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "char *", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "bool", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "short", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "int", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "long", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "uchar", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "ushort", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "uint", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "ulong", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "float", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "double", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "rootEntry"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "entriesCount"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isEntryExists"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "allTree"; fi->return_type = TypeInfo("", "PIConfig::Branch"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "allLeaves"; fi->return_type = TypeInfo("", "PIConfig::Branch"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "entryIndex"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getName"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("number", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("number", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getType"; fi->return_type = TypeInfo("", "PIChar"); + fi->arguments << TypeInfo("number", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getComment"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("number", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addEntry"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "PIString &", Const); + fi->arguments << TypeInfo("type", "PIString &", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setName"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("number", "uint"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("number", "uint"); + fi->arguments << TypeInfo("value", "PIString &", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setType"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("number", "uint"); + fi->arguments << TypeInfo("type", "PIString &", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setComment"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("number", "uint"); + fi->arguments << TypeInfo("comment", "PIString &", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeEntry"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeEntry"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("number", "uint"); + fi->arguments << TypeInfo("write", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clear"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readAll"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeAll"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "delimiter"; fi->return_type = TypeInfo("", "const PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDelimiter"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("d", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "childCount"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("e", "Entry *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "entryExists"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("e", "Entry *", Const); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "buildFullNames"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("e", "Entry *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "allLeaves"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("b", "Branch &"); + fi->arguments << TypeInfo("e", "Entry *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setEntryDelim"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("e", "Entry *"); + fi->arguments << TypeInfo("d", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "entryByIndex"; fi->return_type = TypeInfo("", "PIConfig::Entry &"); + fi->arguments << TypeInfo("index", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeEntry"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("b", "Branch &"); + fi->arguments << TypeInfo("e", "Entry *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "deleteEntry"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("e", "Entry *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getPrefixFromLine"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("line", "PIString"); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "parse"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PIConfig::Branch"] = ci; + ci->name = "PIConfig::Branch"; + ci->variables << TypeInfo("_empty", "Entry", Static); + ci->variables << TypeInfo("delim", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIString &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIString &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "char *", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIStringList &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "bool", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "short", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "int", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "long", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uchar", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ushort", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uint", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ulong", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "float", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "double", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "char *", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIStringList &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "bool", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "short", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "int", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "long", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uchar", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ushort", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uint", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ulong", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "float", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "double", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "allLeaves"; fi->return_type = TypeInfo("", "Branch"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValues"; fi->return_type = TypeInfo("", "Branch"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getLeaves"; fi->return_type = TypeInfo("", "Branch"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getBranches"; fi->return_type = TypeInfo("", "Branch"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "filter"; fi->return_type = TypeInfo("", "Branch &"); + fi->arguments << TypeInfo("f", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isEntryExists"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "indexOf"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("e", "Entry *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "entryExists"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("e", "Entry *", Const); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "allLeaves"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("b", "Branch &"); + fi->arguments << TypeInfo("e", "Entry *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "coutt"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("s", "std::ostream &"); + fi->arguments << TypeInfo("p", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piCoutt"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("s", "PICout"); + fi->arguments << TypeInfo("p", "PIString &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIConfig::Entry"] = ci; + ci->name = "PIConfig::Entry"; + ci->variables << TypeInfo("_empty", "PIConfig::Entry::EntryPtr", Static); + ci->variables << TypeInfo("_parent", "PIConfig::Entry::EntryPtr*"); + ci->variables << TypeInfo("_children", "Branch"); + ci->variables << TypeInfo("_tab", "PIString"); + ci->variables << TypeInfo("_name", "PIString"); + ci->variables << TypeInfo("_value", "PIString"); + ci->variables << TypeInfo("_type", "PIString"); + ci->variables << TypeInfo("_comment", "PIString"); + ci->variables << TypeInfo("_all", "PIString"); + ci->variables << TypeInfo("_full_name", "PIString"); + ci->variables << TypeInfo("delim", "PIString"); + ci->variables << TypeInfo("_line", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "parent"; fi->return_type = TypeInfo("", "Entry *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "childCount"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "children"; fi->return_type = TypeInfo("", "Branch &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "child"; fi->return_type = TypeInfo("", "Entry *"); + fi->arguments << TypeInfo("index", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findChild"; fi->return_type = TypeInfo("", "Entry *"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findChild"; fi->return_type = TypeInfo("", "const Entry *"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isLeaf"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "name"; fi->return_type = TypeInfo("", "const PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "value"; fi->return_type = TypeInfo("", "const PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "type"; fi->return_type = TypeInfo("", "const PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "comment"; fi->return_type = TypeInfo("", "const PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fullName"; fi->return_type = TypeInfo("", "const PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setName"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setType"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setComment"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "PIStringList &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "char *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "bool", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "char", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "short", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "long", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "uchar", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "ushort", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "uint", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "ulong", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "float", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("value", "double", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIString &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIString &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "char *", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIStringList &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "bool", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "short", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "int", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "long", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uchar", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ushort", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uint", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ulong", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "float", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "double", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "char *", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "PIStringList &", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "bool", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "short", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "int", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "long", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uchar", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ushort", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "uint", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "ulong", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "float", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValue"; fi->return_type = TypeInfo("", "Entry &"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + fi->arguments << TypeInfo("def", "double", Const); + fi->arguments << TypeInfo("exists", "bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getValues"; fi->return_type = TypeInfo("", "Branch"); + fi->arguments << TypeInfo("vname", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isEntryExists"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "compare"; fi->return_type = TypeInfo("", "int", Static); + fi->arguments << TypeInfo("f", "EntryPtr *", Const); + fi->arguments << TypeInfo("s", "EntryPtr *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "entryExists"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("e", "Entry *", Const); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "buildLine"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clear"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "coutt"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("s", "std::ostream &"); + fi->arguments << TypeInfo("p", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "piCoutt"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("s", "PICout"); + fi->arguments << TypeInfo("p", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "deleteBranch"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PIMultiProtocolBase"] = ci; + ci->name = "PIMultiProtocolBase"; + ci->parents << "PIObject"; + ci->variables << TypeInfo("mutex_receive", "PIMutex"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "received"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("prot", "PIProtocol *"); + fi->arguments << TypeInfo("corrected", "bool"); + fi->arguments << TypeInfo("data", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveEvent"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("p", "PIMultiProtocolBase *"); + fi->arguments << TypeInfo("prot", "PIProtocol *"); + fi->arguments << TypeInfo("corrected", "bool"); + fi->arguments << TypeInfo("data", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + + ci = new ClassInfo(); + (*classesInfo)["PIProtocol"] = ci; + ci->name = "PIProtocol"; + ci->parents << "PIObject"; + ci->variables << TypeInfo("ser", "PISerial*"); + ci->variables << TypeInfo("eth", "PIEthernet*"); + ci->variables << TypeInfo("dataSize", "uint"); + ci->variables << TypeInfo("headerSize", "uint"); + ci->variables << TypeInfo("sendDataSize", "uint"); + ci->variables << TypeInfo("dataPtr", "uchar*"); + ci->variables << TypeInfo("headerPtr", "uchar*"); + ci->variables << TypeInfo("sendDataPtr", "uchar*"); + ci->variables << TypeInfo("ret_func", "ReceiveFunc"); + ci->variables << TypeInfo("packet_ext", "PIPacketExtractor*"); + ci->variables << TypeInfo("diagTimer", "PITimer*"); + ci->variables << TypeInfo("sendTimer", "PITimer*"); + ci->variables << TypeInfo("secTimer", "PITimer*"); + ci->variables << TypeInfo("mp_owner", "PIMultiProtocolBase*"); + ci->variables << TypeInfo("type_send", "PIProtocol::Type"); + ci->variables << TypeInfo("type_rec", "PIProtocol::Type"); + ci->variables << TypeInfo("net_diag", "PIProtocol::Quality"); + ci->variables << TypeInfo("last_freq", "PIDeque"); + ci->variables << TypeInfo("last_packets", "PIDeque"); + ci->variables << TypeInfo("protName", "PIString"); + ci->variables << TypeInfo("devReceiverName", "PIString"); + ci->variables << TypeInfo("devReceiverState", "PIString"); + ci->variables << TypeInfo("devSenderName", "PIString"); + ci->variables << TypeInfo("devSenderState", "PIString"); + ci->variables << TypeInfo("speedIn", "PIString"); + ci->variables << TypeInfo("speedOut", "PIString"); + ci->variables << TypeInfo("history_path_rec", "PIString"); + ci->variables << TypeInfo("history_path_send", "PIString"); + ci->variables << TypeInfo("history_rsize_rec", "PIString"); + ci->variables << TypeInfo("history_rsize_send", "PIString"); + ci->variables << TypeInfo("history_file_rec", "PIFile"); + ci->variables << TypeInfo("history_file_send", "PIFile"); + ci->variables << TypeInfo("history_id_rec", "ushort"); + ci->variables << TypeInfo("history_id_send", "ushort"); + ci->variables << TypeInfo("work", "bool"); + ci->variables << TypeInfo("new_mp_prot", "bool"); + ci->variables << TypeInfo("history_write_rec", "bool"); + ci->variables << TypeInfo("history_write_send", "bool"); + ci->variables << TypeInfo("exp_freq", "float"); + ci->variables << TypeInfo("send_freq", "float"); + ci->variables << TypeInfo("ifreq", "float"); + ci->variables << TypeInfo("immediate_freq", "float"); + ci->variables << TypeInfo("integral_freq", "float"); + ci->variables << TypeInfo("timeout_", "float"); + ci->variables << TypeInfo("packets", "int[2]"); + ci->variables << TypeInfo("pckt_cnt", "int"); + ci->variables << TypeInfo("pckt_cnt_max", "int"); + ci->variables << TypeInfo("cur_pckt", "char"); + ci->variables << TypeInfo("wrong_count", "ullong"); + ci->variables << TypeInfo("receive_count", "ullong"); + ci->variables << TypeInfo("send_count", "ullong"); + ci->variables << TypeInfo("missed_count", "ullong"); + ci->variables << TypeInfo("packets_in_sec", "ullong"); + ci->variables << TypeInfo("packets_out_sec", "ullong"); + ci->variables << TypeInfo("bytes_in_sec", "ullong"); + ci->variables << TypeInfo("bytes_out_sec", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_startReceive__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startReceive"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_startReceive__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("exp_frequency", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startReceive"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("exp_frequency", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_stopReceive__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stopReceive"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setExpectedFrequency"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("frequency", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReceiverDevice"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("device", "PIString &", Const); + fi->arguments << TypeInfo("speed", "PISerial::Speed"); + fi->arguments << TypeInfo("force", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReceiverData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("dataPtr", "void *"); + fi->arguments << TypeInfo("dataSize", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReceiverDataHeader"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("headerPtr", "void *"); + fi->arguments << TypeInfo("headerSize", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReceiverAddress"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ip", "PIString &", Const); + fi->arguments << TypeInfo("port", "int"); + fi->arguments << TypeInfo("force", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReceiverParameters"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("parameters", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setReceiveSlot"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("slot", "ReceiveFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "expectedFrequency"; fi->return_type = TypeInfo("", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_startSend__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startSend"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_startSend__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("frequency", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startSend"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("frequency", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_stopSend__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stopSend"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSenderFrequency"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("frequency", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSenderDevice"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("device", "PIString &", Const); + fi->arguments << TypeInfo("speed", "PISerial::Speed"); + fi->arguments << TypeInfo("force", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSenderData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("dataPtr", "void *"); + fi->arguments << TypeInfo("dataSize", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSenderAddress"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ip", "PIString &", Const); + fi->arguments << TypeInfo("port", "int"); + fi->arguments << TypeInfo("force", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSenderIP"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ip", "PIString &", Const); + fi->arguments << TypeInfo("force", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSenderPort"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("port", "int"); + fi->arguments << TypeInfo("force", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSenderParameters"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("parameters", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "senderFrequency"; fi->return_type = TypeInfo("", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_stop__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stop"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_send__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_send__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_send__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + fi->arguments << TypeInfo("direct", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + fi->arguments << TypeInfo("direct", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setName"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "name"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDisconnectTimeout"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("timeout", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "disconnectTimeout"; fi->return_type = TypeInfo("", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "disconnectTimeout_ptr"; fi->return_type = TypeInfo("", "const float *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "immediateFrequency"; fi->return_type = TypeInfo("", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "integralFrequency"; fi->return_type = TypeInfo("", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "immediateFrequency_ptr"; fi->return_type = TypeInfo("", "const float *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "integralFrequency_ptr"; fi->return_type = TypeInfo("", "const float *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveCountPerSec"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveCountPerSec_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendCountPerSec"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendCountPerSec_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveBytesPerSec"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveBytesPerSec_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendBytesPerSec"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendBytesPerSec_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveCount"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveCount_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "wrongCount"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "wrongCount_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendCount"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendCount_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "missedCount"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "missedCount_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "quality"; fi->return_type = TypeInfo("", "PIProtocol::Quality"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "quality_ptr"; fi->return_type = TypeInfo("", "const int *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiverDeviceName"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "senderDeviceName"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiverDeviceState"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiverDeviceState_ptr"; fi->return_type = TypeInfo("", "const PIString *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "senderDeviceState"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "senderDeviceState_ptr"; fi->return_type = TypeInfo("", "const PIString *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveSpeed"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveSpeed_ptr"; fi->return_type = TypeInfo("", "const PIString *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendSpeed"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendSpeed_ptr"; fi->return_type = TypeInfo("", "const PIString *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiverHistorySize"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiverHistorySize_ptr"; fi->return_type = TypeInfo("", "const PIString *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "senderHistorySize"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "senderHistorySize_ptr"; fi->return_type = TypeInfo("", "const PIString *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeReceiverHistory"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeReceiverHistory_ptr"; fi->return_type = TypeInfo("", "const bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeSenderHistory"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeSenderHistory_ptr"; fi->return_type = TypeInfo("", "const bool *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveData"; fi->return_type = TypeInfo("", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendData"; fi->return_type = TypeInfo("", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "packetExtractor"; fi->return_type = TypeInfo("", "PIPacketExtractor *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "lastHeader"; fi->return_type = TypeInfo("", "PIByteArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_receiverStarted__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiverStarted"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_receiverStopped__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiverStopped"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_senderStarted__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "senderStarted"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_senderStopped__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "senderStopped"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_received__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("validate_is_ok", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "received"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("validate_is_ok", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_qualityChanged__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("new_quality", "PIProtocol::Quality"); + fi->arguments << TypeInfo("old_quality", "PIProtocol::Quality"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "qualityChanged"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("new_quality", "PIProtocol::Quality"); + fi->arguments << TypeInfo("old_quality", "PIProtocol::Quality"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receive"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("data", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "validate"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "headerValidate"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("src", "uchar *"); + fi->arguments << TypeInfo("rec", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checksum_i"; fi->return_type = TypeInfo("", "uint"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checksum_c"; fi->return_type = TypeInfo("", "uchar"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "aboutSend"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "init"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "init_sender"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("b", "PIConfig::Entry &"); + fi->arguments << TypeInfo("sb", "PIConfig::Entry &"); + fi->arguments << TypeInfo("config", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "init_receiver"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("b", "PIConfig::Entry &"); + fi->arguments << TypeInfo("rb", "PIConfig::Entry &"); + fi->arguments << TypeInfo("config", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "check_state"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "calc_freq"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "calc_diag"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendEvent"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("e", "void *"); + fi->arguments << TypeInfo("nt", "i"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveEvent"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("t", "void *"); + fi->arguments << TypeInfo("data", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "headerValidateEvent"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("t", "void *"); + fi->arguments << TypeInfo("src", "uchar *"); + fi->arguments << TypeInfo("rec", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "diagEvent"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("t", "void *"); + fi->arguments << TypeInfo("nt", "i"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "secEvent"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("t", "void *"); + fi->arguments << TypeInfo("nt", "i"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setMultiProtocolOwner"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("mp", "PIMultiProtocolBase *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "multiProtocolOwner"; fi->return_type = TypeInfo("", "PIMultiProtocolBase *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "changeDisconnectTimeout"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PIDiagnostics"] = ci; + ci->name = "PIDiagnostics"; + ci->parents << "PITimer"; + ci->variables << TypeInfo("qual", "PIDiagnostics::Quality"); + ci->variables << TypeInfo("speedIn", "PIString"); + ci->variables << TypeInfo("speedOut", "PIString"); + ci->variables << TypeInfo("ifreq", "float"); + ci->variables << TypeInfo("immediate_freq", "float"); + ci->variables << TypeInfo("integral_freq", "float"); + ci->variables << TypeInfo("packets", "int[2]"); + ci->variables << TypeInfo("cur_pckt", "char"); + ci->variables << TypeInfo("rec_once", "char"); + ci->variables << TypeInfo("wrong_count", "ullong"); + ci->variables << TypeInfo("receive_count", "ullong"); + ci->variables << TypeInfo("send_count", "ullong"); + ci->variables << TypeInfo("packets_in_sec", "ullong"); + ci->variables << TypeInfo("packets_out_sec", "ullong"); + ci->variables << TypeInfo("bytes_in_sec", "ullong"); + ci->variables << TypeInfo("bytes_out_sec", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "immediateFrequency"; fi->return_type = TypeInfo("", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "integralFrequency"; fi->return_type = TypeInfo("", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveCountPerSec"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendCountPerSec"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveBytesPerSec"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendBytesPerSec"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveCount"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "wrongCount"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendCount"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "quality"; fi->return_type = TypeInfo("", "PIDiagnostics::Quality"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveSpeed"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendSpeed"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "immediateFrequency_ptr"; fi->return_type = TypeInfo("", "const float *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "integralFrequency_ptr"; fi->return_type = TypeInfo("", "const float *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveCountPerSec_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendCountPerSec_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveBytesPerSec_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendBytesPerSec_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveCount_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "wrongCount_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendCount_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "quality_ptr"; fi->return_type = TypeInfo("", "const int *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveSpeed_ptr"; fi->return_type = TypeInfo("", "const PIString *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendSpeed_ptr"; fi->return_type = TypeInfo("", "const PIString *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("msecs", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("msecs", "double"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_reset__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "reset"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_received__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "received"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_received__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("size", "int"); + fi->arguments << TypeInfo("correct", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "received"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("size", "int"); + fi->arguments << TypeInfo("correct", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_sended__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sended"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_qualityChanged__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("new_quality", "PIDiagnostics::Quality"); + fi->arguments << TypeInfo("old_quality", "PIDiagnostics::Quality"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "qualityChanged"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("new_quality", "PIDiagnostics::Quality"); + fi->arguments << TypeInfo("old_quality", "PIDiagnostics::Quality"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "tick"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("delimiter", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "changeDisconnectTimeout"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PISystemMonitor"] = ci; + ci->name = "PISystemMonitor"; + ci->parents << "PIThread"; + ci->variables << TypeInfo("file", "PIFile"); + ci->variables << TypeInfo("filem", "PIFile"); + ci->variables << TypeInfo("stat", "PISystemMonitor::ProcessStats"); + ci->variables << TypeInfo("pID_", "int"); + ci->variables << TypeInfo("page_size", "int"); + ci->variables << TypeInfo("cpu_count", "int"); + ci->variables << TypeInfo("cycle", "int"); + ci->variables << TypeInfo("cpu_u_cur", "llong"); + ci->variables << TypeInfo("cpu_u_prev", "llong"); + ci->variables << TypeInfo("cpu_s_cur", "llong"); + ci->variables << TypeInfo("cpu_s_prev", "llong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startOnProcess"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("pID", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startOnSelf"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "statistic"; fi->return_type = TypeInfo("", "const PISystemMonitor::ProcessStats &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "run"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PISystemMonitor::ProcessStats"] = ci; + ci->name = "PISystemMonitor::ProcessStats"; + ci->variables << TypeInfo("exec_name", "PIString"); + ci->variables << TypeInfo("state", "PIString"); + ci->variables << TypeInfo("ID", "int"); + ci->variables << TypeInfo("parent_ID", "int"); + ci->variables << TypeInfo("group_ID", "int"); + ci->variables << TypeInfo("session_ID", "int"); + ci->variables << TypeInfo("priority", "int"); + ci->variables << TypeInfo("threads", "int"); + ci->variables << TypeInfo("physical_memsize", "ulong"); + ci->variables << TypeInfo("resident_memsize", "ulong"); + ci->variables << TypeInfo("share_memsize", "ulong"); + ci->variables << TypeInfo("virtual_memsize", "ulong"); + ci->variables << TypeInfo("data_memsize", "ulong"); + ci->variables << TypeInfo("physical_memsize_readable", "PIString"); + ci->variables << TypeInfo("resident_memsize_readable", "PIString"); + ci->variables << TypeInfo("share_memsize_readable", "PIString"); + ci->variables << TypeInfo("virtual_memsize_readable", "PIString"); + ci->variables << TypeInfo("data_memsize_readable", "PIString"); + ci->variables << TypeInfo("cpu_load_system", "float"); + ci->variables << TypeInfo("cpu_load_user", "float"); + + ci = new ClassInfo(); + (*classesInfo)["PIConsole"] = ci; + ci->name = "PIConsole"; + ci->parents << "PIThread"; + ci->variables << TypeInfo("tabs", "PIVector"); + ci->variables << TypeInfo("binstr", "PIString"); + ci->variables << TypeInfo("rstr", "PIString"); + ci->variables << TypeInfo("rba", "PIByteArray"); + ci->variables << TypeInfo("tv", "PIConsole::Variable"); + ci->variables << TypeInfo("listener", "PIKbdListener*"); + ci->variables << TypeInfo("def_align", "PIConsole::Alignment"); + ci->variables << TypeInfo("ret_func", "KBFunc"); + ci->variables << TypeInfo("width", "int"); + ci->variables << TypeInfo("height", "int"); + ci->variables << TypeInfo("pwidth", "int"); + ci->variables << TypeInfo("pheight", "int"); + ci->variables << TypeInfo("ret", "int"); + ci->variables << TypeInfo("col_wid", "int"); + ci->variables << TypeInfo("num_format", "int"); + ci->variables << TypeInfo("systime_format", "int"); + ci->variables << TypeInfo("max_y", "uint"); + ci->variables << TypeInfo("vid", "int"); + ci->variables << TypeInfo("cur_tab", "uint"); + ci->variables << TypeInfo("col_cnt", "uint"); + ci->variables << TypeInfo("peer", "PIPeer*"); + ci->variables << TypeInfo("peer_timer", "PITimer"); + ci->variables << TypeInfo("server_name", "PIString"); + ci->variables << TypeInfo("server_mode", "bool"); + ci->variables << TypeInfo("state", "PIConsole::ConnectedState"); + ci->variables << TypeInfo("remote_clients", "PIVector"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addString"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "PIString *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "char *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "bool *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "short *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "int *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "long *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "llong *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "uchar *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "ushort *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "uint *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "ulong *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "ullong *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "float *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "double *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "PISystemTime *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "PIProtocol *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "PIDiagnostics *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "PISystemMonitor *", Const); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addBitVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("ptr", "void *", Const); + fi->arguments << TypeInfo("fromBit", "int"); + fi->arguments << TypeInfo("bitsCount", "int"); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addEmptyLine"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("column", "int"); + fi->arguments << TypeInfo("count", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getString"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("x", "int"); + fi->arguments << TypeInfo("y", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getShort"; fi->return_type = TypeInfo("", "short"); + fi->arguments << TypeInfo("x", "int"); + fi->arguments << TypeInfo("y", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getInt"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("x", "int"); + fi->arguments << TypeInfo("y", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getFloat"; fi->return_type = TypeInfo("", "float"); + fi->arguments << TypeInfo("x", "int"); + fi->arguments << TypeInfo("y", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getDouble"; fi->return_type = TypeInfo("", "double"); + fi->arguments << TypeInfo("x", "int"); + fi->arguments << TypeInfo("y", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getString"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getShort"; fi->return_type = TypeInfo("", "short"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getInt"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getFloat"; fi->return_type = TypeInfo("", "float"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getDouble"; fi->return_type = TypeInfo("", "double"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "tabsCount"; fi->return_type = TypeInfo("", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "currentTab"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addTab"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("bind_key", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeTab"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("index", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeTab"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setTab"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("index", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setTab"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setTabBindKey"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("index", "uint"); + fi->arguments << TypeInfo("bind_key", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setTabBindKey"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("bind_key", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearTabs"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("clearScreen", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addCustomStatus"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("str", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearCustomStatus"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "defaultAlignment"; fi->return_type = TypeInfo("", "PIConsole::Alignment"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDefaultAlignment"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("align", "Alignment"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setColumnAlignment"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("col", "int"); + fi->arguments << TypeInfo("align", "Alignment"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setColumnAlignmentToAll"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("align", "Alignment"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fstr"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("f", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "enableExitCapture"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("key", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "disableExitCapture"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exitCaptured"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exitKey"; fi->return_type = TypeInfo("", "char"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startServer"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stopPeer"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isServerStarted"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clients"; fi->return_type = TypeInfo("", "PIStringList"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "listenServers"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "availableServers"; fi->return_type = TypeInfo("", "PIStringList"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "selectedServer"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "connectToServer"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "disconnect"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isConnected"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toUpperLeft"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "moveRight"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("n", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "moveLeft"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("n", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "moveTo"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("x", "int"); + fi->arguments << TypeInfo("y", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearScreen"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearScreenLower"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearLine"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "newLine"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "hideCursor"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "showCursor"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_clearVariables__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearVariables"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_clearVariables__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("clearScreen", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearVariables"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("clearScreen", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_waitForFinish__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "waitForFinish"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_start__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("wait", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("wait", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_stop__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stop"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_stop__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("clear", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stop"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("clear", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_keyPressed__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("key", "char"); + fi->arguments << TypeInfo("data", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "keyPressed"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("key", "char"); + fi->arguments << TypeInfo("data", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "begin"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "run"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fillLabels"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "status"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checkColumn"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("col", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "bitsValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("src", "void *", Const); + fi->arguments << TypeInfo("offset", "int"); + fi->arguments << TypeInfo("count", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "toBin"; fi->return_type = TypeInfo("", "const char *"); + fi->arguments << TypeInfo("d", "void *", Const); + fi->arguments << TypeInfo("s", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printLine"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("str", "PIString &", Const); + fi->arguments << TypeInfo("dx", "int"); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("str", "PIString &", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("str", "char *", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "bool", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "int", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "long", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "llong", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "float", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "double", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "char", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "short", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "uchar", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "ushort", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "uint", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "ulong", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "ullong", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "printValue"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("value", "PISystemTime &", Const); + fi->arguments << TypeInfo("format", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "key_event"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("key", "char"); + fi->arguments << TypeInfo("t", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "columns"; fi->return_type = TypeInfo("", "PIVector &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "column"; fi->return_type = TypeInfo("", "PIConsole::Column &"); + fi->arguments << TypeInfo("index", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "char *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "bool", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "char", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "short", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "long", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "llong", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "uchar", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "ushort", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "uint", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "ulong", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "ullong", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "float", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "double", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "couts"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("v", "PISystemTime &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "serverSendInfo"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "serverSendData"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "remoteClient"; fi->return_type = TypeInfo("", "RemoteClient &"); + fi->arguments << TypeInfo("fname", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_peerReceived__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("from", "PIString &", Const); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "peerReceived"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("from", "PIString &", Const); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_peerTimer__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("delim", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "peerTimer"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("delim", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_peerDisconnectedEvent__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "peerDisconnectedEvent"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIConsole::Variable"] = ci; + ci->name = "PIConsole::Variable"; + ci->variables << TypeInfo("name", "PIString"); + ci->variables << TypeInfo("format", "PIFlags"); + ci->variables << TypeInfo("nx", "int"); + ci->variables << TypeInfo("ny", "int"); + ci->variables << TypeInfo("type", "int"); + ci->variables << TypeInfo("offset", "int"); + ci->variables << TypeInfo("bitFrom", "int"); + ci->variables << TypeInfo("bitCount", "int"); + ci->variables << TypeInfo("size", "int"); + ci->variables << TypeInfo("id", "int"); + ci->variables << TypeInfo("remote", "bool"); + ci->variables << TypeInfo("ptr", "void*", Const); + ci->variables << TypeInfo("rdata", "PIByteArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isEmpty"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "data"; fi->return_type = TypeInfo("", "const void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ba", "PIByteArray &"); + + ci = new ClassInfo(); + (*classesInfo)["PIConsole::VariableContent"] = ci; + ci->name = "PIConsole::VariableContent"; + ci->variables << TypeInfo("id", "int"); + ci->variables << TypeInfo("rdata", "PIByteArray"); + + ci = new ClassInfo(); + (*classesInfo)["PIConsole::Column"] = ci; + ci->name = "PIConsole::Column"; + ci->variables << TypeInfo("variables", "PIVector"); + ci->variables << TypeInfo("alignment", "Alignment"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "size"; fi->return_type = TypeInfo("", "uint"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "push_back"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("v", "Variable &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIConsole::Tab"] = ci; + ci->name = "PIConsole::Tab"; + ci->variables << TypeInfo("columns", "PIVector"); + ci->variables << TypeInfo("name", "PIString"); + ci->variables << TypeInfo("status", "PIString"); + ci->variables << TypeInfo("key", "char"); + + ci = new ClassInfo(); + (*classesInfo)["PIConsole::RemoteClient"] = ci; + ci->name = "PIConsole::RemoteClient"; + ci->variables << TypeInfo("name", "PIString"); + ci->variables << TypeInfo("state", "ConnectedState"); + + ci = new ClassInfo(); + (*classesInfo)["PICLI"] = ci; + ci->name = "PICLI"; + ci->parents << "PIObject"; + ci->variables << TypeInfo("_prefix_short", "PIString"); + ci->variables << TypeInfo("_prefix_full", "PIString"); + ci->variables << TypeInfo("_args_raw", "PIStringList"); + ci->variables << TypeInfo("_args_mand", "PIStringList"); + ci->variables << TypeInfo("_args_opt", "PIStringList"); + ci->variables << TypeInfo("keys_full", "PISet"); + ci->variables << TypeInfo("keys_short", "PISet"); + ci->variables << TypeInfo("_args", "PIVector"); + ci->variables << TypeInfo("_count_mand", "int"); + ci->variables << TypeInfo("_count_opt", "int"); + ci->variables << TypeInfo("needParse", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addArgument"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addArgument"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("shortKey", "PIChar &", Const); + fi->arguments << TypeInfo("value", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addArgument"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("shortKey", "char *", Const); + fi->arguments << TypeInfo("value", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addArgument"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("shortKey", "PIChar &", Const); + fi->arguments << TypeInfo("fullKey", "PIString &", Const); + fi->arguments << TypeInfo("value", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addArgument"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("shortKey", "char *", Const); + fi->arguments << TypeInfo("fullKey", "PIString &", Const); + fi->arguments << TypeInfo("value", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "rawArgument"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("index", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "mandatoryArgument"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("index", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "optionalArgument"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("index", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "rawArguments"; fi->return_type = TypeInfo("", "const PIStringList &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "mandatoryArguments"; fi->return_type = TypeInfo("", "const PIStringList &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "optionalArguments"; fi->return_type = TypeInfo("", "const PIStringList &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "programCommand"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "hasArgument"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "argumentValue"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "argumentShortKey"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "argumentFullKey"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "shortKeyPrefix"; fi->return_type = TypeInfo("", "const PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fullKeyPrefix"; fi->return_type = TypeInfo("", "const PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "mandatoryArgumentsCount"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "optionalArgumentsCount"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setShortKeyPrefix"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("prefix", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setFullKeyPrefix"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("prefix", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setMandatoryArgumentsCount"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("count", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setOptionalArgumentsCount"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("count", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "parse"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PICLI::Argument"] = ci; + ci->name = "PICLI::Argument"; + ci->variables << TypeInfo("name", "PIString"); + ci->variables << TypeInfo("short_key", "PIChar"); + ci->variables << TypeInfo("full_key", "PIString"); + ci->variables << TypeInfo("value", "PIString"); + ci->variables << TypeInfo("has_value", "bool"); + ci->variables << TypeInfo("found", "bool"); + + ci = new ClassInfo(); + (*classesInfo)["Instruction"] = ci; + ci->name = "Instruction"; + ci->variables << TypeInfo("operation", "Operation"); + ci->variables << TypeInfo("out", "int"); + ci->variables << TypeInfo("function", "int"); + + ci = new ClassInfo(); + (*classesInfo)["Function"] = ci; + ci->name = "Function"; + ci->variables << TypeInfo("identifier", "PIString"); + ci->variables << TypeInfo("type", "BaseFunctions"); + ci->variables << TypeInfo("handler", "FuncFunc"); + ci->variables << TypeInfo("arguments", "int"); + + ci = new ClassInfo(); + (*classesInfo)["PIEvaluatorContent"] = ci; + ci->name = "PIEvaluatorContent"; + ci->variables << TypeInfo("functions", "PIVector"); + ci->variables << TypeInfo("variables", "PIVector"); + ci->variables << TypeInfo("cv_count", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addFunction"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("args", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("val", "complexd &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addCustomFunction"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("args_count", "int"); + fi->arguments << TypeInfo("func", "FuncFunc"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "functionsCount"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "variablesCount"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "customVariablesCount"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findFunction"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findVariable"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("var_name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "function"; fi->return_type = TypeInfo("", "PIEvaluatorTypes::Function"); + fi->arguments << TypeInfo("index", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "variable"; fi->return_type = TypeInfo("", "PIEvaluatorTypes::Variable"); + fi->arguments << TypeInfo("index", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "function"; fi->return_type = TypeInfo("", "PIEvaluatorTypes::Function"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "variable"; fi->return_type = TypeInfo("", "PIEvaluatorTypes::Variable"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "customVariable"; fi->return_type = TypeInfo("", "PIEvaluatorTypes::Variable"); + fi->arguments << TypeInfo("index", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setVariableValue"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("index", "int"); + fi->arguments << TypeInfo("new_value", "complexd"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setVariableName"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("index", "int"); + fi->arguments << TypeInfo("new_name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setVariableValue"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("var_name", "PIString &", Const); + fi->arguments << TypeInfo("new_value", "complexd &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setVariableName"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("var_name", "PIString &", Const); + fi->arguments << TypeInfo("new_name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("index", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("var_name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearCustomVariables"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sortVariables"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getBaseFunction"; fi->return_type = TypeInfo("", "PIEvaluatorTypes::BaseFunctions"); + fi->arguments << TypeInfo("name", "PIString &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIEvaluator"] = ci; + ci->name = "PIEvaluator"; + ci->variables << TypeInfo("content", "PIEvaluatorContent"); + ci->variables << TypeInfo("elements", "PIVector"); + ci->variables << TypeInfo("currentVariables", "PIVector"); + ci->variables << TypeInfo("variables", "PIVector"); + ci->variables << TypeInfo("tmpvars", "PIVector"); + ci->variables << TypeInfo("kvars", "PIVector*"); + ci->variables << TypeInfo("instructions", "PIVector"); + ci->variables << TypeInfo("unknownVars", "PIStringList"); + ci->variables << TypeInfo("currentString", "PIString"); + ci->variables << TypeInfo("lastError", "PIString"); + ci->variables << TypeInfo("out", "complexd"); + ci->variables << TypeInfo("correct", "bool"); + ci->variables << TypeInfo("data_", "void*"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "data"; fi->return_type = TypeInfo("", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("_data", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "check"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("string", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isCorrect"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setVariable"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("value", "complexd"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("index", "int"); + fi->arguments << TypeInfo("value", "complexd"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setCustomVariableValue"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("index", "int"); + fi->arguments << TypeInfo("value", "complexd"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "evaluate"; fi->return_type = TypeInfo("", "complexd"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeVariable"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clearCustomVariables"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "variableIndex"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "unknownVariables"; fi->return_type = TypeInfo("", "const PIStringList &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "expression"; fi->return_type = TypeInfo("", "const PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "error"; fi->return_type = TypeInfo("", "const PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "lastResult"; fi->return_type = TypeInfo("", "const complexd &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "prepare"; fi->return_type = TypeInfo("", "const PIString &"); + fi->arguments << TypeInfo("string", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "preprocess"; fi->return_type = TypeInfo("", "const PIString &"); + fi->arguments << TypeInfo("string", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "parse"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("string", "PIString &", Const); + fi->arguments << TypeInfo("offset", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "convert"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checkBrackets"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeSpaces"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findUnknownVariables"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeJunk"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "replaceOperators"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "makeOutput"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("string", "PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fillElements"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSignes"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isSign"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("ch", "PIChar &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "inverse"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("string", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "check"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "execInstructions"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "inBrackets"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("string", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "operationChar"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("operation", "PIEvaluatorTypes::Operation &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "operationInOrder"; fi->return_type = TypeInfo("", "PIEvaluatorTypes::Operation"); + fi->arguments << TypeInfo("index", "int &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "value"; fi->return_type = TypeInfo("", "complexd"); + fi->arguments << TypeInfo("index", "int &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "residue"; fi->return_type = TypeInfo("", "complexd"); + fi->arguments << TypeInfo("f", "complexd &", Const); + fi->arguments << TypeInfo("s", "complexd &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "execFunction"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ci", "PIEvaluatorTypes::Instruction &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIMultiProtocol"] = ci; + ci->name = "PIMultiProtocol"; + ci->parents << "PIMultiProtocolBase"; + ci->variables << TypeInfo("prots", "PIVector"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addProtocol"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("prot", "PIProtocol &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addProtocol"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("prot", "PIProtocol *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addProtocol"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("config", "PIString &", Const); + fi->arguments << TypeInfo("name", "PIString &", Const); + fi->arguments << TypeInfo("recHeaderPtr", "void *"); + fi->arguments << TypeInfo("recHeaderSize", "int"); + fi->arguments << TypeInfo("recDataPtr", "void *"); + fi->arguments << TypeInfo("recDataSize", "int"); + fi->arguments << TypeInfo("sendDataPtr", "void *"); + fi->arguments << TypeInfo("sendDataSize", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "protocol"; fi->return_type = TypeInfo("", "PIProtocol *"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "protocol"; fi->return_type = TypeInfo("", "PIProtocol *"); + fi->arguments << TypeInfo("index", "int", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startSend"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "startReceive"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "start"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stopSend"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stopReceive"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "stop"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "worseQuality"; fi->return_type = TypeInfo("", "PIProtocol::Quality"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "bestQuality"; fi->return_type = TypeInfo("", "PIProtocol::Quality"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "count"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clear"; fi->return_type = TypeInfo("", "void"); + + ci = new ClassInfo(); + (*classesInfo)["PIRepeater"] = ci; + ci->name = "PIRepeater"; + ci->parents << "PIMultiProtocol"; + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "firstChannelName"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "secondChannelName"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveCount"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "receiveCount_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendCount"; fi->return_type = TypeInfo("", "ullong"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendCount_ptr"; fi->return_type = TypeInfo("", "const ullong *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "received"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("prot", "PIProtocol *"); + fi->arguments << TypeInfo("ool", "b"); + fi->arguments << TypeInfo("data", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + + ci = new ClassInfo(); + (*classesInfo)["PICodec"] = ci; + ci->name = "PICodec"; + ci->parents << "PIProcess"; + ci->variables << TypeInfo("c_from", "PIString"); + ci->variables << TypeInfo("c_to", "PIString"); + ci->variables << TypeInfo("tf", "PIFile"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setFromCoding"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("from", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setToCoding"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("to", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setCodings"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("from", "PIString &", Const); + fi->arguments << TypeInfo("to", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "availableCodecs"; fi->return_type = TypeInfo("", "PIStringList"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "encode"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("str", "PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "encode"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("str", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "decode"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("str", "PIString &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "decode"; fi->return_type = TypeInfo("", "PIString"); + fi->arguments << TypeInfo("str", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "exec_iconv"; fi->return_type = TypeInfo("", "PIByteArray"); + fi->arguments << TypeInfo("from", "PIString &", Const); + fi->arguments << TypeInfo("to", "PIString &", Const); + fi->arguments << TypeInfo("str", "PIByteArray &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PISignals"] = ci; + ci->name = "PISignals"; + ci->variables << TypeInfo("ret_func", "PISignals::SignalEvent", Static); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setSlot"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("slot", "SignalEvent"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "grabSignals"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("signals_", "PIFlags"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "raiseSignal"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("signal", "PISignals::Signal"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "signalCode"; fi->return_type = TypeInfo("", "int", Static); + fi->arguments << TypeInfo("signal", "PISignals::Signal"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "signalFromCode"; fi->return_type = TypeInfo("", "PISignals::Signal", Static); + fi->arguments << TypeInfo("signal", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "signal_event"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("signal", "int"); + + ci = new ClassInfo(); + (*classesInfo)["PIPeer"] = ci; + ci->name = "PIPeer"; + ci->parents << "PIObject"; + ci->variables << TypeInfo("eths", "PIVector"); + ci->variables << TypeInfo("mc_eths", "PIVector"); + ci->variables << TypeInfo("eth_send", "PIEthernet*"); + ci->variables << TypeInfo("timer", "PITimer"); + ci->variables << TypeInfo("mc_mutex", "PIMutex"); + ci->variables << TypeInfo("eth_mutex", "PIMutex"); + ci->variables << TypeInfo("rec_mc", "bool"); + ci->variables << TypeInfo("rec_bc", "bool"); + ci->variables << TypeInfo("self_info", "PIPeer::PeerInfo"); + ci->variables << TypeInfo("peers", "PIVector"); + ci->variables << TypeInfo("addresses_map", "PIMap >"); + ci->variables << TypeInfo("diag_s", "PIDiagnostics"); + ci->variables << TypeInfo("diag_d", "PIDiagnostics"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("to", "PIString &", Const); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("to", "PIString &", Const); + fi->arguments << TypeInfo("data", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("to", "PIString &", Const); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("to", "PeerInfo &", Const); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("to", "PeerInfo &", Const); + fi->arguments << TypeInfo("data", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("to", "PeerInfo &", Const); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("to", "PeerInfo *", Const); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("to", "PeerInfo *", Const); + fi->arguments << TypeInfo("data", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "send"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("to", "PeerInfo *", Const); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendToAll"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendToAll"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendToAll"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isMulticastReceive"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isBroadcastReceive"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "diagnosticService"; fi->return_type = TypeInfo("", "PIDiagnostics &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "diagnosticData"; fi->return_type = TypeInfo("", "PIDiagnostics &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "allPeers"; fi->return_type = TypeInfo("", "const PIVector &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isPeerExists"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getPeerByName"; fi->return_type = TypeInfo("", "const PIPeer::PeerInfo *"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "lock"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "unlock"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_dataReceivedEvent__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("from", "PIString &", Const); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "dataReceivedEvent"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("from", "PIString &", Const); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_peerConnectedEvent__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "peerConnectedEvent"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_peerDisconnectedEvent__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "peerDisconnectedEvent"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "dataReceived"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("from", "PIString &", Const); + fi->arguments << TypeInfo("data", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "peerConnected"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "peerDisconnected"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_dataRead__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("readed", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "dataRead"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("readed", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_multicastRead__"; fi->return_type = TypeInfo("", "bool", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("readed", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "multicastRead"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("readed", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_timerEvent__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("delim", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "timerEvent"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("data", "void *"); + fi->arguments << TypeInfo("delim", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "hasPeer"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removePeer"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("name", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendPeerInfo"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("info", "PeerInfo &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendPeerRemove"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("peer", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendSelfInfo"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendSelfRemove"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "syncPeers"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "findNearestAddresses"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "initEths"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("al", "PIStringList &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "initMulticasts"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("al", "PIStringList &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "destroyMulticasts"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendMulticast"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ba", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "quickestPeer"; fi->return_type = TypeInfo("", "PIPeer::PeerInfo *"); + fi->arguments << TypeInfo("to", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "sendToNeighbour"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("peer", "PeerInfo *"); + fi->arguments << TypeInfo("ba", "PIByteArray &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIPeer::PeerData"] = ci; + ci->name = "PIPeer::PeerData"; + ci->variables << TypeInfo("data", "PIByteArray"); + ci->variables << TypeInfo("msg_count", "int"); + ci->variables << TypeInfo("msg_rec", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "clear"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isEmpty"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isFullReceived"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ba", "PIByteArray &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setData"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ba", "PIByteArray &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIPeer::PeerInfo"] = ci; + ci->name = "PIPeer::PeerInfo"; + ci->variables << TypeInfo("name", "PIString"); + ci->variables << TypeInfo("addresses", "PIStringList"); + ci->variables << TypeInfo("dist", "int"); + ci->variables << TypeInfo("ping", "int"); + ci->variables << TypeInfo("nearest_address", "PIString"); + ci->variables << TypeInfo("netmasks", "PIStringList"); + ci->variables << TypeInfo("neighbours", "PIStringList"); + ci->variables << TypeInfo("sync", "int"); + ci->variables << TypeInfo("_naddress", "PIString"); + ci->variables << TypeInfo("_neth", "PIEthernet*"); + ci->variables << TypeInfo("_nuses", "PIVector"); + ci->variables << TypeInfo("_first", "PeerInfo*"); + ci->variables << TypeInfo("_data", "PeerData"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isNeighbour"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addNeighbour"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("n", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "addNeighbours"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("l", "PIStringList &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "removeNeighbour"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("n", "PIString &", Const); + + ci = new ClassInfo(); + (*classesInfo)["PIPeer::PeerPacket"] = ci; + ci->name = "PIPeer::PeerPacket"; + ci->variables << TypeInfo("header", "int"); + + ci = new ClassInfo(); + (*classesInfo)["PIBinaryLog"] = ci; + ci->name = "PIBinaryLog"; + ci->parents << "PIIODevice"; + ci->variables << TypeInfo("filterID", "PIVector"); + ci->variables << TypeInfo("file", "PIFile"); + ci->variables << TypeInfo("lastrecord", "PIBinaryLog::BinLogRecord"); + ci->variables << TypeInfo("startlogtime", "PISystemTime"); + ci->variables << TypeInfo("play_time", "double"); + ci->variables << TypeInfo("is_started", "bool"); + ci->variables << TypeInfo("is_thread_ok", "bool"); + ci->variables << TypeInfo("binlog_sig", "uchar[6]"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "copy"; fi->return_type = TypeInfo("", "PIIODevice *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "playMode"; fi->return_type = TypeInfo("", "PIBinaryLog::PlayMode"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "logDir"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "filePrefix"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "defaultID"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "playSpeed"; fi->return_type = TypeInfo("", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "rapidStart"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setPlayMode"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("mode", "PlayMode"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setLogDir"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setFilePrefix"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("prefix", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDefaultID"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("id", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setRapidStart"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("enabled", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setPlaySpeed"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("speed", "float"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinLog"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("id", "int"); + fi->arguments << TypeInfo("data", "PIByteArray"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeBinLog"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("id", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readBinLog"; fi->return_type = TypeInfo("", "PIByteArray"); + fi->arguments << TypeInfo("id", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readBinLog"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("id", "int"); + fi->arguments << TypeInfo("read_to", "void *"); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isEnd"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isEmpty"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "lastReadedID"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "read"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("read_to", "void *"); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "restart"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_createNewFile__"; fi->return_type = TypeInfo("", "PIString", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "createNewFile"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_fileEnd__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fileEnd"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "__stat_eh_fileError__"; fi->return_type = TypeInfo("", "void", Static); + fi->arguments << TypeInfo("o", "void *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fileError"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fullPathPrefix"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configureFromFullPath"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("full_path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "openDevice"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "closeDevice"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "threadedRead"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("readed", "uchar *"); + fi->arguments << TypeInfo("size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "writeFileHeader"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "checkFileHeader"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "readRecord"; fi->return_type = TypeInfo("", "PIBinaryLog::BinLogRecord"); + + ci = new ClassInfo(); + (*classesInfo)["PIBinaryLog::BinLogRecord"] = ci; + ci->name = "PIBinaryLog::BinLogRecord"; + ci->variables << TypeInfo("id", "int"); + ci->variables << TypeInfo("size", "int"); + ci->variables << TypeInfo("timestamp", "PISystemTime"); + ci->variables << TypeInfo("data", "PIByteArray"); + + ci = new ClassInfo(); + (*classesInfo)["PIUSB"] = ci; + ci->name = "PIUSB"; + ci->parents << "PIIODevice"; + ci->variables << TypeInfo("eps", "PIVector"); + ci->variables << TypeInfo("vid_", "ushort"); + ci->variables << TypeInfo("pid_", "ushort"); + ci->variables << TypeInfo("intefrace_", "int"); + ci->variables << TypeInfo("timeout_r", "int"); + ci->variables << TypeInfo("timeout_w", "int"); + ci->variables << TypeInfo("interface_claimed", "int"); + ci->variables << TypeInfo("ep_read", "PIUSB::Endpoint"); + ci->variables << TypeInfo("ep_write", "PIUSB::Endpoint"); + ci->variables << TypeInfo("desc_", "PIUSB::Descriptor"); + ci->variables << TypeInfo("conf_", "PIUSB::Configuration"); + ci->variables << TypeInfo("iface_", "PIUSB::Interface"); + ci->variables << TypeInfo("hdev", "usb_dev_handle*"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "className"; fi->return_type = TypeInfo("", "const char *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "copy"; fi->return_type = TypeInfo("", "PIIODevice *"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "currentDescriptor"; fi->return_type = TypeInfo("", "const PIUSB::Descriptor &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "currentConfiguration"; fi->return_type = TypeInfo("", "const PIUSB::Configuration &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "currentInterface"; fi->return_type = TypeInfo("", "const PIUSB::Interface &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "vendorID"; fi->return_type = TypeInfo("", "ushort"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "productID"; fi->return_type = TypeInfo("", "ushort"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "deviceNumber"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "timeoutRead"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "timeoutWrite"; fi->return_type = TypeInfo("", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "endpointRead"; fi->return_type = TypeInfo("", "const PIUSB::Endpoint &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "endpointWrite"; fi->return_type = TypeInfo("", "const PIUSB::Endpoint &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "endpoints"; fi->return_type = TypeInfo("", "const PIVector &"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "endpointsRead"; fi->return_type = TypeInfo("", "PIVector"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "endpointsWrite"; fi->return_type = TypeInfo("", "PIVector"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "getEndpointByAddress"; fi->return_type = TypeInfo("", "PIUSB::Endpoint"); + fi->arguments << TypeInfo("address", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setVendorID"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("vid", "ushort"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setProductID"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("pid", "ushort"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setConfiguration"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("value", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setInterface"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("value", "uchar"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setEndpointRead"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ep", "PIUSB::Endpoint &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setEndpointWrite"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("ep", "PIUSB::Endpoint &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setDeviceNumber"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("dn", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setTimeoutRead"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("t", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "setTimeoutWrite"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("t", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "read"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("read_to", "void *"); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "write"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "controlWrite"; fi->return_type = TypeInfo("", "int"); + fi->arguments << TypeInfo("data", "void *", Const); + fi->arguments << TypeInfo("max_size", "int"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "flush"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "fullPathPrefix"; fi->return_type = TypeInfo("", "PIString"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configureFromFullPath"; fi->return_type = TypeInfo("", "void"); + fi->arguments << TypeInfo("full_path", "PIString &", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "configureDevice"; fi->return_type = TypeInfo("", "bool"); + fi->arguments << TypeInfo("e_main", "void *", Const); + fi->arguments << TypeInfo("e_parent", "void *", Const); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "openDevice"; fi->return_type = TypeInfo("", "bool"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "closeDevice"; fi->return_type = TypeInfo("", "bool"); + + ci = new ClassInfo(); + (*classesInfo)["PIUSB::Endpoint"] = ci; + ci->name = "PIUSB::Endpoint"; + ci->variables << TypeInfo("address", "uchar"); + ci->variables << TypeInfo("attributes", "uchar"); + ci->variables << TypeInfo("max_packet_size", "ushort"); + ci->variables << TypeInfo("direction", "PIUSB::Endpoint::Direction"); + ci->variables << TypeInfo("transfer_type", "PIUSB::Endpoint::TransferType"); + ci->variables << TypeInfo("synchronisation_type", "PIUSB::Endpoint::SynchronisationType"); + ci->variables << TypeInfo("usage_type", "PIUSB::Endpoint::UsageType"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "parse"; fi->return_type = TypeInfo("", "void"); + ci->functions.push_back(FunctionInfo()); fi = &(ci->functions.back()); + fi->name = "isNull"; fi->return_type = TypeInfo("", "bool"); + + ci = new ClassInfo(); + (*classesInfo)["PIUSB::Interface"] = ci; + ci->name = "PIUSB::Interface"; + ci->variables << TypeInfo("index", "uchar"); + ci->variables << TypeInfo("value_to_select", "uchar"); + ci->variables << TypeInfo("class_code", "ushort"); + ci->variables << TypeInfo("subclass_code", "ushort"); + ci->variables << TypeInfo("protocol_code", "ushort"); + ci->variables << TypeInfo("endpoints", "PIVector"); + + ci = new ClassInfo(); + (*classesInfo)["PIUSB::Configuration"] = ci; + ci->name = "PIUSB::Configuration"; + ci->variables << TypeInfo("index", "uchar"); + ci->variables << TypeInfo("value_to_select", "uchar"); + ci->variables << TypeInfo("attributes", "uchar"); + ci->variables << TypeInfo("max_power", "ushort"); + ci->variables << TypeInfo("self_powered", "bool"); + ci->variables << TypeInfo("remote_wakeup", "bool"); + ci->variables << TypeInfo("interfaces", "PIVector"); + + ci = new ClassInfo(); + (*classesInfo)["PIUSB::Descriptor"] = ci; + ci->name = "PIUSB::Descriptor"; + ci->variables << TypeInfo("usb_spec_number", "ushort"); + ci->variables << TypeInfo("device_class", "uchar"); + ci->variables << TypeInfo("device_subclass", "uchar"); + ci->variables << TypeInfo("device_protocol", "uchar"); + ci->variables << TypeInfo("max_packet_size", "uchar"); + ci->variables << TypeInfo("id_vendor", "ushort"); + ci->variables << TypeInfo("id_product", "ushort"); + ci->variables << TypeInfo("id_device_release", "ushort"); + ci->variables << TypeInfo("index_manufacturer", "uchar"); + ci->variables << TypeInfo("index_product", "uchar"); + ci->variables << TypeInfo("index_serial", "uchar"); + ci->variables << TypeInfo("configurations", "PIVector"); + +// Enums + + ei = new EnumInfo(); + (*enumsInfo)["PICoutSpecialChar"] = ei; + ei->name = "PICoutSpecialChar"; + ei->members << PICodeInfo::EnumeratorInfo("Null", 0); + ei->members << PICodeInfo::EnumeratorInfo("NewLine", 1); + ei->members << PICodeInfo::EnumeratorInfo("Tab", 2); + ei->members << PICodeInfo::EnumeratorInfo("Esc", 3); + ei->members << PICodeInfo::EnumeratorInfo("Quote", 4); + + ei = new EnumInfo(); + (*enumsInfo)["PICoutAction"] = ei; + ei->name = "PICoutAction"; + ei->members << PICodeInfo::EnumeratorInfo("Flush", 0); + ei->members << PICodeInfo::EnumeratorInfo("Backspace", 1); + ei->members << PICodeInfo::EnumeratorInfo("ShowCursor", 2); + ei->members << PICodeInfo::EnumeratorInfo("HideCursor", 3); + ei->members << PICodeInfo::EnumeratorInfo("ClearScreen", 4); + ei->members << PICodeInfo::EnumeratorInfo("SaveContol", 5); + ei->members << PICodeInfo::EnumeratorInfo("RestoreControl", 6); + + ei = new EnumInfo(); + (*enumsInfo)["PICoutControl"] = ei; + ei->name = "PICoutControl"; + ei->members << PICodeInfo::EnumeratorInfo("AddNone", 0); + ei->members << PICodeInfo::EnumeratorInfo("AddSpaces", 1); + ei->members << PICodeInfo::EnumeratorInfo("AddNewLine", 2); + ei->members << PICodeInfo::EnumeratorInfo("AddQuotes", 4); + ei->members << PICodeInfo::EnumeratorInfo("AddAll", -1); + + ei = new EnumInfo(); + (*enumsInfo)["PICoutFormat"] = ei; + ei->name = "PICoutFormat"; + ei->members << PICodeInfo::EnumeratorInfo("Bin", 1); + ei->members << PICodeInfo::EnumeratorInfo("Oct", 2); + ei->members << PICodeInfo::EnumeratorInfo("Dec", 4); + ei->members << PICodeInfo::EnumeratorInfo("Hex", 8); + ei->members << PICodeInfo::EnumeratorInfo("Bold", 16); + ei->members << PICodeInfo::EnumeratorInfo("Faint", 32); + ei->members << PICodeInfo::EnumeratorInfo("Italic", 64); + ei->members << PICodeInfo::EnumeratorInfo("Underline", 128); + ei->members << PICodeInfo::EnumeratorInfo("Blink", 256); + ei->members << PICodeInfo::EnumeratorInfo("Black", 1024); + ei->members << PICodeInfo::EnumeratorInfo("Red", 2048); + ei->members << PICodeInfo::EnumeratorInfo("Green", 4096); + ei->members << PICodeInfo::EnumeratorInfo("Blue", 8192); + ei->members << PICodeInfo::EnumeratorInfo("Yellow", 16384); + ei->members << PICodeInfo::EnumeratorInfo("Magenta", 32768); + ei->members << PICodeInfo::EnumeratorInfo("Cyan", 65536); + ei->members << PICodeInfo::EnumeratorInfo("White", 131072); + ei->members << PICodeInfo::EnumeratorInfo("BackBlack", 262144); + ei->members << PICodeInfo::EnumeratorInfo("BackRed", 524288); + ei->members << PICodeInfo::EnumeratorInfo("BackGreen", 1048576); + ei->members << PICodeInfo::EnumeratorInfo("BackBlue", 2097152); + ei->members << PICodeInfo::EnumeratorInfo("BackYellow", 4194304); + ei->members << PICodeInfo::EnumeratorInfo("BackMagenta", 8388608); + ei->members << PICodeInfo::EnumeratorInfo("BackCyan", 16777216); + ei->members << PICodeInfo::EnumeratorInfo("BackWhite", 33554432); + ei->members << PICodeInfo::EnumeratorInfo("Default", 67108864); + + ei = new EnumInfo(); + (*enumsInfo)["Solver::Method"] = ei; + ei->name = "Solver::Method"; + ei->members << PICodeInfo::EnumeratorInfo("Global", -1); + ei->members << PICodeInfo::EnumeratorInfo("Eyler_1", 1); + ei->members << PICodeInfo::EnumeratorInfo("Eyler_2", 2); + ei->members << PICodeInfo::EnumeratorInfo("EylerKoshi", 3); + ei->members << PICodeInfo::EnumeratorInfo("RungeKutta_4", 14); + ei->members << PICodeInfo::EnumeratorInfo("AdamsBashfortMoulton_2", 22); + ei->members << PICodeInfo::EnumeratorInfo("AdamsBashfortMoulton_3", 23); + ei->members << PICodeInfo::EnumeratorInfo("AdamsBashfortMoulton_4", 24); + ei->members << PICodeInfo::EnumeratorInfo("PolynomialApproximation_2", 32); + ei->members << PICodeInfo::EnumeratorInfo("PolynomialApproximation_3", 33); + ei->members << PICodeInfo::EnumeratorInfo("PolynomialApproximation_4", 34); + ei->members << PICodeInfo::EnumeratorInfo("PolynomialApproximation_5", 35); + + ei = new EnumInfo(); + (*enumsInfo)["PIVariant::Type"] = ei; + ei->name = "PIVariant::Type"; + ei->members << PICodeInfo::EnumeratorInfo("Invalid", 0); + ei->members << PICodeInfo::EnumeratorInfo("Bool", 1); + ei->members << PICodeInfo::EnumeratorInfo("Char", 2); + ei->members << PICodeInfo::EnumeratorInfo("UChar", 3); + ei->members << PICodeInfo::EnumeratorInfo("Short", 4); + ei->members << PICodeInfo::EnumeratorInfo("UShort", 5); + ei->members << PICodeInfo::EnumeratorInfo("Int", 6); + ei->members << PICodeInfo::EnumeratorInfo("UInt", 7); + ei->members << PICodeInfo::EnumeratorInfo("Long", 8); + ei->members << PICodeInfo::EnumeratorInfo("ULong", 9); + ei->members << PICodeInfo::EnumeratorInfo("LLong", 10); + ei->members << PICodeInfo::EnumeratorInfo("ULLong", 11); + ei->members << PICodeInfo::EnumeratorInfo("Float", 12); + ei->members << PICodeInfo::EnumeratorInfo("Double", 13); + ei->members << PICodeInfo::EnumeratorInfo("LDouble", 14); + ei->members << PICodeInfo::EnumeratorInfo("Complexd", 15); + ei->members << PICodeInfo::EnumeratorInfo("Complexld", 16); + ei->members << PICodeInfo::EnumeratorInfo("BitArray", 17); + ei->members << PICodeInfo::EnumeratorInfo("ByteArray", 18); + ei->members << PICodeInfo::EnumeratorInfo("String", 19); + ei->members << PICodeInfo::EnumeratorInfo("StringList", 20); + ei->members << PICodeInfo::EnumeratorInfo("Time", 21); + ei->members << PICodeInfo::EnumeratorInfo("Date", 22); + ei->members << PICodeInfo::EnumeratorInfo("DateTime", 23); + ei->members << PICodeInfo::EnumeratorInfo("SystemTime", 24); + ei->members << PICodeInfo::EnumeratorInfo("Custom", 255); + + ei = new EnumInfo(); + (*enumsInfo)["PIThread::Priority"] = ei; + ei->name = "PIThread::Priority"; + ei->members << PICodeInfo::EnumeratorInfo("piHighest", -2); + ei->members << PICodeInfo::EnumeratorInfo("piHigh", -1); + ei->members << PICodeInfo::EnumeratorInfo("piNormal", 0); + ei->members << PICodeInfo::EnumeratorInfo("piLow", 1); + ei->members << PICodeInfo::EnumeratorInfo("piLowerst", 2); + + ei = new EnumInfo(); + (*enumsInfo)["PIKbdListener::SpecialSymbol"] = ei; + ei->name = "PIKbdListener::SpecialSymbol"; + ei->members << PICodeInfo::EnumeratorInfo("UpArrow", -1); + ei->members << PICodeInfo::EnumeratorInfo("DownArrow", -2); + ei->members << PICodeInfo::EnumeratorInfo("RightArrow", -3); + ei->members << PICodeInfo::EnumeratorInfo("LeftArrow", -4); + ei->members << PICodeInfo::EnumeratorInfo("CtrlUpArrow", -5); + ei->members << PICodeInfo::EnumeratorInfo("CtrlDownArrow", -6); + ei->members << PICodeInfo::EnumeratorInfo("CtrlRightArrow", -7); + ei->members << PICodeInfo::EnumeratorInfo("CtrlLeftArrow", -8); + + ei = new EnumInfo(); + (*enumsInfo)["PIIODevice::DeviceMode"] = ei; + ei->name = "PIIODevice::DeviceMode"; + ei->members << PICodeInfo::EnumeratorInfo("ReadOnly", 1); + ei->members << PICodeInfo::EnumeratorInfo("WriteOnly", 2); + ei->members << PICodeInfo::EnumeratorInfo("ReadWrite", 3); + + ei = new EnumInfo(); + (*enumsInfo)["PISerial::Parameters"] = ei; + ei->name = "PISerial::Parameters"; + ei->members << PICodeInfo::EnumeratorInfo("ParityControl", 1); + ei->members << PICodeInfo::EnumeratorInfo("ParityOdd", 2); + ei->members << PICodeInfo::EnumeratorInfo("TwoStopBits", 4); + + ei = new EnumInfo(); + (*enumsInfo)["PISerial::Speed"] = ei; + ei->name = "PISerial::Speed"; + ei->members << PICodeInfo::EnumeratorInfo("S50", 50); + ei->members << PICodeInfo::EnumeratorInfo("S75", 75); + ei->members << PICodeInfo::EnumeratorInfo("S110", 110); + ei->members << PICodeInfo::EnumeratorInfo("S300", 300); + ei->members << PICodeInfo::EnumeratorInfo("S600", 600); + ei->members << PICodeInfo::EnumeratorInfo("S1200", 1200); + ei->members << PICodeInfo::EnumeratorInfo("S2400", 2400); + ei->members << PICodeInfo::EnumeratorInfo("S4800", 4800); + ei->members << PICodeInfo::EnumeratorInfo("S9600", 9600); + ei->members << PICodeInfo::EnumeratorInfo("S19200", 19200); + ei->members << PICodeInfo::EnumeratorInfo("S38400", 38400); + ei->members << PICodeInfo::EnumeratorInfo("S57600", 57600); + ei->members << PICodeInfo::EnumeratorInfo("S115200", 115200); + ei->members << PICodeInfo::EnumeratorInfo("S1500000", 1500000); + ei->members << PICodeInfo::EnumeratorInfo("S2000000", 2000000); + ei->members << PICodeInfo::EnumeratorInfo("S2500000", 2500000); + ei->members << PICodeInfo::EnumeratorInfo("S3000000", 3000000); + ei->members << PICodeInfo::EnumeratorInfo("S3500000", 3500000); + ei->members << PICodeInfo::EnumeratorInfo("S4000000", 4000000); + + ei = new EnumInfo(); + (*enumsInfo)["PIEthernet::Type"] = ei; + ei->name = "PIEthernet::Type"; + ei->members << PICodeInfo::EnumeratorInfo("UDP", 0); + ei->members << PICodeInfo::EnumeratorInfo("TCP_Client", 1); + ei->members << PICodeInfo::EnumeratorInfo("TCP_Server", 2); + ei->members << PICodeInfo::EnumeratorInfo("TCP_SingleTCP", 3); + + ei = new EnumInfo(); + (*enumsInfo)["PIEthernet::Parameters"] = ei; + ei->name = "PIEthernet::Parameters"; + ei->members << PICodeInfo::EnumeratorInfo("ReuseAddress", 1); + ei->members << PICodeInfo::EnumeratorInfo("Broadcast", 2); + + ei = new EnumInfo(); + (*enumsInfo)["PIEthernet::InterfaceFlag"] = ei; + ei->name = "PIEthernet::InterfaceFlag"; + ei->members << PICodeInfo::EnumeratorInfo("ifActive", 1); + ei->members << PICodeInfo::EnumeratorInfo("ifRunning", 2); + ei->members << PICodeInfo::EnumeratorInfo("ifBroadcast", 4); + ei->members << PICodeInfo::EnumeratorInfo("ifMulticast", 8); + ei->members << PICodeInfo::EnumeratorInfo("ifLoopback", 16); + ei->members << PICodeInfo::EnumeratorInfo("ifPTP", 32); + + ei = new EnumInfo(); + (*enumsInfo)["PIProtocol::Type"] = ei; + ei->name = "PIProtocol::Type"; + ei->members << PICodeInfo::EnumeratorInfo("None", 0); + ei->members << PICodeInfo::EnumeratorInfo("Serial", 1); + ei->members << PICodeInfo::EnumeratorInfo("Ethernet", 2); + + ei = new EnumInfo(); + (*enumsInfo)["PIProtocol::Quality"] = ei; + ei->name = "PIProtocol::Quality"; + ei->members << PICodeInfo::EnumeratorInfo("Unknown", 1); + ei->members << PICodeInfo::EnumeratorInfo("Failure", 2); + ei->members << PICodeInfo::EnumeratorInfo("Bad", 3); + ei->members << PICodeInfo::EnumeratorInfo("Average", 4); + ei->members << PICodeInfo::EnumeratorInfo("Good", 5); + + ei = new EnumInfo(); + (*enumsInfo)["PIDiagnostics::Quality"] = ei; + ei->name = "PIDiagnostics::Quality"; + ei->members << PICodeInfo::EnumeratorInfo("Unknown", 1); + ei->members << PICodeInfo::EnumeratorInfo("Failure", 2); + ei->members << PICodeInfo::EnumeratorInfo("Bad", 3); + ei->members << PICodeInfo::EnumeratorInfo("Average", 4); + ei->members << PICodeInfo::EnumeratorInfo("Good", 5); + + ei = new EnumInfo(); + (*enumsInfo)["PIConsole::Format"] = ei; + ei->name = "PIConsole::Format"; + ei->members << PICodeInfo::EnumeratorInfo("Normal", 1); + ei->members << PICodeInfo::EnumeratorInfo("Bold", 2); + ei->members << PICodeInfo::EnumeratorInfo("Faint", 4); + ei->members << PICodeInfo::EnumeratorInfo("Italic", 8); + ei->members << PICodeInfo::EnumeratorInfo("Underline", 16); + ei->members << PICodeInfo::EnumeratorInfo("Blink", 32); + ei->members << PICodeInfo::EnumeratorInfo("Inverse", 64); + ei->members << PICodeInfo::EnumeratorInfo("Black", 256); + ei->members << PICodeInfo::EnumeratorInfo("Red", 512); + ei->members << PICodeInfo::EnumeratorInfo("Green", 1024); + ei->members << PICodeInfo::EnumeratorInfo("Yellow", 2048); + ei->members << PICodeInfo::EnumeratorInfo("Blue", 4096); + ei->members << PICodeInfo::EnumeratorInfo("Magenta", 8192); + ei->members << PICodeInfo::EnumeratorInfo("Cyan", 16384); + ei->members << PICodeInfo::EnumeratorInfo("White", 32768); + ei->members << PICodeInfo::EnumeratorInfo("BackBlack", 65536); + ei->members << PICodeInfo::EnumeratorInfo("BackRed", 131072); + ei->members << PICodeInfo::EnumeratorInfo("BackGreen", 262144); + ei->members << PICodeInfo::EnumeratorInfo("BackYellow", 524288); + ei->members << PICodeInfo::EnumeratorInfo("BackBlue", 1048576); + ei->members << PICodeInfo::EnumeratorInfo("BackMagenta", 2097152); + ei->members << PICodeInfo::EnumeratorInfo("BackCyan", 4194304); + ei->members << PICodeInfo::EnumeratorInfo("BackWhite", 8388608); + ei->members << PICodeInfo::EnumeratorInfo("Dec", 16777216); + ei->members << PICodeInfo::EnumeratorInfo("Hex", 33554432); + ei->members << PICodeInfo::EnumeratorInfo("Oct", 67108864); + ei->members << PICodeInfo::EnumeratorInfo("Bin", 134217728); + ei->members << PICodeInfo::EnumeratorInfo("Scientific", 268435456); + ei->members << PICodeInfo::EnumeratorInfo("SystemTimeSplit", 536870912); + ei->members << PICodeInfo::EnumeratorInfo("SystemTimeSeconds", 1073741824); + + ei = new EnumInfo(); + (*enumsInfo)["PIConsole::Alignment"] = ei; + ei->name = "PIConsole::Alignment"; + ei->members << PICodeInfo::EnumeratorInfo("Nothing", 0); + ei->members << PICodeInfo::EnumeratorInfo("Left", 1); + ei->members << PICodeInfo::EnumeratorInfo("Right", 2); + + ei = new EnumInfo(); + (*enumsInfo)["PIConsole::ConnectedState"] = ei; + ei->name = "PIConsole::ConnectedState"; + ei->members << PICodeInfo::EnumeratorInfo("Disconnected", 0); + ei->members << PICodeInfo::EnumeratorInfo("FetchingData", 1); + ei->members << PICodeInfo::EnumeratorInfo("Committing", 2); + ei->members << PICodeInfo::EnumeratorInfo("Connected", 3); + + ei = new EnumInfo(); + (*enumsInfo)["eType"] = ei; + ei->name = "eType"; + ei->members << PICodeInfo::EnumeratorInfo("etNumber", 0); + ei->members << PICodeInfo::EnumeratorInfo("etOperator", 1); + ei->members << PICodeInfo::EnumeratorInfo("etVariable", 2); + ei->members << PICodeInfo::EnumeratorInfo("etFunction", 3); + + ei = new EnumInfo(); + (*enumsInfo)["Operation"] = ei; + ei->name = "Operation"; + ei->members << PICodeInfo::EnumeratorInfo("oNone", 0); + ei->members << PICodeInfo::EnumeratorInfo("oAdd", 1); + ei->members << PICodeInfo::EnumeratorInfo("oSubtract", 2); + ei->members << PICodeInfo::EnumeratorInfo("oMultiply", 3); + ei->members << PICodeInfo::EnumeratorInfo("oDivide", 4); + ei->members << PICodeInfo::EnumeratorInfo("oResidue", 5); + ei->members << PICodeInfo::EnumeratorInfo("oPower", 6); + ei->members << PICodeInfo::EnumeratorInfo("oEqual", 7); + ei->members << PICodeInfo::EnumeratorInfo("oNotEqual", 8); + ei->members << PICodeInfo::EnumeratorInfo("oGreater", 9); + ei->members << PICodeInfo::EnumeratorInfo("oSmaller", 10); + ei->members << PICodeInfo::EnumeratorInfo("oGreaterEqual", 11); + ei->members << PICodeInfo::EnumeratorInfo("oSmallerEqual", 12); + ei->members << PICodeInfo::EnumeratorInfo("oAnd", 13); + ei->members << PICodeInfo::EnumeratorInfo("oOr", 14); + ei->members << PICodeInfo::EnumeratorInfo("oFunction", 15); + + ei = new EnumInfo(); + (*enumsInfo)["BaseFunctions"] = ei; + ei->name = "BaseFunctions"; + ei->members << PICodeInfo::EnumeratorInfo("bfUnknown", 0); + ei->members << PICodeInfo::EnumeratorInfo("bfSin", 1); + ei->members << PICodeInfo::EnumeratorInfo("bfCos", 2); + ei->members << PICodeInfo::EnumeratorInfo("bfTg", 3); + ei->members << PICodeInfo::EnumeratorInfo("bfCtg", 4); + ei->members << PICodeInfo::EnumeratorInfo("bfArcsin", 5); + ei->members << PICodeInfo::EnumeratorInfo("bfArccos", 6); + ei->members << PICodeInfo::EnumeratorInfo("bfArctg", 7); + ei->members << PICodeInfo::EnumeratorInfo("bfArcctg", 8); + ei->members << PICodeInfo::EnumeratorInfo("bfExp", 9); + ei->members << PICodeInfo::EnumeratorInfo("bfRandom", 10); + ei->members << PICodeInfo::EnumeratorInfo("bfSh", 11); + ei->members << PICodeInfo::EnumeratorInfo("bfCh", 12); + ei->members << PICodeInfo::EnumeratorInfo("bfTh", 13); + ei->members << PICodeInfo::EnumeratorInfo("bfCth", 14); + ei->members << PICodeInfo::EnumeratorInfo("bfSqrt", 15); + ei->members << PICodeInfo::EnumeratorInfo("bfSqr", 16); + ei->members << PICodeInfo::EnumeratorInfo("bfPow", 17); + ei->members << PICodeInfo::EnumeratorInfo("bfAbs", 18); + ei->members << PICodeInfo::EnumeratorInfo("bfLn", 19); + ei->members << PICodeInfo::EnumeratorInfo("bfLg", 20); + ei->members << PICodeInfo::EnumeratorInfo("bfLog", 21); + ei->members << PICodeInfo::EnumeratorInfo("bfSign", 22); + ei->members << PICodeInfo::EnumeratorInfo("bfIm", 23); + ei->members << PICodeInfo::EnumeratorInfo("bfRe", 24); + ei->members << PICodeInfo::EnumeratorInfo("bfArg", 25); + ei->members << PICodeInfo::EnumeratorInfo("bfLen", 26); + ei->members << PICodeInfo::EnumeratorInfo("bfConj", 27); + ei->members << PICodeInfo::EnumeratorInfo("bfRad", 28); + ei->members << PICodeInfo::EnumeratorInfo("bfDeg", 29); + ei->members << PICodeInfo::EnumeratorInfo("bfJ0", 30); + ei->members << PICodeInfo::EnumeratorInfo("bfJ1", 31); + ei->members << PICodeInfo::EnumeratorInfo("bfJN", 32); + ei->members << PICodeInfo::EnumeratorInfo("bfY0", 33); + ei->members << PICodeInfo::EnumeratorInfo("bfY1", 34); + ei->members << PICodeInfo::EnumeratorInfo("bfYN", 35); + ei->members << PICodeInfo::EnumeratorInfo("bfMin", 36); + ei->members << PICodeInfo::EnumeratorInfo("bfMax", 37); + ei->members << PICodeInfo::EnumeratorInfo("bfClamp", 38); + ei->members << PICodeInfo::EnumeratorInfo("bfStep", 39); + ei->members << PICodeInfo::EnumeratorInfo("bfMix", 40); + ei->members << PICodeInfo::EnumeratorInfo("bfDefined", 41); + ei->members << PICodeInfo::EnumeratorInfo("bfCustom", 65535); + + ei = new EnumInfo(); + (*enumsInfo)["PISignals::Signal"] = ei; + ei->name = "PISignals::Signal"; + ei->members << PICodeInfo::EnumeratorInfo("Interrupt", 1); + ei->members << PICodeInfo::EnumeratorInfo("Illegal", 2); + ei->members << PICodeInfo::EnumeratorInfo("Abort", 4); + ei->members << PICodeInfo::EnumeratorInfo("FPE", 8); + ei->members << PICodeInfo::EnumeratorInfo("SegFault", 16); + ei->members << PICodeInfo::EnumeratorInfo("Termination", 32); + ei->members << PICodeInfo::EnumeratorInfo("Hangup", 64); + ei->members << PICodeInfo::EnumeratorInfo("Quit", 128); + ei->members << PICodeInfo::EnumeratorInfo("Kill", 256); + ei->members << PICodeInfo::EnumeratorInfo("BrokenPipe", 512); + ei->members << PICodeInfo::EnumeratorInfo("Timer", 1024); + ei->members << PICodeInfo::EnumeratorInfo("UserDefined1", 2048); + ei->members << PICodeInfo::EnumeratorInfo("UserDefined2", 4096); + ei->members << PICodeInfo::EnumeratorInfo("ChildStopped", 8192); + ei->members << PICodeInfo::EnumeratorInfo("Continue", 16384); + ei->members << PICodeInfo::EnumeratorInfo("StopProcess", 32768); + ei->members << PICodeInfo::EnumeratorInfo("StopTTY", 65536); + ei->members << PICodeInfo::EnumeratorInfo("StopTTYInput", 131072); + ei->members << PICodeInfo::EnumeratorInfo("StopTTYOutput", 262144); + ei->members << PICodeInfo::EnumeratorInfo("All", 1048575); + + ei = new EnumInfo(); + (*enumsInfo)["PIBinaryLog::PlayMode"] = ei; + ei->name = "PIBinaryLog::PlayMode"; + ei->members << PICodeInfo::EnumeratorInfo("PlayRealTime", 0); + ei->members << PICodeInfo::EnumeratorInfo("PlayVariableSpeed", 1); + + ei = new EnumInfo(); + (*enumsInfo)["PIUSB::Endpoint::Direction"] = ei; + ei->name = "PIUSB::Endpoint::Direction"; + ei->members << PICodeInfo::EnumeratorInfo("Write", 0); + ei->members << PICodeInfo::EnumeratorInfo("Read", 1); + + ei = new EnumInfo(); + (*enumsInfo)["PIUSB::Endpoint::TransferType"] = ei; + ei->name = "PIUSB::Endpoint::TransferType"; + ei->members << PICodeInfo::EnumeratorInfo("Control", 0); + ei->members << PICodeInfo::EnumeratorInfo("Isochronous", 1); + ei->members << PICodeInfo::EnumeratorInfo("Bulk", 2); + ei->members << PICodeInfo::EnumeratorInfo("Interrupt", 3); + + ei = new EnumInfo(); + (*enumsInfo)["PIUSB::Endpoint::SynchronisationType"] = ei; + ei->name = "PIUSB::Endpoint::SynchronisationType"; + ei->members << PICodeInfo::EnumeratorInfo("NoSynchonisation", 0); + ei->members << PICodeInfo::EnumeratorInfo("Asynchronous", 2); + ei->members << PICodeInfo::EnumeratorInfo("Adaptive", 1); + ei->members << PICodeInfo::EnumeratorInfo("Synchronous", 3); + + ei = new EnumInfo(); + (*enumsInfo)["PIUSB::Endpoint::UsageType"] = ei; + ei->name = "PIUSB::Endpoint::UsageType"; + ei->members << PICodeInfo::EnumeratorInfo("DataEndpoint", 0); + ei->members << PICodeInfo::EnumeratorInfo("FeedbackEndpoint", 2); + ei->members << PICodeInfo::EnumeratorInfo("ExplicitFeedbackDataEndpoint", 1); +} + + +bool __ClassInfo_TEST_H_Initializer__::_inited_ = false; diff --git a/code_model_generator/test.h b/code_model_generator/test.h new file mode 100644 index 00000000..6f7e77a3 --- /dev/null +++ b/code_model_generator/test.h @@ -0,0 +1,100 @@ +// Generated by "PIP Code model generator" 29.04.2014 18:03:05 + +#ifndef TEST_H +#define TEST_H + +#include "pivariant.h" +#include "picodeinfo.h" + +class PIMutex; +class PIBitArray; +class PIHuffman; +class PIByteArray; +class PIChar; +class PIString; +class PIStringList; +class PISystemTime; +struct PITime; +struct PIDate; +struct PIDateTime; +class Solver; +class PIFFT; +class PIVariant; +class PIObject; +class PIThread; +class PITimer; +class PIKbdListener; +class PIIODevice; +class PISerial; +class PIFile; +class PIProcess; +class PIEthernet; +class PIPacketExtractor; +class PIConfig; +class PIMultiProtocolBase; +class PIProtocol; +class PIDiagnostics; +class PISystemMonitor; +class PIConsole; +class PICLI; +class PIEvaluatorContent; +class PIEvaluator; +class PIMultiProtocol; +class PIRepeater; +class PICodec; +class PIPeer; +class PIBinaryLog; +class PIUSB; + + +PIVariant execFunction(PIMutex * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIBitArray * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIHuffman * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIByteArray * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIChar * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIString * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIStringList * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PISystemTime * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PITime * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIDate * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIDateTime * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(Solver * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIFFT * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIVariant * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIObject * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIThread * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PITimer * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIKbdListener * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIIODevice * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PISerial * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIFile * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIProcess * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIEthernet * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIPacketExtractor * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIConfig * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIMultiProtocolBase * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIProtocol * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIDiagnostics * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PISystemMonitor * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIConsole * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PICLI * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIEvaluatorContent * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIEvaluator * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIMultiProtocol * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIRepeater * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PICodec * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIPeer * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIBinaryLog * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); +PIVariant execFunction(PIUSB * object, const char * function, const PIVariant & arg0 = PIVariant(), const PIVariant & arg1 = PIVariant(), const PIVariant & arg2 = PIVariant(), const PIVariant & arg3 = PIVariant()); + + +class __ClassInfo_TEST_H_Initializer__ { +public: + __ClassInfo_TEST_H_Initializer__(); + static bool _inited_; +}; + +static __ClassInfo_TEST_H_Initializer__ __classinfo_test_h_initializer__; + + +#endif // TEST_H diff --git a/main.cpp b/main.cpp index b58862b5..b5adc277 100644 --- a/main.cpp +++ b/main.cpp @@ -46,90 +46,119 @@ class ElementD: public PIObject { #include "pip.h" #include "pivariant.h" -/* -Test::PIVariant<> * pv; -template -Test::PIVariant newVariant(const T & v) {return Test::PIVariant(v);} -template -Test::PIVariant * castVariant(Test::__PIVariantBase * v, const T & t) {return static_cast * >(v);} -*/ + + #include "picodeparser.h" +#include "pidir.h" +#include "piconnection.h" +#include -#define S(a, b) a#b - -enum TypeFlag {NoFlag, Const = 0x01, Static = 0x02, Mutable = 0x04, Volatile = 0x08, Inline = 0x10, Virtual = 0x20}; -typedef PIFlags TypeFlags; -struct TypeInfo { - TypeInfo() {flags = 0;} - PIString name; - PIString type; - TypeFlags flags; -}; -struct FunctionInfo { - PIString name; - TypeInfo return_type; - PIVector arguments; -}; -struct ClassInfo { - PIString name; - PIStringList parents; - PIVector variables; - PIVector functions; -}; -inline PICout operator <<(PICout s, const TypeInfo & v) { - if (v.flags[Inline]) s << "inline "; - if (v.flags[Virtual]) s << "virtual "; - if (v.flags[Static]) s << "static "; - if (v.flags[Const]) s << "const "; - if (v.flags[Mutable]) s << "mutable "; - if (v.flags[Volatile]) s << "volatile "; - s << v.type; - if (!v.name.isEmpty()) - s << " " << v.name; - return s; +bool readed(void*, uchar * data, int size) { + piCout << Hex << "readed" << PIByteArray(data, size); + //piCout << PIString((char*)data, size); + return true; } -inline PICout operator <<(PICout s, const ClassInfo & v) { - s.setControl(0, true); - s << "class " << v.name; - if (!v.parents.isEmpty()) { - s << ": "; - bool first = true; - piForeachC (PIString & i, v.parents) { - if (first) first = false; - else s << ", "; - s << i; - } - s << " {\n"; - piForeachC (FunctionInfo & i, v.functions) { - s << Tab << i.return_type << " " << i.name << "("; - bool fa = true; - piForeachC (TypeInfo & a, i.arguments) { - if (fa) fa = false; - else s << ", "; - s << a; - } - s << ");\n"; - } - if (!v.functions.isEmpty() && !v.variables.isEmpty()) - s << "\n"; - piForeachC (TypeInfo & i, v.variables) { - s << Tab << i << ";\n"; - } - s << "}\n"; + +class A: public PIObject { + PIOBJECT(A) +public: + EVENT_HANDLER2(void, cr, const PIString &, from, const PIByteArray &, data) { + piCout << "A readed" << from << Hex << data; } - s.restoreControl(); - return s; -} + EVENT_HANDLER2(void, per, uchar *, data, int, size) { + piCout << "A readed" << size << ":\"" << PIString((const char *)data, size) << "\"" << NewLine; + //piCout << "A readed \""; + } +}; +class TC: public PIConnection { +public: + TC() { + PIPacketExtractor * pe = addFilter("h&f", addDevice("file://piiodevice.h", PIIODevice::ReadOnly, false), PIPacketExtractor::HeaderAndFooter); + pe->setHeader(PIString("//!").toByteArray()); + pe->setFooter(PIString("\n").toByteArray()); + pe = addFilter(" h ", "file://piiodevice.h", PIPacketExtractor::Header); + addChannel(pe, addDevice("file://out.txt", PIIODevice::WriteOnly)); + pe->setHeader(PIString("PI").toByteArray()); + pe->setPayloadSize(3); + startAllThreadedReads(); + } + virtual void dataReceived(const PIString & from, const PIByteArray & data) { + piCout << "dataReceived" << from << (data.size()); + } + virtual void packetReceived(const PIString & from, const PIByteArray & data) { + piCout << "packetReceived" << from << (data.size()) << PIString(data); + } + virtual bool filterValidatePayload(const PIString & filter_name, uchar * rec, int size) { + //piCout << "filterValidatePayload" << filter_name << PIString((char*)rec, size); + if (filter_name == " h ") return PIString((char*)rec, size) == "IOD"; + return false; + } +}; int main (int argc, char * argv[]) { - PIString s("this\t :is \n(SPARTA)!"); - piCout << s.findCWord("this"); - piCout << s.findCWord("is"); - piCout << s.findCWord("SPARTA"); - piCout << s.findCWord("SPARTA!"); + /*A a_; + PIFile file("piiodevice.h", PIIODevice::ReadOnly); + PIByteArray header = PIString("PI").toByteArray(); + PIByteArray footer = PIString("}").toByteArray(); + PIPacketExtractor pe(&file); + //pe.setPacketData(header.data(), header.size_s(), 10); + pe.setSplitMode(PIPacketExtractor::Footer); + pe.setHeader(header); + pe.setFooter(footer); + pe.setPayloadSize(3); + pe.setThreadedReadBufferSize(40); + //pe.setBufferSize(256); + //pe.setPacketData(0, 0, 20); + CONNECT2(void, uchar * , int , &pe, packetReceived, &a_, per) + pe.startThreadedRead(); + piMSleep(500);*/ + + TC tc; + piMSleep(500); + piCout << tc.makeConfig(); + return 0; + + /*tm = PISystemTime::current(); + for (int i = 0; i < 10000000; ++i) { + ql.append(i*10); + ql.prepend(i*10 + 1); + } + piCout << (PISystemTime::current() - tm).toMicroseconds(); + */ + //tm = PISystemTime::current(); + /*for (int i = 0; i < 100000000; ++i) { + pl.append(i*10); + pl.prepend(i*10 + 1); + }*/ + //PICodeParser cd_; + //cd.includeDirectory("../qpicalculator"); + //cd_.parseFile("piincludes.h"); + //piCout << (PISystemTime::current() - tm).toMilliseconds(); + /*piCout << NewLine; + piForeachCA (i, pl) + piCout << i; + + pl.remove(1, 2).prepend(111).prepend(222); + pl.remove(1, 1); + piCout << NewLine; + piForeachCA (i, pl) + piCout << i;*/ + /*piCout << NewLine; + for (int i = 0; i < pl.size_s(); ++i) + piCout << pl[i]; + */ + + /*PIEthernet eth(PIEthernet::UDP); + eth.setReadAddress("192.168.0.30:4001"); + eth.setSendAddress("192.168.0.50:4001"); + eth.startThreadedRead(readed); + piCout << "Connected"; + //eth.send(PIString("This is test string!\n").toByteArray()); + FOREVER_WAIT*/ + if (argc < 2) return 0; PICodeParser cd; //cd.includeDirectory("../qpicalculator"); @@ -137,48 +166,6 @@ int main (int argc, char * argv[]) { piForeachC (PICodeParser::Enum & e, cd.enums) piCout << e.name << e.members; - ClassInfo ci; - PICodeParser::Entity * e = cd.findEntityByName("PITimer"); - if (!e) return 0; - ci.name = e->name; - piForeachC (PICodeParser::Entity * p, e->parents) - ci.parents << p->name; - piForeachC (PICodeParser::Member & m, e->members) { - TypeInfo ni; - ni.name = m.name; - ni.type = m.type; - if (m.attributes[PICodeParser::Const]) ni.flags |= Const; - if (m.attributes[PICodeParser::Static]) ni.flags |= Static; - if (m.attributes[PICodeParser::Mutable]) ni.flags |= Mutable; - if (m.attributes[PICodeParser::Volatile]) ni.flags |= Volatile; - if (m.attributes[PICodeParser::Inline]) ni.flags |= Inline; - if (m.attributes[PICodeParser::Virtual]) ni.flags |= Virtual; - ci.variables << ni; - } - piForeachC (PICodeParser::Member & m, e->functions) { - FunctionInfo fi; - fi.name = m.name; - fi.return_type.type = m.type; - if (m.attributes[PICodeParser::Const]) fi.return_type.flags |= Const; - if (m.attributes[PICodeParser::Static]) fi.return_type.flags |= Static; - piForeachC (PIString & a, m.arguments_full) { - TypeInfo ni; - PIString arg(a); - arg.prepend(" "); - if (arg.find(" const ") >= 0) { - ni.flags |= Const; - arg.replaceAll(" const ", " "); - } - int ts = 0; - for (ts = arg.size_s() - 1; ts >= 0; --ts) - if (!_isCChar(arg[ts]) && !(arg[ts].isDigit())) break; - ni.name = arg.takeRight(arg.size_s() - ts - 1).trim(); - ni.type = arg.trim(); - fi.arguments << ni; - } - ci.functions << fi; - } - piCout << NewLine << ci; //piCout << v.toType(); //piCout << v.toType().toType(); diff --git a/make_lib.bat b/make_lib.bat old mode 100755 new mode 100644 diff --git a/make_rc_win.bat b/make_rc_win.bat old mode 100755 new mode 100644 diff --git a/pibinarylog.cpp b/pibinarylog.cpp index c2b3b24a..8746a45e 100644 --- a/pibinarylog.cpp +++ b/pibinarylog.cpp @@ -94,12 +94,12 @@ bool PIBinaryLog::openDevice() { return false; } if (isEmpty()) piCoutObj << "Error: Empty BinLog file"; - // startlogtime = currentSystemTime(); + // startlogtime = PISystemTime::current(); play_time = 0; // nextrecord = readsRecord(); if (!rapidStart()) is_started = true; } - startlogtime = currentSystemTime(); + startlogtime = PISystemTime::current(); return true; } @@ -119,7 +119,7 @@ bool PIBinaryLog::threadedRead(uchar *readed, int size) { double delay; switch (playMode()) { case PlayRealTime: - pt = currentSystemTime() - startlogtime; + pt = PISystemTime::current() - startlogtime; // if (real_speedX > 0) // for (int i=0; i pt) (lastrecord.timestamp - pt).sleep(); } else { - startlogtime = currentSystemTime() - lastrecord.timestamp; + startlogtime = PISystemTime::current() - lastrecord.timestamp; is_started = true; } - // int delay = piRoundd(lastread_timestamp.toMilliseconds() - (currentSystemTime() - startlogtime).toMilliseconds()); + // int delay = piRoundd(lastread_timestamp.toMilliseconds() - (PISystemTime::current() - startlogtime).toMilliseconds()); break; case PlayVariableSpeed: delay = lastrecord.timestamp.toMilliseconds() - play_time; @@ -152,7 +152,7 @@ bool PIBinaryLog::threadedRead(uchar *readed, int size) { PIString PIBinaryLog::createNewFile() { if (!file.close()) return PIString(); - if (open(logDir() + "/" + filePrefix() + currentDateTime().toString("yyyy_MM_dd__hh_mm_ss.binlog"), PIIODevice::WriteOnly)) + if (open(logDir() + "/" + filePrefix() + PIDateTime::current().toString("yyyy_MM_dd__hh_mm_ss.binlog"), PIIODevice::WriteOnly)) return file.path(); piCoutObj << "Can't create new file, maybe LogDir is invalid."; return PIString(); @@ -162,7 +162,7 @@ PIString PIBinaryLog::createNewFile() { int PIBinaryLog::writeBinLog(int id, const void *data, int size) { if (size <= 0 || !canWrite()) return -1; PIByteArray logdata; - logdata << id << size << (currentSystemTime() - startlogtime) << PIByteArray::RawData(data, size); + logdata << id << size << (PISystemTime::current() - startlogtime) << PIByteArray::RawData(data, size); int res = file.write(logdata.data(), logdata.size()); file.flush(); if (res > 0) return size; @@ -242,7 +242,7 @@ void PIBinaryLog::restart() { play_time = 0; file.seekToBegin(); checkFileHeader(); - startlogtime = currentSystemTime(); + startlogtime = PISystemTime::current(); if (th) startThreadedRead(); } @@ -306,6 +306,13 @@ PIBinaryLog::BinLogRecord PIBinaryLog::readRecord() { } +PIString PIBinaryLog::constructFullPath() const { + PIString ret(fullPathPrefix() + "://"); + ret << logDir() << ":" << filePrefix() << ":" << defaultID(); + return ret; +} + + void PIBinaryLog::configureFromFullPath(const PIString & full_path) { PIStringList pl = full_path.split(":"); for (int i = 0; i < pl.size_s(); ++i) { diff --git a/pibinarylog.h b/pibinarylog.h index d9feebb8..9958fb41 100644 --- a/pibinarylog.h +++ b/pibinarylog.h @@ -117,6 +117,7 @@ public: //! Go to begin of BinLog file void restart(); + PIString constructFullPath() const; //! \handlers //! \{ diff --git a/pibytearray.cpp b/pibytearray.cpp index ade7e436..679afde4 100644 --- a/pibytearray.cpp +++ b/pibytearray.cpp @@ -18,23 +18,21 @@ */ #include "pibytearray.h" +#include "pistring.h" /*! \class PIByteArray * \brief Byte array - * \details This class based on PIVector and provide some handle function + * \details This class based on PIDeque and provide some handle function * to manipulate it. * * \section PIByteArray_sec0 Usage * %PIByteArray can be used to store custom data and manipulate it. There are many * stream operators to store/restore common types to byte array. Store operators - * places data at the end of arraym restore operators takes data from the beginning + * places data at the end of array, restore operators takes data from the beginning * of array. * In addition there are Base 64 convertions and checksums: * * plain 8-bit * * plain 32-bit - * * CRC 8-bit - * * CRC 16-bit - * * CRC 32-bit * * One of the major usage of %PIByteArray is stream functions. You can form binary * packet from many types (also dynamic types, e.g. PIVector) with one line: @@ -114,13 +112,13 @@ int PIHuffman::nodeCompare(const void * f, const void * s) { } -PIVector PIHuffman::compress(const PIVector & src) { +PIDeque PIHuffman::compress(const PIDeque & src) { calcFrequencies(src); return src; } -void PIHuffman::calcFrequencies(const PIVector & src) { +void PIHuffman::calcFrequencies(const PIDeque & src) { nodes.resize(256); for (int i = 0; i < 256; ++i) { nodes[i].parent = nodes[i].right = nodes[i].left = 0; @@ -247,7 +245,7 @@ PIByteArray & PIByteArray::decompressRLE(uchar threshold) { } -uchar PIByteArray::checksumPlain8() { +uchar PIByteArray::checksumPlain8() const { uchar c = 0; int sz = size_s(); for (int i = 0; i < sz; ++i) @@ -257,7 +255,7 @@ uchar PIByteArray::checksumPlain8() { } -uint PIByteArray::checksumPlain32() { +uint PIByteArray::checksumPlain32() const { uint c = 0; int sz = size_s(); for (int i = 0; i < sz; ++i) @@ -267,137 +265,29 @@ uint PIByteArray::checksumPlain32() { } -uchar PIByteArray::checksumCRC8() { - const uchar CRC8Table[256] = { - 0x00, 0x31, 0x62, 0x53, 0xC4, 0xF5, 0xA6, 0x97, - 0xB9, 0x88, 0xDB, 0xEA, 0x7D, 0x4C, 0x1F, 0x2E, - 0x43, 0x72, 0x21, 0x10, 0x87, 0xB6, 0xE5, 0xD4, - 0xFA, 0xCB, 0x98, 0xA9, 0x3E, 0x0F, 0x5C, 0x6D, - 0x86, 0xB7, 0xE4, 0xD5, 0x42, 0x73, 0x20, 0x11, - 0x3F, 0x0E, 0x5D, 0x6C, 0xFB, 0xCA, 0x99, 0xA8, - 0xC5, 0xF4, 0xA7, 0x96, 0x01, 0x30, 0x63, 0x52, - 0x7C, 0x4D, 0x1E, 0x2F, 0xB8, 0x89, 0xDA, 0xEB, - 0x3D, 0x0C, 0x5F, 0x6E, 0xF9, 0xC8, 0x9B, 0xAA, - 0x84, 0xB5, 0xE6, 0xD7, 0x40, 0x71, 0x22, 0x13, - 0x7E, 0x4F, 0x1C, 0x2D, 0xBA, 0x8B, 0xD8, 0xE9, - 0xC7, 0xF6, 0xA5, 0x94, 0x03, 0x32, 0x61, 0x50, - 0xBB, 0x8A, 0xD9, 0xE8, 0x7F, 0x4E, 0x1D, 0x2C, - 0x02, 0x33, 0x60, 0x51, 0xC6, 0xF7, 0xA4, 0x95, - 0xF8, 0xC9, 0x9A, 0xAB, 0x3C, 0x0D, 0x5E, 0x6F, - 0x41, 0x70, 0x23, 0x12, 0x85, 0xB4, 0xE7, 0xD6, - 0x7A, 0x4B, 0x18, 0x29, 0xBE, 0x8F, 0xDC, 0xED, - 0xC3, 0xF2, 0xA1, 0x90, 0x07, 0x36, 0x65, 0x54, - 0x39, 0x08, 0x5B, 0x6A, 0xFD, 0xCC, 0x9F, 0xAE, - 0x80, 0xB1, 0xE2, 0xD3, 0x44, 0x75, 0x26, 0x17, - 0xFC, 0xCD, 0x9E, 0xAF, 0x38, 0x09, 0x5A, 0x6B, - 0x45, 0x74, 0x27, 0x16, 0x81, 0xB0, 0xE3, 0xD2, - 0xBF, 0x8E, 0xDD, 0xEC, 0x7B, 0x4A, 0x19, 0x28, - 0x06, 0x37, 0x64, 0x55, 0xC2, 0xF3, 0xA0, 0x91, - 0x47, 0x76, 0x25, 0x14, 0x83, 0xB2, 0xE1, 0xD0, - 0xFE, 0xCF, 0x9C, 0xAD, 0x3A, 0x0B, 0x58, 0x69, - 0x04, 0x35, 0x66, 0x57, 0xC0, 0xF1, 0xA2, 0x93, - 0xBD, 0x8C, 0xDF, 0xEE, 0x79, 0x48, 0x1B, 0x2A, - 0xC1, 0xF0, 0xA3, 0x92, 0x05, 0x34, 0x67, 0x56, - 0x78, 0x49, 0x1A, 0x2B, 0xBC, 0x8D, 0xDE, 0xEF, - 0x82, 0xB3, 0xE0, 0xD1, 0x46, 0x77, 0x24, 0x15, - 0x3B, 0x0A, 0x59, 0x68, 0xFF, 0xCE, 0x9D, 0xAC}; +PIString PIByteArray::toString(int base) const { + PIString ret; int sz = size_s(); - ushort ret = 0xFF; - for (int i = 0; i < sz; ++i) - ret = CRC8Table[at(i) ^ ret]; - return ret; -} - - -ushort PIByteArray::checksumCRC16() { - const ushort CRC16Table[256] = { - 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, - 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, - 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, - 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, - 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, - 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, - 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, - 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, - 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, - 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, - 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, - 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, - 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, - 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, - 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, - 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, - 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, - 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, - 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, - 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, - 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, - 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, - 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, - 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, - 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, - 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, - 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, - 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, - 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, - 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, - 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, - 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040}; - - int sz = size_s(); - uchar nTemp; - ushort ret = 0xFFFF; for (int i = 0; i < sz; ++i) { - nTemp = at(i) ^ ret; - ret >>= 8; - ret ^= CRC16Table[nTemp]; + if (i > 0) ret += " "; + if (base == 2) ret += "b"; + if (base == 8) ret += "0"; + if (base == 16) ret += "0x"; + ret += PIString::fromNumber(at(i), base); } return ret; } -uint PIByteArray::checksumCRC32() { - const uint CRC32Table[256] = { - 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, - 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, - 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, - 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, - 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, - 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, - 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, - 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, - 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, - 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, - 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, - 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, - 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, - 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, - 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, - 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, - 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, - 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, - 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, - 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, - 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, - 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, - 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, - 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, - 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, - 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, - 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, - 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, - 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, - 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, - 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, - 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D}; - - int sz = size_s(); - uchar nTemp; - uint ret = 0xFFFFFFFF; - for (int i = 0; i < sz; ++i) { - nTemp = at(i) ^ ret; - ret >>= 8; - ret ^= CRC32Table[nTemp]; +PIByteArray PIByteArray::fromString(PIString str) { + PIByteArray ret; + if (str.trim().isEmpty()) return ret; + str.replaceAll("\n", " ").replaceAll("\t", " ").replaceAll(" ", " "); + PIStringList bl(str.split(" ")); + bool ok(false); + piForeachC (PIString & b, bl) { + int bv = b.toInt(-1, &ok); + if (ok) ret << uchar(bv); } return ret; } diff --git a/pibytearray.h b/pibytearray.h index 7ecc1dcc..92e1acf7 100644 --- a/pibytearray.h +++ b/pibytearray.h @@ -30,27 +30,28 @@ #include "pibitarray.h" +class PIString; class PIByteArray; class PIHuffman { public: - PIVector compress(const PIVector & src); + PIDeque compress(const PIDeque & src); private: struct node { int freq; - PIVector word; + PIDeque word; PIBitArray path; node * parent; node * right; node * left; }; static int nodeCompare(const void * f, const void * s); - void calcFrequencies(const PIVector & src); + void calcFrequencies(const PIDeque & src); PIVector nodes; }; -class PIP_EXPORT PIByteArray: public PIVector +class PIP_EXPORT PIByteArray: public PIDeque { public: @@ -61,7 +62,7 @@ public: PIByteArray(const uint size) {resize(size);} //! Constructs byte array from data "data" and size "size" - PIByteArray(const void * data, const uint size) {for (uint i = 0; i < size; ++i) push_back(((uchar * )data)[i]);} + PIByteArray(const void * data, const uint size): PIDeque((const uchar*)data, size_t(size)) {/*for (uint i = 0; i < size; ++i) push_back(((uchar * )data)[i]);*/} //! Help struct to store/restore custom blocks of data to/from PIByteArray @@ -80,7 +81,7 @@ public: }; //! Return resized byte array - PIByteArray resized(int new_size) {PIByteArray tv(*this); tv.resize(new_size); return tv;} + PIByteArray resized(int new_size) const {PIByteArray tv(*this); tv.resize(new_size); return tv;} //! Convert data to Base 64 and return this byte array PIByteArray & convertToBase64(); @@ -89,10 +90,10 @@ public: PIByteArray & convertFromBase64(); //! Return converted to Base 64 data - PIByteArray toBase64() {PIByteArray ba(*this); ba.convertToBase64(); return ba;} + PIByteArray toBase64() const {PIByteArray ba(*this); ba.convertToBase64(); return ba;} //! Return converted from Base 64 data - PIByteArray fromBase64() {PIByteArray ba(*this); ba.convertFromBase64(); return ba;} + PIByteArray fromBase64() const {PIByteArray ba(*this); ba.convertFromBase64(); return ba;} PIByteArray & compressRLE(uchar threshold = 192); PIByteArray & decompressRLE(uchar threshold = 192); @@ -100,6 +101,8 @@ public: PIByteArray decompressedRLE(uchar threshold = 192) {PIByteArray ba(*this); ba.decompressRLE(threshold); return ba;} PIByteArray & compressHuffman() {*this = huffman.compress(*this); return *this;} + + PIString toString(int base = 16) const; //! Add to the end data "data" with size "size" PIByteArray & append(const void * data_, int size_) {uint ps = size(); enlarge(size_); memcpy(data(ps), data_, size_); return *this;} @@ -115,21 +118,14 @@ public: //PIByteArray & operator <<(const PIByteArray & v) {for (uint i = 0; i < v.size(); ++i) push_back(v[i]); return *this;} //! Returns plain 8-bit checksum - uchar checksumPlain8(); + uchar checksumPlain8() const; //! Returns plain 32-bit checksum - uint checksumPlain32(); + uint checksumPlain32() const; - //! Returns CRC 8-bit checksum - uchar checksumCRC8(); + void operator =(const PIDeque & d) {resize(d.size()); memcpy(data(), d.data(), d.size());} - //! Returns CRC 16-bit checksum - ushort checksumCRC16(); - - //! Returns CRC 32-bit checksum - uint checksumCRC32(); - - void operator =(const PIVector & d) {resize(d.size()); for (uint i = 0; i < size(); ++i) (*this)[i] = d[i];} + static PIByteArray fromString(PIString str); private: union base64HelpStruct { @@ -189,16 +185,19 @@ inline PIByteArray & operator <<(PIByteArray & s, const PIByteArray & v) {s << v //! \relatesalso PIByteArray \brief Store operator, see \ref PIByteArray_sec1 for details inline PIByteArray & operator <<(PIByteArray & s, const PIByteArray::RawData & v) {int os = s.size_s(); s.enlarge(v.s); if (v.s > 0) memcpy(s.data(os), v.d, v.s); return s;} //! \relatesalso PIByteArray \brief Store operator -template +template +inline PIByteArray & operator <<(PIByteArray & s, const PIPair & v) {s << v.first << v.second; return s;} +//! \relatesalso PIByteArray \brief Store operator +template inline PIByteArray & operator <<(PIByteArray & s, const PIVector & v) {s << v.size_s(); for (uint i = 0; i < v.size(); ++i) s << v[i]; return s;} //! \relatesalso PIByteArray \brief Store operator -template +template inline PIByteArray & operator <<(PIByteArray & s, const PIList & v) {s << v.size_s(); for (uint i = 0; i < v.size(); ++i) s << v[i]; return s;} //! \relatesalso PIByteArray \brief Store operator -template +template inline PIByteArray & operator <<(PIByteArray & s, const PIDeque & v) {s << v.size_s(); for (uint i = 0; i < v.size(); ++i) s << v[i]; return s;} #ifdef PIP_BYTEARRAY_STREAM_ANY_TYPE -template +template inline PIByteArray & operator <<(PIByteArray & s, const T & v) {PBA_OPERATOR_TO return s;} #endif @@ -232,19 +231,26 @@ inline PIByteArray & operator >>(PIByteArray & s, PIByteArray & v) {assert(s.siz //! \relatesalso PIByteArray \brief Restore operator, see \ref PIByteArray_sec1 for details inline PIByteArray & operator >>(PIByteArray & s, PIByteArray::RawData v) {assert(s.size_s() >= v.s); if (v.s > 0) memcpy(v.d, s.data(), v.s); s.remove(0, v.s); return s;} //! \relatesalso PIByteArray \brief Restore operator -template +template +inline PIByteArray & operator >>(PIByteArray & s, PIPair & v) {s >> v.first >> v.second; return s;} +//! \relatesalso PIByteArray \brief Restore operator +template inline PIByteArray & operator >>(PIByteArray & s, PIVector & v) {assert(s.size_s() >= 4); int sz; s >> sz; v.resize(sz); for (int i = 0; i < sz; ++i) s >> v[i]; return s;} //! \relatesalso PIByteArray \brief Restore operator -template +template inline PIByteArray & operator >>(PIByteArray & s, PIList & v) {assert(s.size_s() >= 4); int sz; s >> sz; v.resize(sz); for (int i = 0; i < sz; ++i) s >> v[i]; return s;} //! \relatesalso PIByteArray \brief Restore operator -template +template inline PIByteArray & operator >>(PIByteArray & s, PIDeque & v) {assert(s.size_s() >= 4); int sz; s >> sz; v.resize(sz); for (int i = 0; i < sz; ++i) s >> v[i]; return s;} +// //! \relatesalso PIByteArray \brief Restore operator +//template +//inline PIByteArray & operator >>(PIByteArray & s, PIMap & v) {assert(s.size_s() >= 4); int sz; s >> sz; v.resize(sz); for (int i = 0; i < sz; ++i) s >> v[i]; return s;} #ifdef PIP_BYTEARRAY_STREAM_ANY_TYPE -template +template inline PIByteArray & operator >>(PIByteArray & s, T & v) {assert(s.size() >= sizeof(v)); PBA_OPERATOR_FROM return s;} #endif + #undef PBA_OPERATOR_FROM //! \relatesalso PIByteArray \brief Byte arrays compare operator diff --git a/pichar.h b/pichar.h index 76eafe62..c0cd81ea 100644 --- a/pichar.h +++ b/pichar.h @@ -155,7 +155,7 @@ private: }; -__PIVECTOR_SIMPLE_FUNCTIONS__(PIChar) +__PICONTAINERS_SIMPLE_TYPE__(PIChar) //! Output operator to \c std::ostream inline std::ostream & operator <<(std::ostream & s, const PIChar & v) {s << v.toCharPtr(); return s;} diff --git a/picodeinfo.cpp b/picodeinfo.cpp index 1d3956e5..ef2801b3 100644 --- a/picodeinfo.cpp +++ b/picodeinfo.cpp @@ -20,6 +20,22 @@ #include "picodeinfo.h" +PIString PICodeInfo::EnumInfo::memberName(int value_) const { + piForeachC (PICodeInfo::EnumeratorInfo & e, members) + if (e.value == value_) + return e.name; + return PIString(); +} + + +int PICodeInfo::EnumInfo::memberValue(const PIString & name_) const { + piForeachC (PICodeInfo::EnumeratorInfo & e, members) + if (e.name == name_) + return e.value; + return -1; +} + + PIMap * PICodeInfo::classesInfo; PIMap * PICodeInfo::enumsInfo; diff --git a/picodeinfo.h b/picodeinfo.h index 08b6d2c2..c303941c 100644 --- a/picodeinfo.h +++ b/picodeinfo.h @@ -59,6 +59,8 @@ struct EnumeratorInfo { }; struct EnumInfo { + PIString memberName(int value) const; + int memberValue(const PIString & name) const; PIString name; PIVector members; }; diff --git a/piconfig.h b/piconfig.h index 43b7840e..951bbd6a 100644 --- a/piconfig.h +++ b/piconfig.h @@ -110,10 +110,10 @@ public: Entry * parent() const {return _parent;} //! Returns children count - int childCount() {return _children.size_s();} + int childCount() const {return _children.size_s();} //! Returns children as \a PIConfig::Branch - Branch & children() {_children.delim = delim; return _children;} + Branch & children() const {_children.delim = delim; return _children;} //! Returns child at index "index" Entry * child(const int index) const {return _children[index];} @@ -303,7 +303,7 @@ public: static Entry _empty; Entry * _parent; - Branch _children; + mutable Branch _children; PIString _tab; PIString _name; PIString _value; diff --git a/piconnection.cpp b/piconnection.cpp new file mode 100644 index 00000000..fcc3d2f3 --- /dev/null +++ b/piconnection.cpp @@ -0,0 +1,764 @@ +/* + PIP - Platform Independent Primitives + Complex I/O point + Copyright (C) 2014 Ivan Pelipenko peri4ko@gmail.com + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#include "piconnection.h" +#include "piconfig.h" + +/** \class PIConnection + * \brief Complex Input/Output point + * + * \section PIConnection_synopsis Synopsis + * %PIConnection provides abstract layer over physical devices, + * filtering and connecting data streams. Each %PIConnection + * works through Device Pool, so several %PIConnections can + * read from single physical device. General scheme: + * \image html piconnection.png + * + * \section PIConnection_pool Device pool concept + * Device pool is static object, single for each application, which + * contains unique devices. Each %PIConnection works with real devices + * through Device pool. Each device has assosiated thread for read + * and it can be started or stopped with %PIConnection functions + * \a startThreadedRead() and \a stopThreadedRead(). + * + * \section PIConnection_config Configuration + * You can create %PIConnection from config file section or configure + * it later with function \a configureFromConfig(). Devices describes + * with its full pathes, for details see \ref PIIODevice_sec7. Example: + * \image html piconnection_conf.png + * +*/ + + +PIVector PIConnection::_connections; + + +PIConnection::PIConnection(): PIObject() { + _connections << this; +} + + +PIConnection::PIConnection(const PIString & config, const PIString & name_): PIObject(name_) { + _connections << this; + configureFromConfig(config, name_); +} + + +PIConnection::~PIConnection() { + __device_pool__->unboundConnection(this); + removeAllFilters(); + _connections.removeAll(this); +} + + +bool PIConnection::configureFromConfig(const PIString & conf_path, const PIString & name_) { + PIConfig conf(conf_path, PIIODevice::ReadOnly); + if (!conf.isOpened()) return false; + __device_pool__->unboundConnection(this); + removeAllChannels(); + removeAllFilters(); + removeAllDevices(); + setName(name_); + PIConfig::Entry ce(conf.getValue(name_)); + PIConfig::Branch db(ce.getValue("device").children()), fb(ce.getValue("filter").children()), cb(ce.getValue("channel").children()); + PIStringList dev_list(ce.getValue("device").value()); + piForeachC (PIConfig::Entry * e, db) + dev_list << e->value(); + dev_list.removeStrings(""); + piForeachC (PIString & s, dev_list) { + PIString fn(s); + PIIODevice::DeviceMode dm = PIIODevice::ReadWrite; + if (fn.find("(") > 0 && fn.find(")") > 0) { + PIString dms(fn.right(fn.length() - fn.find("(")).takeRange("(", ")").trim().toLowerCase().removeAll(" ")); + //piCout << dms; + if (dms == "r" || dms == "ro" || dms == "read" || dms == "readonly") + dm = PIIODevice::ReadOnly; + if (dms == "w" || dms == "wo" || dms == "write" || dms == "writeonly") + dm = PIIODevice::WriteOnly; + fn.cutRight(fn.length() - fn.find("(") + 1).trim(); + } + //piCout << fn; + PIIODevice * dev = addDevice(fn, dm); + if (dev) dev->setName(name_ + ".device." + s); + } + piForeachC (PIConfig::Entry * e, fb) { + PIPacketExtractor::SplitMode sm = PIPacketExtractor::None; + PIString sms(e->getValue("splitMode").value()); + int smi = sms.toInt(); + if (smi >= 1 && smi <= 5) sm = (PIPacketExtractor::SplitMode)smi; + else { + sms = sms.trim().toLowerCase(); + if (sms.find("header") >= 0 && sms.find("footer") >= 0) + sm = PIPacketExtractor::HeaderAndFooter; + else { + if (sms.find("header") >= 0) + sm = PIPacketExtractor::Header; + else { + if (sms.find("footer") >= 0) + sm = PIPacketExtractor::Footer; + else { + if (sms.find("time") >= 0) + sm = PIPacketExtractor::Timeout; + else { + if (sms.find("size") >= 0) + sm = PIPacketExtractor::Size; + } + } + } + } + } + PIStringList devs(e->value()); + PIConfig::Branch db(e->getValue("device").children()); + piForeachC (PIConfig::Entry * e2, db) + devs << e2->value(); + devs.removeStrings(""); + if (devs.isEmpty()) continue; + PIPacketExtractor * pe = addFilter(e->name(), devs.front(), sm); + if (pe == 0) continue; + for (int i = 1; i < devs.size_s(); ++i) + addFilter(e->name(), devs[i], sm); + pe->setPayloadSize(e->getValue("payloadSize", pe->payloadSize())); + pe->setPacketSize(e->getValue("packetSize", pe->packetSize())); + pe->setTimeout(e->getValue("timeout", pe->timeout())); + pe->setHeader(PIByteArray::fromString(e->getValue("header", "").value())); + pe->setFooter(PIByteArray::fromString(e->getValue("footer", "").value())); + } + piForeachC (PIConfig::Entry * e, cb) { + PIString f(e->getValue("from").value()), t(e->getValue("to").value()); + addChannel(f, t); + } + return true; +} + + +PIString PIConnection::makeConfig() const { + PIString ret; + ret << "[" << name() << "]\n"; + PIVector devs(boundedDevices()); + int dn(0); + piForeachC (PIIODevice * d, devs) { + ret << "device." << dn << " = " << d->constructFullPath(); ++dn; + if (d->mode() == PIIODevice::ReadOnly) ret << " (ro)"; + if (d->mode() == PIIODevice::WriteOnly) ret << " (wo)"; + ret << "\n"; + } + piForeachC (PEPair & f, extractors) { + if (f.second == 0) continue; + if (f.second->extractor == 0) continue; + PIString prefix = "filter." + f.first; + for (int i = 0; i < f.second->devices.size_s(); ++i) + ret << prefix << ".device." << i << " = " << f.second->devices[i]->constructFullPath() << "\n"; + ret << prefix << ".splitMode = "; + switch (f.second->extractor->splitMode()) { + case PIPacketExtractor::None: ret << "none"; break; + case PIPacketExtractor::Header: ret << "header"; break; + case PIPacketExtractor::Footer: ret << "footer"; break; + case PIPacketExtractor::HeaderAndFooter: ret << "header & footer"; break; + case PIPacketExtractor::Size: ret << "size"; break; + case PIPacketExtractor::Timeout: ret << "timeout"; break; + } + ret << "\n"; + ret << prefix << ".payloadSize = " << f.second->extractor->payloadSize() << "\n"; + ret << prefix << ".packetSize = " << f.second->extractor->packetSize() << "\n"; + ret << prefix << ".timeout = " << f.second->extractor->timeout() << "\n"; + ret << prefix << ".header = " << f.second->extractor->header().toString() << "\n"; + ret << prefix << ".footer = " << f.second->extractor->footer().toString() << "\n"; + } + dn = 0; + piForeachC (CPair & c, channels_) { + piForeachC (PIIODevice * d, c.second) { + PIString prefix = "channel." + PIString::fromNumber(dn); ++dn; + ret << prefix << ".from = " << devPath(c.first) << "\n"; + ret << prefix << ".to = " << devPath(d) << "\n"; + } + } + ret << "[]\n"; + return ret; +} + + +PIIODevice * PIConnection::addDevice(const PIString & full_path, PIIODevice::DeviceMode mode, bool start) { + PIIODevice * dev = __device_pool__->addDevice(this, full_path, mode, start); + if (dev) { + dev->setName(name() + ".device." + full_path); + device_modes[dev] = mode; + } + return dev; +} + + +bool PIConnection::removeDevice(const PIString & full_path) { + PIIODevice * dev = __device_pool__->device(full_path); + if (dev == 0) return false; + device_modes.remove(dev); + piForeachC (PEPair & i, extractors) { + if (i.second == 0) continue; + i.second->devices.removeAll(dev); + } + bounded_extractors.remove(dev); + channels_.remove(dev); + for (PIMap >::iterator it = channels_.begin(); it != channels_.end(); ++it) + it.value().removeAll(dev); + return __device_pool__->removeDevice(this, full_path); +} + + +void PIConnection::removeAllDevices() { + PIVector bdevs(__device_pool__->boundedDevices(this)); + piForeach (PIIODevice * d, bdevs) { + channels_.remove(d); + for (PIMap >::iterator it = channels_.begin(); it != channels_.end(); ++it) + it.value().removeAll(d); + } + __device_pool__->unboundConnection(this); + device_modes.clear(); + bounded_extractors.clear(); + piForeachC (PEPair & i, extractors) { + if (i.second == 0) continue; + i.second->devices.clear(); + } +} + + +PIIODevice * PIConnection::device(const PIString & full_path) const { + DevicePool::DeviceData * dd = __device_pool__->devices.value(full_path); + if (dd == 0) return 0; + if (dd->dev == 0) return 0; + if (!dd->listeners.contains(const_cast(this))) return 0; + return dd->dev; +} + + +PIVector PIConnection::boundedDevices() const { + return __device_pool__->boundedDevices(this); +} + + +PIPacketExtractor * PIConnection::addFilter(const PIString & name_, const PIString & full_path, PIPacketExtractor::SplitMode mode) { + Extractor * e = extractors.value(name_); + PIIODevice * dev = __device_pool__->device(full_path); + if (dev == 0) { + piCoutObj << "\"addPacketExtractor\" error: no such device \"" << full_path << "\"!"; + return 0; + } + if (e == 0) { + e = new Extractor(); + extractors[name_] = e; + } + if (e->extractor == 0) { + e->extractor = new PIPacketExtractor(0, mode); + e->extractor->setName(name_); + e->extractor->setThreadedReadData(new PIPair(this, name_)); + e->extractor->setHeaderCheckSlot(filterValidateHeaderS); + e->extractor->setFooterCheckSlot(filterValidateFooterS); + e->extractor->setPayloadCheckSlot(filterValidatePayloadS); + CONNECT2(void, uchar * , int, e->extractor, packetReceived, this, packetExtractorReceived) + } + if (!e->devices.contains(dev)) { + bounded_extractors[dev] << e->extractor; + e->devices << dev; + } + return e->extractor; +} + + +PIPacketExtractor * PIConnection::addFilter(const PIString & name_, const PIIODevice * dev, PIPacketExtractor::SplitMode mode) { + if (dev == 0) return 0; + PIString fp; + if (dev->isPropertyExists("__fullPath__")) fp = dev->property("__fullPath__").toString(); + fp = dev->constructFullPath(); + return addFilter(name_, fp, mode); +} + + +bool PIConnection::removeFilter(const PIString & name_, const PIString & full_path) { + Extractor * p = extractors.value(name_); + if (p == 0) return false; + bool ret = false; + for (int i = 0; i < p->devices.size_s(); ++i) { + if (p->devices[i]->property("__fullPath__").toString() == full_path) { + bounded_extractors[p->devices[i]].removeAll(p->extractor); + p->devices.remove(i); + --i; + ret = true; + } + } + if (p->devices.isEmpty()) { + unboundExtractor(p->extractor); + delete p; + } + return ret; +} + + +bool PIConnection::removeFilter(const PIString & name, const PIIODevice * dev) { + if (dev == 0) return false; + return removeFilter(name, dev->property("__fullPath__").toString()); +} + + +bool PIConnection::removeFilter(const PIString & name_) { + Extractor * p = extractors.value(name_); + if (p == 0) return false; + unboundExtractor(p->extractor); + delete p; + return true; +} + + +void PIConnection::removeAllFilters() { + piForeachC (PEPair & i, extractors) { + if (i.second == 0) continue; + channels_.remove(i.second->extractor); + for (PIMap >::iterator it = channels_.begin(); it != channels_.end(); ++it) + it.value().removeAll(i.second->extractor); + delete i.second; + } + extractors.clear(); + bounded_extractors.clear(); +} + + +PIVector PIConnection::filters() const { + PIVector ret; + piForeachC (PEPair & i, extractors) + if (i.second != 0) + if (i.second->extractor != 0) ret << i.second->extractor; + return ret; +} + + +PIStringList PIConnection::filterNames() const { + PIStringList ret; + piForeachC (PEPair & i, extractors) + if (i.second != 0) + if (i.second->extractor != 0) ret << i.first; + return ret; +} + + +PIPacketExtractor * PIConnection::filter(const PIString & name) const { + piForeachC (PEPair & i, extractors) + if (i.second != 0) + if (i.second->extractor != 0 && i.first == name) + return i.second->extractor; + return 0; +} + + +PIVector PIConnection::filterBoundedDevices(const PIString & name_) const { + PIVector ret; + Extractor * p = extractors.value(name_); + if (p == 0) return ret; + return p->devices; +} + + +bool PIConnection::addChannel(const PIString & name0, const PIString & name1) { + //piCout << "addChannel" << name0 << name1; + if (name0.isEmpty() || name1.isEmpty()) return false; + PIIODevice * dev0 = device(name0), * dev1 = device(name1); + PIPacketExtractor * pe0(0), * pe1(0); + if (extractors.value(name0) != 0) pe0 = extractors.value(name0)->extractor; + if (extractors.value(name1) != 0) pe1 = extractors.value(name1)->extractor; + if (pe0 != 0) dev0 = pe0; + if (pe1 != 0) dev1 = pe1; + if (dev0 == 0 || dev1 == 0) { + if (dev0 == 0) piCoutObj << "\"addChannel\" error: no such device \"" << name0 << "\"!"; + if (dev1 == 0) piCoutObj << "\"addChannel\" error: no such device \"" << name1 << "\"!"; + return false; + } + if (!channels_[dev0].contains(dev1)) + channels_[dev0] << dev1; + return true; +} + + +bool PIConnection::removeChannel(const PIString & name0, const PIString & name1) { + PIIODevice * dev0 = device(name0), * dev1 = device(name1); + PIPacketExtractor * pe0(0), * pe1(0); + if (extractors.value(name0) != 0) pe0 = extractors.value(name0)->extractor; + if (extractors.value(name1) != 0) pe1 = extractors.value(name1)->extractor; + if (pe0 != 0) dev0 = pe0; + if (pe1 != 0) dev1 = pe1; + if (dev0 == 0 || dev1 == 0) return false; + channels_[dev0].removeAll(dev1); + return true; +} + + +bool PIConnection::removeChannel(const PIString & name0) { + PIIODevice * dev0 = device(name0); + PIPacketExtractor * pe0(0); + if (extractors.value(name0) != 0) pe0 = extractors.value(name0)->extractor; + if (pe0 != 0) dev0 = pe0; + if (dev0 == 0) return false; + channels_.remove(dev0); + for (PIMap >::iterator it = channels_.begin(); it != channels_.end(); ++it) + it.value().removeAll(dev0); + return true; +} + + +void PIConnection::removeAllChannels() { + channels_.clear(); +} + + +PIString PIConnection::devPath(const PIIODevice * d) const { + if (d == 0) return PIString(); + if (strcmp(d->className(), "PIPacketExtractor") == 0) return d->name(); + return d->constructFullPath(); +} + + +PIString PIConnection::devFPath(const PIIODevice * d) const { + if (d == 0) return PIString(); + if (d->isPropertyExists("__fullPath__")) return d->property("__fullPath__").toString(); + return d->name(); +} + + +PIVector > PIConnection::channels() const { + PIVector > ret; + piForeachC (CPair & i, channels_) { + PIString fp0(devFPath(i.first)); + piForeachC (PIIODevice * d, i.second) + ret << PIPair(fp0, devFPath(d)); + } + return ret; +} + + +void PIConnection::startThreadedRead(const PIString & full_path) { + DevicePool::DeviceData * dd = __device_pool__->devices.value(full_path, 0); + if (dd == 0) return; + if (dd->dev == 0) return; + if (dd->started || dd->dev->mode() == PIIODevice::WriteOnly) return; + dd->rthread->start(); + dd->started = true; +} + + +void PIConnection::startAllThreadedReads() { + piForeachC (DevicePool::DDPair & d, __device_pool__->devices) + startThreadedRead(d.first); +} + + +void PIConnection::stopThreadedRead(const PIString & full_path) { + DevicePool::DeviceData * dd = __device_pool__->devices.value(full_path, 0); + if (dd == 0) return; + if (dd->dev == 0) return; + if (!dd->started || dd->dev->mode() == PIIODevice::WriteOnly) return; + dd->rthread->stop(); + dd->started = false; +} + + +void PIConnection::stopAllThreadedReads() { + piForeachC (DevicePool::DDPair & d, __device_pool__->devices) + stopThreadedRead(d.first); +} + + +int PIConnection::write(const PIString & full_path, const PIByteArray & data) { + PIIODevice * dev = __device_pool__->device(full_path); + if (dev == 0) { + piCoutObj << "Null Device!"; + return -1; + } + if (!dev->canWrite()) { + piCoutObj << "Device \"" << full_path << "\" can`t write!"; + return -1; + } + return dev->write(data); +} + + +PIVector< PIConnection * > PIConnection::allConnections() { + return _connections; +} + + +PIVector< PIIODevice * > PIConnection::allDevices() { + return __device_pool__->boundedDevices(); +} + + + +PIIODevice * PIConnection::DevicePool::addDevice(PIConnection * parent, const PIString & fp, PIIODevice::DeviceMode mode, bool start) { + DeviceData * dd = devices[fp]; + int pmode(0); + bool need_start = false; + if (dd == 0) { + dd = new DeviceData(); + devices[fp] = dd; + } + if (dd->dev == 0) { + //piCout << "new device" << fp; + dd->dev = PIIODevice::createFromFullPath(fp); + if (dd->dev == 0) { + piCoutObj << "Error: can`t create device \"" << fp << "\"!"; //:" << errorString(); + return 0; + } + dd->dev->setProperty("__fullPath__", fp); + } else + pmode = dd->dev->mode(); + if (!dd->listeners.contains(parent)) + dd->listeners << parent; + if (pmode == mode || pmode == PIIODevice::ReadWrite) + return dd->dev; + if ((mode & PIIODevice::ReadOnly) > 0) { + if (dd->rthread != 0) { + delete dd->rthread; + dd->rthread = 0; + dd->started = false; + } + dd->rthread = new PIThread(dd, threadReadDP); + need_start = true; + pmode |= PIIODevice::ReadOnly; + } + if ((mode & PIIODevice::WriteOnly) > 0) + pmode |= PIIODevice::WriteOnly; + dd->dev->close(); + dd->dev->open((PIIODevice::DeviceMode)pmode); + if (need_start && start) { + dd->rthread->start(); + dd->started = true; + } + return dd->dev; +} + + +bool PIConnection::DevicePool::removeDevice(PIConnection * parent, const PIString & fp) { + DeviceData * dd = devices.value(fp); + if (dd == 0) + return false; + if (dd->dev == 0) + return false; + bool ok = dd->listeners.contains(parent); + dd->listeners.removeAll(parent); + if (dd->listeners.isEmpty()) { + delete dd; + devices.remove(fp); + } + return ok; +} + + +void PIConnection::DevicePool::unboundConnection(PIConnection * parent) { + PIStringList rem; + piForeachC (DDPair & i, devices) { + if (i.second == 0) { + rem << i.first; + continue; + } + i.second->listeners.removeAll(parent); + if (i.second->listeners.isEmpty()) + rem << i.first; + } + piForeachC (PIString & i, rem) { + DeviceData * dd = devices.value(i); + if (dd == 0) + continue; + delete dd; + devices.remove(i); + } +} + + +PIIODevice * PIConnection::DevicePool::device(const PIString & fp) const { + DeviceData * dd = devices.value(fp); + if (dd == 0) return 0; + return dd->dev; +} + + +PIVector PIConnection::DevicePool::boundedConnections() const { + PIVector ret; + piForeachC (DDPair & i, devices) { + if (i.second == 0) + continue; + ret << i.second->listeners; + } + for (int i = 0; i < ret.size_s(); ++i) + for (int j = i + 1; j < ret.size_s(); ++j) + if (ret[i] == ret[j]) { + ret.remove(j); + --j; + } + return ret; +} + + +PIVector< PIIODevice * > PIConnection::DevicePool::boundedDevices() const { + PIVector ret; + piForeachC (DDPair & i, devices) { + if (i.second == 0) continue; + if (i.second->dev == 0) continue; + ret << i.second->dev; + } + return ret; +} + + +PIVector PIConnection::DevicePool::boundedDevices(const PIConnection * parent) const { + PIVector ret; + piForeachC (DDPair & i, devices) { + if (i.second == 0) continue; + if (i.second->dev == 0) continue; + if (i.second->listeners.contains(const_cast(parent))) + ret << i.second->dev; + } + return ret; +} + + +PIConnection::DevicePool::DeviceData::~DeviceData() { + if (rthread != 0) { + rthread->stop(); + delete rthread; + rthread = 0; + } + if (dev != 0) { + delete dev; + dev = 0; + } +} + + +void PIConnection::DevicePool::threadReadDP(void * ddp) { + DeviceData * dd((DeviceData * )ddp); + if (dd->dev == 0) {piMSleep(100); return;} + PIByteArray ba; + ba = dd->dev->read(dd->dev->threadedReadBufferSize()); + if (ba.isEmpty()) {piMSleep(10); return;} + //piCout << "Readed from" << dd->dev->path() << Hex << ba; + __device_pool__->deviceReaded(dd, ba); +} + + +void PIConnection::DevicePool::deviceReaded(PIConnection::DevicePool::DeviceData * dd, const PIByteArray & data) { + PIString from = dd->dev->property("__fullPath__").toString(); + piForeach (PIConnection * ld, dd->listeners) + ld->rawReceived(dd->dev, from, data); +} + + +bool PIConnection::filterValidateHeaderS(void * c, uchar * src, uchar * rec, int size) { + PIPair * p((PIPair * )c); + return p->first->filterValidateHeader(p->second, src, rec, size); +} + + +bool PIConnection::filterValidateFooterS(void * c, uchar * src, uchar * rec, int size) { + PIPair * p((PIPair * )c); + return p->first->filterValidateFooter(p->second, src, rec, size); +} + + +bool PIConnection::filterValidatePayloadS(void * c, uchar * rec, int size) { + PIPair * p((PIPair * )c); + return p->first->filterValidatePayload(p->second, rec, size); +} + + +void PIConnection::rawReceived(PIIODevice * dev, const PIString & from, const PIByteArray & data) { + dataReceived(from, data); + dataReceivedEvent(from, data); + PIVector be(bounded_extractors.value(dev)); + //piCout << be; + piForeach (PIPacketExtractor * i, be) + i->threadedRead(const_cast(data.data()), data.size_s()); + PIVector chd(channels_.value(dev)); + piForeach (PIIODevice * d, chd) + d->write(data); +} + + +bool PIConnection::filterValidateHeader(const PIString & filter_name, uchar * src, uchar * rec, int size) { + for (int i = 0; i < size; ++i) + if (src[i] != rec[i]) + return false; + return true; +} + + +bool PIConnection::filterValidateFooter(const PIString & filter_name, uchar * src, uchar * rec, int size) { + for (int i = 0; i < size; ++i) + if (src[i] != rec[i]) + return false; + return true; +} + + +bool PIConnection::filterValidatePayload(const PIString & filter_name, uchar * rec, int size) { + return true; +} + + +PIConnection::Extractor::~Extractor() { + if (extractor != 0) { + if (extractor->threadedReadData() != 0) + delete (PIPair * )(extractor->threadedReadData()); + delete extractor; + extractor = 0; + } +} + + +void PIConnection::unboundExtractor(PIPacketExtractor * pe) { + if (pe == 0) return; + channels_.remove(pe); + for (PIMap >::iterator it = channels_.begin(); it != channels_.end(); ++it) + it.value().removeAll(pe); + PIVector k = bounded_extractors.keys(); + piForeach (PIIODevice * i, k) { + PIVector & be(bounded_extractors[i]); + be.removeAll(pe); + if (be.isEmpty()) + bounded_extractors.remove(i); + } + extractors.remove(pe->name()); +} + + +void PIConnection::packetExtractorReceived(uchar * data, int size) { + PIString from(emitter() == 0 ? "" : emitter()->name()); + packetReceived(from, PIByteArray(data, size)); + packetReceivedEvent(from, PIByteArray(data, size)); + PIIODevice * cd = (PIIODevice * )emitter(); + if (cd == 0) return; + PIVector chd(channels_.value(cd)); + piForeach (PIIODevice * d, chd) + d->write(data, size); +} + + + +PIConnection::DevicePool * __device_pool__; + +bool __DevicePoolContainer__::inited_(false); + +__DevicePoolContainer__::__DevicePoolContainer__() { + if (inited_) return; + inited_ = true; + __device_pool__ = new PIConnection::DevicePool(); +} diff --git a/piconnection.h b/piconnection.h new file mode 100644 index 00000000..c00f85da --- /dev/null +++ b/piconnection.h @@ -0,0 +1,291 @@ +/*! \file piconnection.h + * \brief Complex I/O point +*/ +/* + PIP - Platform Independent Primitives + Complex I/O point + Copyright (C) 2014 Ivan Pelipenko peri4ko@gmail.com + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef PICONNECTION_H +#define PICONNECTION_H + +#include "pipacketextractor.h" + + +class PIP_EXPORT PIConnection: public PIObject +{ + PIOBJECT(PIConnection) +public: + + //! Constructs an empty connection + PIConnection(); + + //! Constructs connection and configure it from config file "config" from section "name" + PIConnection(const PIString & config, const PIString & name); + + ~PIConnection(); + + + /*! \brief Configure connection from config file "config" from section "name". Returns if configuration was successful + * \details \b Warning: all devices, filters and channels removed before configure! */ + bool configureFromConfig(const PIString & config, const PIString & name); + + //! Returns config file section of current connection configuration + PIString makeConfig() const; + + + /*! \brief Add device with full path "full_path", open mode "mode" to Device pool and connection + * \details Returns pointer to device or null if device can not be created. If "start" is true, + * read thread is started immediately. Else, you can start read thread with functions \a startThreadedRead() + * or \a startAllThreadedReads(). By default, read thread doesn`t start */ + PIIODevice * addDevice(const PIString & full_path, PIIODevice::DeviceMode mode = PIIODevice::ReadWrite, bool start = false); + + /*! \brief Remove device with full path "full_path" from connection + * \details Returns if device was removed. If there is no connection bounded to this device, + * it will be removed from Device pool */ + bool removeDevice(const PIString & full_path); + + /*! \brief Remove all device from connection + * \details If there is no connection bounded to there devices, they removed from Device pool */ + void removeAllDevices(); + + //! Returns device with full path "full_path" or null if there is no such device + PIIODevice * device(const PIString & full_path) const; + + //! Returns all devices bounded to this connection + PIVector boundedDevices() const; + + + /*! \brief Add filter with name "name" to device with full path "full_path" + * \details If there is no filter with name "name", connection create new with split mode "mode" and bound + * to it device "full_path". If filter with name "name" already exists, device "full_path" add to this filter. + * \b Attention! "mode" is altual olny if new filter was created! + * This function returns PIPacketExtractor * assosiated with this filter */ + PIPacketExtractor * addFilter(const PIString & name, const PIString & full_path, PIPacketExtractor::SplitMode mode = PIPacketExtractor::None); + + //! Add filter with name "name" to device "dev" + PIPacketExtractor * addFilter(const PIString & name, const PIIODevice * dev, PIPacketExtractor::SplitMode mode = PIPacketExtractor::None); + + /*! \brief Remove from filter with name "name" device with full path "full_path" + * \details If there is no devices bounded to this filter, it will be removed. Returns + * if device was removed */ + bool removeFilter(const PIString & name, const PIString & full_path); + + //! Remove from filter with name "name" device "dev" + bool removeFilter(const PIString & name, const PIIODevice * dev); + + //! Remove filter with name "name". Returns if filter was removed + bool removeFilter(const PIString & name); + + //! Remove all filters from connection + void removeAllFilters(); + + + //! Returns all filters of connection + PIVector filters() const; + + //! Returns all filter names of connection + PIStringList filterNames() const; + + //! Returns PIPacketExtractor * assosiated with filter "name" or null if there is no such filter + PIPacketExtractor * filter(const PIString & name) const; + + //! Returns all devices bounded to filter "name" + PIVector filterBoundedDevices(const PIString & name) const; + + + /*! \brief Add to connection channel from "name_from" to "name_to" + * \details "name_from" and "name_to" can be full pathes of devices or filter names. + * Returns \b false if there if no such device or filter, else create channel and returns \b true */ + bool addChannel(const PIString & name_from, const PIString & name_to); + + //! Add to connection channel from "name_from" to "dev_to" + bool addChannel(const PIString & name_from, const PIIODevice * dev_to) {return addChannel(name_from, devFPath(dev_to));} + + //! Add to connection channel from "dev_from" to "name_to" + bool addChannel(const PIIODevice * dev_from, const PIString & name_to) {return addChannel(devFPath(dev_from), name_to);} + + //! Add to connection channel from "dev_from" to "dev_to" + bool addChannel(const PIIODevice * dev_from, const PIIODevice * dev_to) {return addChannel(devFPath(dev_from), devFPath(dev_to));} + + /*! \brief Remove from connection channel from "name_from" to "name_to" + * \details "name_from" and "name_to" can be full pathes of devices or filter names. + * Returns \b false if there if no such device or filter, else remove channel and returns \b true */ + bool removeChannel(const PIString & name_from, const PIString & name_to); + + //! Remove from connection channel from "name_from" to "dev_to" + bool removeChannel(const PIString & name_from, const PIIODevice * dev_to) {return removeChannel(name_from, devFPath(dev_to));} + + //! Remove from connection channel from "dev_from" to "name_to" + bool removeChannel(const PIIODevice * dev_from, const PIString & name_to) {return removeChannel(devFPath(dev_from), name_to);} + + //! Remove from connection channel from "dev_from" to "dev_to" + bool removeChannel(const PIIODevice * dev_from, const PIIODevice * dev_to) {return removeChannel(devFPath(dev_from), devFPath(dev_to));} + + /*! \brief Remove from connection all channels from "name_from" + * \details "name_from" can be full path of device or filter name. + * Returns \b false if there if no such device or filter, else remove channels and returns \b true */ + bool removeChannel(const PIString & name_from); + + //! Remove from connection all channels from "dev_from" + bool removeChannel(const PIIODevice * dev_from) {return removeChannel(devFPath(dev_from));} + + //! Remove from connection all channels + void removeAllChannels(); + + //! Returns all channels of this connection as full pathes or filter names pair array (from, to) + PIVector > channels() const; + + + //! Start read thread of device with full path "full_path" + void startThreadedRead(const PIString & full_path); + + //! Start read thread of device "dev" + void startThreadedRead(const PIIODevice * dev) {startThreadedRead(devFPath(dev));} + + //! Start read threads of all Device pool device + void startAllThreadedReads(); + + //! Stop read thread of device with full path "full_path" + void stopThreadedRead(const PIString & full_path); + + //! Stop read thread of device "dev" + void stopThreadedRead(const PIIODevice * dev) {stopThreadedRead(devFPath(dev));} + + //! Stop read threads of all Device pool device + void stopAllThreadedReads(); + + + //! Returns if there is no devices in this connection + bool isEmpty() const {return device_modes.isEmpty();} + + + //! Write data "data" to device with full path "full_path" and returns result of \a write() function of device + int write(const PIString & full_path, const PIByteArray & data); + + + //! Returns all connections in application + static PIVector allConnections(); + + //! Returns all devices in Device pool + static PIVector allDevices(); + + class DevicePool: public PIObject { + PIOBJECT(DevicePool) + friend class PIConnection; + public: + DevicePool(): PIObject("PIConnection::DevicePool") {} + + PIIODevice * addDevice(PIConnection * parent, const PIString & fp, PIIODevice::DeviceMode mode = PIIODevice::ReadWrite, bool start = true); + bool removeDevice(PIConnection * parent, const PIString & fp); + void unboundConnection(PIConnection * parent); + PIIODevice * device(const PIString & fp) const; + PIVector boundedConnections() const; + PIVector boundedDevices() const; + PIVector boundedDevices(const PIConnection * parent) const; + + protected: + struct DeviceData { + DeviceData(): dev(0), rthread(0), started(false) {} + ~DeviceData(); + PIIODevice * dev; + PIThread * rthread; + bool started; + PIVector listeners; + }; + + static void threadReadDP(void * ddp); + void deviceReaded(DeviceData * dd, const PIByteArray & data); + + typedef PIMap::value_type DDPair; + PIMap devices; + }; + + EVENT2(dataReceivedEvent, const PIString &, from, const PIByteArray &, data) + EVENT2(packetReceivedEvent, const PIString &, from, const PIByteArray &, data) + +//! \events +//! \{ + + //! \fn void dataReceivedEvent(const PIString & from, const PIByteArray & data) + //! \brief Raise on data received from device with full path "from" + + //! \fn void packetReceivedEvent(const PIString & from, const PIByteArray & data) + //! \brief Raise on packet received from filter with name "from" + +//! \} + +protected: + + //! Executes on data received from device with full path "from" + virtual void dataReceived(const PIString & from, const PIByteArray & data) {} + + //! Executes on packet received from filter with name "from" + virtual void packetReceived(const PIString & from, const PIByteArray & data) {} + + //! Validate header "rec" with source header "src" and size "size", executes from filter "filter_name" + virtual bool filterValidateHeader(const PIString & filter_name, uchar * src, uchar * rec, int size); + + //! Validate footer "rec" with source footer "src" and size "size", executes from filter "filter_name" + virtual bool filterValidateFooter(const PIString & filter_name, uchar * src, uchar * rec, int size); + + //! Validate payload "rec" with size "size", executes from filter "filter_name" + virtual bool filterValidatePayload(const PIString & filter_name, uchar * rec, int size); + +private: + static bool filterValidateHeaderS(void * c, uchar * src, uchar * rec, int size); + static bool filterValidateFooterS(void * c, uchar * src, uchar * rec, int size); + static bool filterValidatePayloadS(void * c, uchar * rec, int size); + void rawReceived(PIIODevice * dev, const PIString & from, const PIByteArray & data); + void unboundExtractor(PIPacketExtractor * pe); + EVENT_HANDLER2(void, packetExtractorReceived, uchar * , data, int, size); + + PIString devPath(const PIIODevice * d) const; + PIString devFPath(const PIIODevice * d) const; + + struct Extractor { + Extractor(): extractor(0) {} + ~Extractor(); + PIPacketExtractor * extractor; + PIVector devices; + }; + + typedef PIMap::value_type PEPair; + typedef PIMap >::value_type BEPair; + typedef PIMap >::value_type CPair; + PIMap extractors; + PIMap device_modes; + PIMap > bounded_extractors; + PIMap > channels_; + + static PIVector _connections; + +}; + + +extern PIConnection::DevicePool * __device_pool__; + +class __DevicePoolContainer__ { +public: + __DevicePoolContainer__(); + static bool inited_; +}; + +static __DevicePoolContainer__ __device_pool_container__; + + +#endif // PICONNECTION_H diff --git a/piconsole.cpp b/piconsole.cpp index 7f56b6d8..b5526dae 100644 --- a/piconsole.cpp +++ b/piconsole.cpp @@ -692,7 +692,7 @@ void PIConsole::addVariable(const PIString & name, const PISystemMonitor * ptr, addVariable("priority", &(ptr->statistic().priority), col, format); addVariable("memory physical", &(ptr->statistic().physical_memsize_readable), col, format); addVariable("memory shared", &(ptr->statistic().share_memsize_readable), col, format); - addVariable("cpu load", &(ptr->statistic().cpu_load_system), col, format); + addVariable("cpu load", &(ptr->statistic().cpu_load_user), col, format); } void PIConsole::addBitVariable(const PIString & name, const void * ptr, int fromBit, int bitCount, int col, PIFlags format) { vid++; tv.id = vid; tv.size = sizeof(ullong); tv.name = name; tv.bitFrom = fromBit; tv.bitCount = bitCount; tv.type = 14; tv.ptr = ptr; tv.format = format; @@ -812,8 +812,8 @@ void PIConsole::listenServers() { stopPeer(); server_mode = false; server_name.clear(); - srand(currentSystemTime().nanoseconds); - peer = new PIPeer("_rcc_:" + currentDateTime().toString("hhmmssddMMyy_") + PIString::fromNumber(rand())); + srand(PISystemTime::current().nanoseconds); + peer = new PIPeer("_rcc_:" + PIDateTime::current().toString("hhmmssddMMyy_") + PIString::fromNumber(rand())); CONNECT2(void, const PIString & , const PIByteArray &, peer, dataReceivedEvent, this, peerReceived); peer_timer.start(100.); } diff --git a/picontainers.h b/picontainers.h index a68d404f..2ecb6e8c 100644 --- a/picontainers.h +++ b/picontainers.h @@ -26,7 +26,7 @@ #ifndef PICONTAINERS_H #define PICONTAINERS_H -#include "pivector.h" +#include "piincludes.h" template class PIP_EXPORT PIPair { @@ -47,8 +47,10 @@ inline std::ostream & operator <<(std::ostream & s, const PIPair & template inline PICout operator <<(PICout s, const PIPair & v) {s.space(); s.setControl(0, true); s << "(" << v.first << ", " << v.second << ")"; s.restoreControl(); return s;} +#include "pivector.h" #include "pistack.h" #include "piqueue.h" +#include "pideque.h" #include "pimap.h" #ifdef DOXYGEN @@ -295,25 +297,28 @@ public: }; +#ifndef PIP_CONTAINERS_STL -template > -class PIP_EXPORT PIDeque: public deque { - typedef PIDeque _CDeque; - typedef deque _stlc; -public: - PIDeque() {piMonitor.containers++;} - PIDeque(const Type & value) {piMonitor.containers++; _stlc::resize(1, value);} - PIDeque(const Type & v0, const Type & v1) {piMonitor.containers++; _stlc::push_back(v0); _stlc::push_back(v1);} - PIDeque(const Type & v0, const Type & v1, const Type & v2) {piMonitor.containers++; _stlc::push_back(v0); _stlc::push_back(v1); _stlc::push_back(v2);} - PIDeque(const Type & v0, const Type & v1, const Type & v2, const Type & v3) {piMonitor.containers++; _stlc::push_back(v0); _stlc::push_back(v1); _stlc::push_back(v2); _stlc::push_back(v3);} - ~PIDeque() {piMonitor.containers--;} - int size_s() const {return static_cast(_stlc::size());} - bool isEmpty() const {return _stlc::empty();} - bool has(const Type & t) const {for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); ++i) if (t == *i) return true; return false;} - int etries(const Type & t) const {int ec = 0; for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); ++i) if (t == *i) ++ec; return ec;} - _CDeque & operator <<(const Type & t) {_CDeque::push_back(t); return *this;} - PIVector toVector() {PIVector v; for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); ++i) v << *i; return v;} -}; +# define __PICONTAINERS_SIMPLE_TYPE__(T) \ +__PIDEQUE_SIMPLE_TYPE__(T)\ +__PIVECTOR_SIMPLE_TYPE__(T) + +__PICONTAINERS_SIMPLE_TYPE__(bool) +__PICONTAINERS_SIMPLE_TYPE__(char) +__PICONTAINERS_SIMPLE_TYPE__(uchar) +__PICONTAINERS_SIMPLE_TYPE__(short) +__PICONTAINERS_SIMPLE_TYPE__(ushort) +__PICONTAINERS_SIMPLE_TYPE__(int) +__PICONTAINERS_SIMPLE_TYPE__(uint) +__PICONTAINERS_SIMPLE_TYPE__(long) +__PICONTAINERS_SIMPLE_TYPE__(ulong) +__PICONTAINERS_SIMPLE_TYPE__(llong) +__PICONTAINERS_SIMPLE_TYPE__(ullong) +__PICONTAINERS_SIMPLE_TYPE__(float) +__PICONTAINERS_SIMPLE_TYPE__(double) +__PICONTAINERS_SIMPLE_TYPE__(ldouble) + +#endif #endif // PICONTAINERS_H diff --git a/pideque.h b/pideque.h new file mode 100644 index 00000000..074a48a3 --- /dev/null +++ b/pideque.h @@ -0,0 +1,477 @@ +/*! \file pideque.h + * \brief Dynamic array of any type + * + * This file declares PIDeque +*/ +/* + PIP - Platform Independent Primitives + Dynamic array of any type + Copyright (C) 2014 Ivan Pelipenko peri4ko@gmail.com + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifndef PIDEQUE_H +#define PIDEQUE_H + +#include "piincludes.h" + + +#if !defined(PIP_CONTAINERS_STL) || defined(DOXYGEN) + + +template +class PIDeque { +public: + PIDeque(): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) { + //printf("new vector 1 %p (%s) ... !{\n", this, typeid(T).name()); + //printf("(s=%d, d=%p) }!\n", int(pid_size), pid_data); + } + PIDeque(const PIDeque & other): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) { + //printf("new vector 2 %p (%s) ... !{\n", this, typeid(T).name()); + alloc(other.pid_size, true); + newT(pid_data + pid_start, other.pid_data + other.pid_start, pid_size); + //printf("(s=%d, d=%p) }!\n", int(pid_size), pid_data); + } + PIDeque(const T * data, size_t size): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) { + //printf("new vector 2 %p (%s) ... !{\n", this, typeid(T).name()); + alloc(size, true); + newT(pid_data + pid_start, data, pid_size); + //printf("(s=%d, d=%p) }!\n", int(pid_size), pid_data); + } + PIDeque(size_t pid_size, const T & f = T()): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) { + //printf("new vector 3 %p (%s) ... !{\n", this, typeid(T).name()); + resize(pid_size, f); + //printf("(s=%d, d=%p) }!\n", int(pid_size), pid_data); + } + ~PIDeque() { + //printf("delete deque %p (%s) (s=%d, rs=%d, st=%d, d=%p) ... ~{\n", this, typeid(T).name(), int(pid_size), int(pid_rsize), int(pid_start), pid_data); + deleteT(pid_data + pid_start, pid_size); + dealloc(); + //deleteRaw(pid_tdata); + _reset(); + //printf("}~\n"); + } + + PIDeque & operator =(const PIDeque & other) { + if (this == &other) return *this; + deleteT(pid_data + pid_start, pid_size); + alloc(other.pid_size, true); + newT(pid_data + pid_start, other.pid_data + other.pid_start, pid_size); + return *this; + } + + typedef T value_type; + + class iterator { + friend class PIDeque; + private: + iterator(PIDeque * v, size_t p): parent(v), pos(p) {} + PIDeque * parent; + size_t pos; + public: + iterator(): parent(0) {} + T & operator *() {return (*parent)[pos];} + const T & operator *() const {return (*parent)[pos];} + void operator ++() {++pos;} + void operator ++(int) {++pos;} + void operator --() {--pos;} + void operator --(int) {--pos;} + bool operator ==(const iterator & it) const {return (pos == it.pos);} + bool operator !=(const iterator & it) const {return (pos != it.pos);} + }; + + class const_iterator { + friend class PIDeque; + private: + const_iterator(const PIDeque * v, size_t p): parent(v), pos(p) {} + const PIDeque * parent; + size_t pos; + public: + const_iterator(): parent(0) {} + //T & operator *() {return (*parent)[pos];} + const T & operator *() const {return (*parent)[pos];} + void operator ++() {++pos;} + void operator ++(int) {++pos;} + void operator --() {--pos;} + void operator --(int) {--pos;} + bool operator ==(const const_iterator & it) const {return (pos == it.pos);} + bool operator !=(const const_iterator & it) const {return (pos != it.pos);} + }; + + class reverse_iterator { + friend class PIDeque; + private: + reverse_iterator(PIDeque * v, size_t p): parent(v), pos(p) {} + PIDeque * parent; + size_t pos; + public: + reverse_iterator(): parent(0) {} + T & operator *() {return (*parent)[pos];} + const T & operator *() const {return (*parent)[pos];} + void operator ++() {--pos;} + void operator ++(int) {--pos;} + void operator --() {++pos;} + void operator --(int) {++pos;} + bool operator ==(const reverse_iterator & it) const {return (pos == it.pos);} + bool operator !=(const reverse_iterator & it) const {return (pos != it.pos);} + }; + + class const_reverse_iterator { + friend class PIDeque; + private: + const_reverse_iterator(const PIDeque * v, size_t p): parent(v), pos(p) {} + const PIDeque * parent; + size_t pos; + public: + const_reverse_iterator(): parent(0) {} + //T & operator *() {return (*parent)[pos];} + const T & operator *() const {return (*parent)[pos];} + void operator ++() {--pos;} + void operator ++(int) {--pos;} + void operator --() {++pos;} + void operator --(int) {++pos;} + bool operator ==(const const_reverse_iterator & it) const {return (pos == it.pos);} + bool operator !=(const const_reverse_iterator & it) const {return (pos != it.pos);} + }; + + iterator begin() {return iterator(this, 0);} + iterator end() {return iterator(this, pid_size);} + const_iterator begin() const {return const_iterator(this, 0);} + const_iterator end() const {return const_iterator(this, pid_size);} + reverse_iterator rbegin() {return reverse_iterator(this, pid_size - 1);} + reverse_iterator rend() {return reverse_iterator(this, -1);} + const_reverse_iterator rbegin() const {return const_reverse_iterator(this, pid_size - 1);} + const_reverse_iterator rend() const {return const_reverse_iterator(this, -1);} + + size_t size() const {return pid_size;} + ssize_t size_s() const {return pid_size;} + size_t length() const {return pid_size;} + size_t capacity() const {return pid_rsize;} + bool isEmpty() const {return (pid_size == 0);} + + T & operator [](size_t index) {return pid_data[pid_start + index];} + T & at(size_t index) {return pid_data[pid_start + index];} + const T & operator [](size_t index) const {return pid_data[pid_start + index];} + const T & at(size_t index) const {return pid_data[pid_start + index];} + T & back() {return pid_data[pid_start + pid_size - 1];} + const T & back() const {return pid_data[pid_start + pid_size - 1];} + T & front() {return pid_data[pid_start];} + const T & front() const {return pid_data[pid_start];} + bool operator ==(const PIDeque & t) const {if (pid_size != t.pid_size) return false; for (size_t i = 0; i < pid_size; ++i) if (t[i] != pid_data[pid_start + i]) return false; return true;} + bool operator !=(const PIDeque & t) const {if (pid_size != t.pid_size) return true; for (size_t i = 0; i < pid_size; ++i) if (t[i] != pid_data[pid_start + i]) return true; return false;} + bool contains(const T & v) const {for (size_t i = pid_start; i < pid_start + pid_size; ++i) if (v == pid_data[i]) return true; return false;} + int etries(const T & v) const {int ec = 0; for (size_t i = pid_start; i < pid_start + pid_size; ++i) if (v == pid_data[i]) ++ec; return ec;} + + T * data(size_t index = 0) {return &(pid_data[pid_start + index]);} + const T * data(size_t index = 0) const {return &(pid_data[pid_start + index]);} + PIDeque & clear() {resize(0); return *this;} + PIDeque & fill(const T & f = T()) { + //if (sizeof(T) == 1) memset(pid_data, f, pid_size); + deleteT(pid_data + pid_start, pid_size); + //zeroRaw(pid_data, pid_size); + for (size_t i = pid_start; i < pid_start + pid_size; ++i) + elementNew(pid_data + i, f); + return *this; + } + PIDeque & assign(const T & f = T()) {return fill(f);} + PIDeque & assign(size_t new_size, const T & f) {resize(new_size); return fill(f);} + PIDeque & resize(size_t new_size, const T & f = T()) { + if (new_size < pid_size) { + deleteT(&(pid_data[new_size + pid_start]), pid_size - new_size); + pid_size = new_size; + } + if (new_size > pid_size) { + size_t os = pid_size; + alloc(new_size, true); + //if (sizeof(T) == 1) memset(&(pid_data[os]), f, ds); + //zeroRaw(&(pid_data[os]), new_size - os); + for (size_t i = os + pid_start; i < new_size + pid_start; ++i) elementNew(pid_data + i, f); + } + return *this; + } + PIDeque & reserve(size_t new_size) {if (new_size <= pid_rsize) return *this; size_t os = pid_size; alloc(new_size, true); pid_size = os; return *this;} + + PIDeque & insert(size_t index, const T & v = T()) { + bool dir = pid_rsize <= 2 ? true : (index >= pid_rsize / 2 ? true : false); + //piCout << "insert" << dir << index << pid_size << pid_rsize << pid_start << "!<"; + if (dir) { + alloc(pid_size + 1, true); + if (index < pid_size - 1) { + size_t os = pid_size - index - 1; + memmove(&(pid_data[index + pid_start + 1]), &(pid_data[index + pid_start]), os * sizeof(T)); + } + } else { + pid_start--; + alloc(pid_size + 1, false); + //piCout << "insert front" << pid_size << pid_rsize << pid_start << "!<"; + if (index > 0) + memmove(&(pid_data[pid_start]), &(pid_data[pid_start + 1]), index * sizeof(T)); + } + //piCout << "insert" << pid_start << index << (pid_start + ssize_t(index)) << pid_size << ">!"; + elementNew(pid_data + pid_start + index, v); + return *this; + } + PIDeque & insert(size_t index, const PIDeque & other) { + if (other.isEmpty()) return *this; + bool dir = pid_rsize <= 2 ? true : (index >= pid_rsize / 2 ? true : false); + //piCout << "insert" << dir << index << pid_size << pid_rsize << pid_start << "!<"; + if (dir) { + ssize_t os = pid_size - index; + alloc(pid_size + other.pid_size, true); + if (os > 0) + memmove(&(pid_data[index + pid_start + other.pid_size]), &(pid_data[index + pid_start]), os * sizeof(T)); + } else { + pid_start -= other.pid_size; + alloc(pid_size + other.pid_size, false); + //piCout << "insert front" << pid_size << pid_rsize << pid_start << "!<"; + if (index > 0) + memmove(&(pid_data[pid_start]), &(pid_data[pid_start + other.pid_size]), index * sizeof(T)); + } + //piCout << "insert" << pid_start << index << (pid_start + ssize_t(index)) << pid_size << ">!"; + newT(pid_data + pid_start + index, other.pid_data + other.pid_start, other.pid_size); + return *this; + } + + PIDeque & remove(size_t index, size_t count = 1) { + if (count == 0) return *this; + if (index + count >= pid_size) { + resize(index); + return *this; + } + size_t os = pid_size - index - count; + deleteT(&(pid_data[index + pid_start]), count); + if (os <= index) { + //if (true) { + if (os > 0) memmove(&(pid_data[index + pid_start]), &(pid_data[index + pid_start + count]), os * sizeof(T)); + } else { + if (index > 0) memmove(&(pid_data[pid_start + count]), &(pid_data[pid_start]), index * sizeof(T)); + pid_start += count; + } + pid_size -= count; + return *this; + } + + void swap(PIDeque & other) { + piSwap(pid_data, other.pid_data); + piSwap(pid_size, other.pid_size); + piSwap(pid_rsize, other.pid_rsize); + piSwap(pid_start, other.pid_start); + } + + typedef int (*CompareFunc)(const T * , const T * ); + static int compare_func(const T * t0, const T * t1) {return (*t0) < (*t1) ? -1 : ((*t0) == (*t1) ? 0 : 1);} + PIDeque & sort(CompareFunc compare = compare_func) {qsort(pid_data + pid_start, pid_size, sizeof(T), (int(*)(const void * , const void * ))compare); return *this;} + + PIDeque & enlarge(llong pid_size) {llong ns = size_s() + pid_size; if (ns <= 0) clear(); else resize(size_t(ns)); return *this;} + + PIDeque & removeOne(const T & v) {for (size_t i = 0; i < pid_size; ++i) if (pid_data[i + pid_start] == v) {remove(i); return *this;} return *this;} + PIDeque & removeAll(const T & v) {for (llong i = 0; i < pid_size; ++i) if (pid_data[i + pid_start] == v) {remove(i); --i;} return *this;} + + PIDeque & push_back(const T & v) {alloc(pid_size + 1, true); elementNew(pid_data + pid_start + pid_size - 1, v); return *this;} + PIDeque & append(const T & v) {return push_back(v);} + PIDeque & operator <<(const T & v) {return push_back(v);} + PIDeque & operator <<(const PIDeque & t) { + size_t ps = pid_size; + alloc(pid_size + t.pid_size, true); + newT(pid_data + ps + pid_start, t.pid_data + t.pid_start, t.pid_size); + return *this; + } + + PIDeque & push_front(const T & v) {insert(0, v); return *this;} + PIDeque & prepend(const T & v) {return push_front(v);} + + PIDeque & pop_back() {if (pid_size == 0) return *this; resize(pid_size - 1); return *this;} + PIDeque & pop_front() {if (pid_size == 0) return *this; remove(0); return *this;} + + T take_back() {T t(back()); pop_back(); return t;} + T take_front() {T t(front()); pop_front(); return t;} + +private: + void _reset() {pid_size = pid_rsize = pid_start = 0; pid_data = 0;} + /*void * qmemmove(void * dst, void * src, size_t size) { + if (piAbs(ssize_t(dst) - ssize_t(src)) >= size) + memcpy(dst, src, size); + else { + char * tb = new char[size]; + memcpy(tb, src, size); + memcpy(dst, tb, size); + delete tb; + } + return dst; + }*/ + inline size_t asize(ssize_t s) { + if (s <= 0) return 0; + if (pid_rsize + pid_rsize >= size_t(s) && pid_rsize < size_t(s)) + return pid_rsize + pid_rsize; + size_t t = 0, s_ = size_t(s) - 1; + while (s_ >> t) ++t; + return (1 << t); + } + inline void newT(T * dst, const T * src, size_t s) { + for (size_t i = 0; i < s; ++i) + elementNew(dst + i, src[i]); + } + inline T * newRaw(size_t s) { + //cout << std::dec << " ![("< (new 0x" << (llong)ret << ") ok]!" << endl; + return (T*)ret; + } + /*void reallocRawTemp(size_t s) { + if (pid_tdata == 0) pid_tdata = (T*)(malloc(s * sizeof(T))); + else pid_tdata = (T*)(realloc(pid_tdata, s * sizeof(T))); + }*/ + inline void deleteT(T * d, size_t sz) { + //cout << " ~[("< ok]~" << endl; + } + inline void deleteRaw(T *& d) { + //cout << " ~[("< ok]~" << endl; + } + void zeroRaw(T * d, size_t s) { + //cout << " ~[("< ok]~" << endl; + } + inline void elementNew(T * to, const T & from) {new(to)T(from);} + inline void elementDelete(T & from) {from.~T();} + void dealloc() {deleteRaw(pid_data);} + inline void checkMove(bool direction) { + if (pid_size >= 4 && pid_size < pid_rsize / 4) { + /*if (direction) { + if (pid_start >= 4 && pid_start > pid_size + pid_size && pid_start > pid_rsize / 2) { + piCout << (int)this << "checkMove" << direction << pid_start << (int)pid_data << pid_rsize << pid_size; + piCout << (int)this << "move from" << pid_start << "to" << pid_size << "," << (int)pid_data << pid_rsize << pid_size; + memmove(pid_data + pid_size, pid_data + pid_start, pid_size * sizeof(T)); + pid_start = pid_size; + } + } else { + if (ssize_t(pid_start) < ssize_t(pid_rsize) - pid_size - pid_size && ssize_t(pid_start) < ssize_t(pid_rsize / 2) - pid_size) { + piCout << (int)this << "checkMove" << direction << pid_start << (int)pid_data << pid_rsize << pid_size; + piCout << (int)this << "move from" << pid_start << "to" << (ssize_t(pid_rsize) - pid_size) << "," << (int)pid_data << pid_rsize << pid_size; + memmove(pid_data + ssize_t(pid_rsize) - pid_size - pid_size, pid_data + pid_start, pid_size * sizeof(T)); + pid_start = ssize_t(pid_rsize) - pid_size - pid_size; + } + }*/ + if (pid_start < pid_size + pid_size || pid_start > pid_rsize - pid_size - pid_size) { + size_t ns = (pid_rsize - pid_size) / 2; + if (pid_start != ns) { + memmove(pid_data + ns, pid_data + pid_start, pid_size * sizeof(T)); + pid_start = ns; + } + } + } + } + inline void alloc(size_t new_size, bool direction) { // direction == true -> alloc forward + if (direction) { + if (pid_start + new_size <= pid_rsize) { + pid_size = new_size; + checkMove(direction); + return; + } + pid_size = new_size; + size_t as = asize(pid_start + new_size); + if (as != pid_rsize) { + pid_data = (T*)(realloc(pid_data, as*sizeof(T))); + pid_rsize = as; + } + } else { + size_t as = asize(piMax(new_size, pid_rsize) - pid_start); + //piCout << "alloc" << new_size << pid_size << pid_rsize << as << pid_start; + if (pid_start >= 0 && as <= pid_rsize) { + pid_size = new_size; + checkMove(direction); + return; + } + size_t os = pid_size; + pid_size = new_size; + if (as > pid_rsize) { + //piCout << "alloc new size" << as; + //cout << std::hex << " ![("< 0 && pid_data != 0) { + memcpy(td + pid_start + ns, pid_data + ost, os * sizeof(T)); + deleteRaw(pid_data); + } + pid_data = td; + pid_rsize = as; + } + } + //checkMove(direction); + //piCout << "alloc new start" << pid_start; + } + + T * pid_data; + size_t pid_size, pid_rsize; + size_t pid_start; +}; + +#define __PIDEQUE_SIMPLE_TYPE__(T) \ + template<> inline void PIDeque::newT(T * dst, const T * src, size_t s) {memcpy(dst, src, s * sizeof(T));} \ + template<> inline void PIDeque::deleteT(T * d, size_t sz) {;} \ + template<> inline void PIDeque::elementNew(T * to, const T & from) {(*to) = from;} \ + template<> inline void PIDeque::elementDelete(T & from) {;} + +#else + + +template > +class PIP_EXPORT PIDeque: public deque { + typedef PIDeque _CDeque; + typedef deque _stlc; +public: + PIDeque() {piMonitor.containers++;} + PIDeque(const Type & value) {piMonitor.containers++; _stlc::resize(1, value);} + PIDeque(const Type & v0, const Type & v1) {piMonitor.containers++; _stlc::push_back(v0); _stlc::push_back(v1);} + PIDeque(const Type & v0, const Type & v1, const Type & v2) {piMonitor.containers++; _stlc::push_back(v0); _stlc::push_back(v1); _stlc::push_back(v2);} + PIDeque(const Type & v0, const Type & v1, const Type & v2, const Type & v3) {piMonitor.containers++; _stlc::push_back(v0); _stlc::push_back(v1); _stlc::push_back(v2); _stlc::push_back(v3);} + ~PIDeque() {piMonitor.containers--;} + int size_s() const {return static_cast(_stlc::size());} + bool isEmpty() const {return _stlc::empty();} + bool has(const Type & t) const {for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); ++i) if (t == *i) return true; return false;} + int etries(const Type & t) const {int ec = 0; for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); ++i) if (t == *i) ++ec; return ec;} + _CDeque & operator <<(const Type & t) {_CDeque::push_back(t); return *this;} + PIDeque toVector() {PIDeque v; for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); ++i) v << *i; return v;} +}; + + +#define __PIDEQUE_SIMPLE_FUNCTIONS__(T) + + +#endif + + +template +inline std::ostream & operator <<(std::ostream & s, const PIDeque & v) {s << "{"; for (size_t i = 0; i < v.size(); ++i) {s << v[i]; if (i < v.size() - 1) s << ", ";} s << "}"; return s;} + +template +inline PICout operator <<(PICout s, const PIDeque & v) {s.space(); s.setControl(0, true); s << "{"; for (size_t i = 0; i < v.size(); ++i) {s << v[i]; if (i < v.size() - 1) s << ", ";} s << "}"; s.restoreControl(); return s;} + + +#endif // PIDEQUE_H diff --git a/pidir.cpp b/pidir.cpp index 6690eb2d..0fb1cc36 100644 --- a/pidir.cpp +++ b/pidir.cpp @@ -19,7 +19,7 @@ #include "pidir.h" -#if !defined(WINDOWS) && !defined(ANDROID) +#if !defined(ANDROID) #ifdef WINDOWS const PIChar PIDir::separator = '\\'; #else @@ -27,47 +27,40 @@ #endif -PIDir::PIDir() { - path_ = PIDir::current().path_; - dir_ = 0; - open(); +PIDir::PIDir(const PIString & dir) { + path_ = dir; } -PIDir::PIDir(const PIString & dir) { - path_ = dir; - dir_ = 0; - open(); +PIDir::PIDir(const PIFile & file) { + path_ = file.path(); + if (isExists()) return; + int pos = path_.findLast(separator); + path_.cutRight(path_.size_s() - pos); } bool PIDir::operator ==(const PIDir & d) const { - return true; + return d.absolutePath() == absolutePath(); } -bool PIDir::open() { - if (dir_ != 0) - if (!close()) - return false; - dir_ = opendir(path_.data()); - return (dir_ != 0); +bool PIDir::isAbsolute() const { + if (path_.size() == 0) return false; +#ifdef WINDOWS + if (path_.size() < 3) return false; + return (path_[1] == ":"); +#else + return (path_[0] == separator); +#endif } -bool PIDir::close() { - if (dir_ == 0) return true; - if (closedir(dir_) == 0) { - dir_ = 0; - return true; - } - return false; -} - - -PIString PIDir::absolutePath() { - //di; - return PIString(); +PIString PIDir::absolutePath() const { + if (isAbsolute()) return path_; + PIDir d(path_); + d.setDir(PIDir::current().path_ + separator + path_); + return d.path_; } @@ -75,12 +68,15 @@ PIDir & PIDir::cleanPath() { PIString p(path_); if (p.size() == 0) { path_ = "."; - open(); return *this; } path_.replaceAll(PIString(separator) + PIString(separator), PIString(separator)); - bool isAbs = isAbsolute(); + bool is_abs = isAbsolute(); PIStringList l = PIString(p).split(separator); +#ifdef WINDOWS + PIString letter; + if (is_abs) letter = l.take_front(); +#endif l.removeAll("."); l.removeAll(""); bool found = true; @@ -102,112 +98,216 @@ PIDir & PIDir::cleanPath() { if (l.size() > 0) if (l[0] == "..") {l.pop_front(); found = true;} } - path_ = separator + l.join(separator); - if (!isAbs) path_.insert(0, "."); - if (path_.size() == 0) path_ = "./"; - open(); + path_ = separator + l.join(separator); /// TODO think about windows + if (!is_abs) path_.prepend("."); +#ifdef WINDOWS + else path_.prepend(letter); +#endif + if (path_.size() == 0) path_ = "."; + return *this; +} + + +PIDir & PIDir::setDir(const PIString & path) { + path_ = path; + cleanPath(); return *this; } PIDir & PIDir::cd(const PIString & path) { if (path_.size() == 0) return *this; - if (path_[path_.size() - 1] != separator) path_ << separator; - path_ << path; + if (path_[path_.size() - 1] != separator) path_ += separator; + path_ += path; return cleanPath(); } -bool PIDir::mkDir(bool withParents) { +bool PIDir::make(bool withParents) { PIDir d = cleanedPath(); PIString tp; - int ret; - bool isAbs = isAbsolute(); + bool is_abs = isAbsolute(); if (withParents) { PIStringList l = d.path_.split(separator); for (int i = l.size_s() - 1; i >= 0; --i) { if (i > 1) tp = PIStringList(l).remove(i, l.size_s() - i).join(separator); else { tp = separator; - if (!isAbs) tp.push_front('.'); + if (!is_abs) tp.push_front('.'); } //cout << tp << endl; if (isExists(tp)) { for (int j = i + 1; j <= l.size_s(); ++j) { tp = PIStringList(l).remove(j, l.size_s() - j).join(separator); //cout << tp << endl; - ret = mkdir(tp.data(), 16877); - if (ret == 0) continue; - printf("[PIDir] mkDir(\"%s\") error: %s\n", d.path_.data(), strerror(errno)); - return false; + if (makeDir(tp)) continue; + else return false; } break; }; } - } else { - ret = mkdir(d.path_.data(), 16877); - if (ret == 0) return true; - printf("[PIDir] mkDir(\"%s\") error: %s\n", d.path_.data(), strerror(errno)); - } + } else + if (makeDir(d.path_)) return true; return false; } PIVector PIDir::entries() { - PIDir d = cleanedPath(); - PIString p = d.path_; - dirent ** list; -#ifndef QNX - int cnt = scandir(const_cast(p.data()), &list, 0, alphasort); -#else - int cnt = scandir(const_cast(p.data()), 0, 0, alphasort); -#endif - struct stat fs; PIVector l; + PIString p(cleanedPath().path_); +#ifdef WINDOWS + WIN32_FIND_DATA fd; memset(&fd, 0, sizeof(fd)); + p += "\\*"; + void * hf = FindFirstFile((LPCTSTR)(p.data()), &fd); + if (!hf) return l; + LARGE_INTEGER filesize; + do { + int m = 0; + filesize.LowPart = filesize.HighPart = 0; + if (fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) m |= S_IFHDN; + if (fd.dwFileAttributes & FILE_ATTRIBUTE_DEVICE) m |= S_IFBLK; + if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) m |= S_IFDIR; + else { + m |= S_IFREG; + filesize.LowPart = fd.nFileSizeLow; + filesize.HighPart = fd.nFileSizeHigh; + } + l << DirEntry(fd.cFileName, m, filesize.QuadPart); + memset(&fd, 0, sizeof(fd)); + } while (FindNextFile(hf, &fd) != 0); + FindClose(hf); +#else + dirent ** list; +# ifndef QNX + int cnt = scandir(p.data(), &list, 0, versionsort); +# else + int cnt = scandir(const_cast(p.data()), 0, 0, versionsort); +# endif + struct stat fs; for (int i = 0; i < cnt; ++i) { stat((p + separator + PIString(list[i]->d_name)).data(), &fs); - l.push_back(DirEntry(list[i]->d_name, fs.st_mode, fs.st_size)); + l << DirEntry(list[i]->d_name, fs.st_mode, fs.st_size); + if (list[i]->d_name[0] == '.') l.back().mode |= S_IFHDN; delete list[i]; } delete list; +#endif return l; } +bool PIDir::isExists(const PIString & path) { +#ifdef WINDOWS + return (GetFileAttributes((LPCTSTR)(path.data())) & FILE_ATTRIBUTE_DIRECTORY); +#else + DIR * dir_ = opendir(path.data()); + if (dir_ == 0) return false; + closedir(dir_); +#endif + return true; +} + + PIDir PIDir::current() { char rc[1024]; +#ifdef WINDOWS + memset(rc, 0, 1024); + if (GetCurrentDirectory(1024, (LPTSTR)rc) == 0) return PIString(); +#else if (getcwd(rc, 1024) == 0) return PIString(); +#endif return PIDir(rc); } PIDir PIDir::home() { - return PIDir(getenv("HOME")); + char * rc = 0; +#ifdef WINDOWS + rc = new char[1024]; + memset(rc, 0, 1024); + if (ExpandEnvironmentStrings((LPCTSTR)"%HOMEPATH%", (LPTSTR)rc, 1024) == 0) { + delete[] rc; + return PIDir(); + } + PIString s(rc); + delete[] rc; + return PIDir(s); +#else + rc = getenv("HOME"); + if (rc == 0) return PIDir(); + return PIDir(rc); +#endif } PIDir PIDir::temporary() { - char * rc; + char * rc = 0; +#ifdef WINDOWS + rc = new char[1024]; + memset(rc, 0, 1024); + int ret = GetTempPath(1024, (LPTSTR)rc); + if (ret == 0) { + delete[] rc; + return PIDir(); + } + PIString s(rc); + delete[] rc; + return PIDir(s); +#else rc = tmpnam(0); + if (rc == 0) return PIDir(); PIString s(rc); return PIDir(s.left(s.findLast(PIDir::separator))); +#endif } -bool PIDir::mkDir(const PIString & path, bool withParents) { +bool PIDir::make(const PIString & path, bool withParents) { PIDir d(path); if (d.isExists()) return true; - return d.mkDir(withParents); + return d.make(withParents); } -bool PIDir::rmDir(const PIString & path) { - string s = path.stdString(); - int ret = rmdir(s.c_str()); - if (ret == 0) return true; - printf("[PIDir] rmDir(\"%s\") error: %s\n", s.c_str(), strerror(errno)); +bool PIDir::setCurrent(const PIString & path) { +#ifdef WINDOWS + if (SetCurrentDirectory((LPCTSTR)(path.data())) != 0) return true; +#else + if (chdir(path.data()) == 0) return true; +#endif + printf("[PIDir] setCurrent(\"%s\") error: %s\n", path.data(), errorString().c_str()); return false; } + +bool PIDir::makeDir(const PIString & path) { +#ifdef WINDOWS + if (CreateDirectory((LPCTSTR)(path.data()), NULL) != 0) return true; +#else + if (mkdir(path.data(), 16877) == 0) return true; +#endif + printf("[PIDir] makeDir(\"%s\") error: %s\n", path.data(), errorString().c_str()); + return false; +} + + +bool PIDir::removeDir(const PIString & path) { +#ifdef WINDOWS + if (RemoveDirectory((LPCTSTR)(path.data())) != 0) return true; +#else + if (rmdir(path.data()) == 0) return true; +#endif + printf("[PIDir] removeDir(\"%s\") error: %s\n", path.data(), errorString().c_str()); + return false; +} + + +bool PIDir::renameDir(const PIString & path, const PIString & new_name) { + if (::rename(path.data(), new_name.data()) == 0) return true; + printf("[PIDir] renameDir(\"%s\", \"%s\") error: %s\n", path.data(), new_name.data(), errorString().c_str()); + return false; +} + + #endif diff --git a/pidir.h b/pidir.h index ae0957fe..8a227968 100644 --- a/pidir.h +++ b/pidir.h @@ -21,26 +21,40 @@ #define PIDIR_H #include "pifile.h" -#include "pistring.h" -#if !defined(WINDOWS) && !defined(ANDROID) -#ifdef ANDROID -# include +#if !defined(ANDROID) +#ifdef WINDOWS +# undef S_IFDIR +# undef S_IFREG +# undef S_IFLNK +# undef S_IFBLK +# undef S_IFCHR +# undef S_IFSOCK +# define S_IFDIR 0x01 +# define S_IFREG 0x02 +# define S_IFLNK 0x04 +# define S_IFBLK 0x08 +# define S_IFCHR 0x10 +# define S_IFSOCK 0x20 #else -# include +# ifdef ANDROID +# include +# else +# include +# endif +# include #endif -#include +#define S_IFHDN 0x40 class PIP_EXPORT PIDir { public: - PIDir(); - PIDir(const PIString & dir); - ~PIDir() {close();} + PIDir(const PIString & dir = PIString()); + PIDir(const PIFile & file); struct DirEntry { - DirEntry() {;} - DirEntry(const PIString & name_, const int & mode_, const int & size_) { - name = name_; mode = mode_; size = size_;} + DirEntry(const PIString & name_ = PIString(), int mode_ = 0, int size_ = 0) { + name = name_; mode = mode_; size = size_; + } PIString name; int mode; @@ -52,41 +66,62 @@ public: bool isBlockDevice() const {return (mode & S_IFBLK);} bool isCharacterDevice() const {return (mode & S_IFCHR);} bool isSocket() const {return (mode & S_IFSOCK);} + bool isHidden() const {return (mode & S_IFHDN);} }; - bool isExists() const {return (dir_ != 0);} - bool isAbsolute() const {if (path_.size() == 0) return false; return (path_[0] == separator);} + bool isExists() const {return PIDir::isExists(path_);} + bool isAbsolute() const; + bool isRelative() const {return !isAbsolute();} + const PIString & path() const {return path_;} + PIString absolutePath() const; PIDir & cleanPath(); - PIDir cleanedPath() {PIDir d(path_); d.cleanPath(); return d;} - PIString absolutePath(); - bool mkDir(bool withParents = true); + PIDir cleanedPath() const {PIDir d(path_); d.cleanPath(); return d;} + PIDir & setDir(const PIString & path); + bool setCurrent() {return PIDir::setCurrent(path_);} + PIVector entries(); + bool make(bool withParents = true); + bool remove() {return PIDir::remove(path_);} + bool rename(const PIString & new_name) {if (!PIDir::rename(path_, new_name)) return false; path_ = new_name; return true;} PIDir & cd(const PIString & path); PIDir & up() {return cd("..");} bool operator ==(const PIDir & d) const; + bool operator !=(const PIDir & d) const {return !((*this) == d);} + static const PIChar separator; static PIDir current(); static PIDir home(); static PIDir temporary(); - static bool mkDir(const PIString & path, bool withParents = true); - static bool rmDir(const PIString & path); - static bool isExists(const PIString & path) {return PIDir(path).isExists();} - //static bool rmDir(const PIString & path); + static bool isExists(const PIString & path); + static bool make(const PIString & path, bool withParents = true); + static bool remove(const PIString & path) {return removeDir(path);} + static bool rename(const PIString & path, const PIString & new_name) {return PIDir::renameDir(path, new_name);} + static bool setCurrent(const PIString & path); + static bool setCurrent(const PIDir & dir) {return setCurrent(dir.path_);} private: - bool open(); - bool close(); + static bool makeDir(const PIString & path); + static bool removeDir(const PIString & path); + static bool renameDir(const PIString & path, const PIString & new_name); PIString path_; - DIR * dir_; - }; + +inline bool operator <(const PIDir::DirEntry & v0, const PIDir::DirEntry & v1) {return (v0.name < v1.name);} +inline bool operator >(const PIDir::DirEntry & v0, const PIDir::DirEntry & v1) {return (v0.name > v1.name);} +inline bool operator ==(const PIDir::DirEntry & v0, const PIDir::DirEntry & v1) {return (v0.name == v1.name);} +inline bool operator !=(const PIDir::DirEntry & v0, const PIDir::DirEntry & v1) {return (v0.name != v1.name);} + +inline PICout operator <<(PICout s, const PIDir & v) {s.setControl(0, true); s << "PIDir(\"" << v.path() << "\")"; s.restoreControl(); return s;} +inline PICout operator <<(PICout s, const PIDir::DirEntry & v) {s.setControl(0, true); s << "DirEntry(\"" << v.name << "\", " << v.size << " b, " << PIString::fromNumber(v.mode, 16) << ")"; s.restoreControl(); return s;} + + #endif #endif // PIDIR_H diff --git a/piethernet.cpp b/piethernet.cpp index ac3ae118..c134dca8 100644 --- a/piethernet.cpp +++ b/piethernet.cpp @@ -86,11 +86,11 @@ PIEthernet::PIEthernet(int sock_, PIString ip_port): PIIODevice("", ReadWrite) { sock_s = -1; init_ = opened_ = connected_ = true; connecting_ = false; - server_thread_.setData(this); + server_thread_.setData(this); setParameters(PIEthernet::ReuseAddress); setThreadedReadBufferSize(65536); setPriority(piHigh); - setType(TCP_Client); + setType(TCP_Client, false); setPath(ip_port); } @@ -165,7 +165,7 @@ bool PIEthernet::openDevice() { init(); if (sock == -1 || path().isEmpty()) return false; parseAddress(path(), &ip_, &port_); - if (type() != UDP) + if (type() != UDP && mode() == PIIODevice::WriteOnly) return true; //piCout << "bind to" << (params[PIEthernet::Broadcast] ? "bc" : ip_) << ":" << port_ << " ..."; memset(&addr_, 0, sizeof(addr_)); @@ -563,6 +563,17 @@ bool PIEthernet::configureDevice(const void * e_main, const void * e_parent) { } +PIString PIEthernet::constructFullPath() const { + PIString ret(fullPathPrefix() + "://"); + ret << (type() == PIEthernet::UDP ? "UDP" : "TCP") << ":" << readIP() << ":" << readPort(); + if (type() == PIEthernet::UDP) { + piForeachC (PIString & m, multicastGroups()) + ret << ":mcast:" << m; + } + return ret; +} + + void PIEthernet::configureFromFullPath(const PIString & full_path) { PIStringList pl = full_path.split(":"); bool mcast = false; @@ -574,8 +585,8 @@ void PIEthernet::configureFromFullPath(const PIString & full_path) { if (p == "udp") setType(UDP); if (p == "tcp") setType(TCP_Client); break; - case 1: setReadIP(p); break; - case 2: setReadPort(p.toInt()); break; + case 1: setReadIP(p); setSendIP(p); break; + case 2: setReadPort(p.toInt()); setSendPort(p.toInt()); break; } if (i <= 2) continue; if (i % 2 == 1) {if (p.toLowerCase() == "mcast") mcast = true;} diff --git a/piethernet.h b/piethernet.h index d868f229..cc4ab06a 100644 --- a/piethernet.h +++ b/piethernet.h @@ -83,23 +83,23 @@ public: //! Returns read address in format "i.i.i.i:p" - PIString readAddress() {return path();} + PIString readAddress() const {return path();} //! Returns read IP - PIString readIP() {parseAddress(path(), &ip_, &port_); return ip_;} + PIString readIP() const {parseAddress(path(), &ip_, &port_); return ip_;} //! Returns read port - int readPort() {parseAddress(path(), &ip_, &port_); return port_;} + int readPort() const {parseAddress(path(), &ip_, &port_); return port_;} //! Returns send address in format "i.i.i.i:p" - PIString sendAddress() {return ip_s + ":" + PIString::fromNumber(port_s);} + PIString sendAddress() const {return ip_s + ":" + PIString::fromNumber(port_s);} //! Returns send IP - PIString sendIP() {return ip_s;} + PIString sendIP() const {return ip_s;} //! Returns send port - int sendPort() {return port_s;} + int sendPort() const {return port_s;} //! Set parameters to "parameters_". You should to reopen %PIEthernet to apply them @@ -179,6 +179,8 @@ public: //! Send data "data" to address \a sendAddress() for UDP or \a readAddress() for TCP_Client int write(const PIByteArray & data) {return write(data.data(), data.size_s());} + PIString constructFullPath() const; + EVENT1(newConnection, PIEthernet * , client) EVENT0(connected) EVENT1(disconnected, bool, withError) @@ -327,10 +329,11 @@ protected: #endif - int sock, sock_s, port_, port_s, port_c, wrote; + int sock, sock_s, wrote; + mutable int port_, port_s, port_c; bool connected_, connecting_; sockaddr_in addr_, saddr_; - PIString ip_, ip_s, ip_c; + mutable PIString ip_, ip_s, ip_c; PIThread server_thread_; PIVector clients_; PIQueue mcast_queue; @@ -341,7 +344,7 @@ protected: private: static void server_func(void * eth); - void setType(Type t) {setProperty("type", (int)t); if (isOpened()) {closeDevice(); init(); openDevice();}} + void setType(Type t, bool reopen = true) {setProperty("type", (int)t); if (reopen && isOpened()) {closeDevice(); init(); openDevice();}} static std::string ethErrorString() { #ifdef WINDOWS diff --git a/pifile.cpp b/pifile.cpp index 36f6bf05..92e71325 100644 --- a/pifile.cpp +++ b/pifile.cpp @@ -148,6 +148,11 @@ bool PIFile::isExists(const PIString & path) { } +PIString PIFile::constructFullPath() const { + return fullPathPrefix() + "://" + path(); +} + + void PIFile::configureFromFullPath(const PIString & full_path) { setPath(full_path); } diff --git a/pifile.h b/pifile.h index 6901652a..dd72cc39 100644 --- a/pifile.h +++ b/pifile.h @@ -92,10 +92,10 @@ public: //! Read from file to "read_to" no more than "max_size" and return readed bytes count - int read(void * read_to, int max_size) {if (!canRead() || fd == 0) return -1; return fread(read_to, max_size, 1, fd);} + int read(void * read_to, int max_size) {if (!canRead() || fd == 0) return -1; return fread(read_to, 1, max_size, fd);} //! Write to file "data" with size "max_size" and return written bytes count - int write(const void * data, int max_size) {if (!canWrite() || fd == 0) return -1; return fwrite(data, max_size, 1, fd);} + int write(const void * data, int max_size) {if (!canWrite() || fd == 0) return -1; return fwrite(data, 1, max_size, fd);} PIFile & writeToBinLog(ushort id, const void * data, int size) {if (!isWriteable() || fd == 0) return *this; writeBinary(id).writeBinary((ushort)size); write(data, size); flush(); return *this;} @@ -183,6 +183,7 @@ public: //! Read from file text representation of "v" PIFile & operator >>(double & v) {if (canRead() && fd != 0) ret = fscanf(fd, "%lf", &v); return *this;} + PIString constructFullPath() const; EVENT_HANDLER(void, clear) {close(); fd = fopen(path().data(), "w"); if (fd != 0) fclose(fd); fd = 0; opened_ = false; open();} EVENT_HANDLER0(void, remove) {close(); std::remove(path().data());} diff --git a/piincludes.cpp b/piincludes.cpp index 21de759a..f1c534db 100644 --- a/piincludes.cpp +++ b/piincludes.cpp @@ -40,6 +40,7 @@ clock_serv_t __pi_mac_clock; #endif PIMutex __PICout_mutex__; +PIString __PICout_string__; #ifdef WINDOWS @@ -127,6 +128,9 @@ DWORD PICout::smode = 0; #endif +bool PICout::buffer_ = false; + + PICout::PICout(PIFlags controls): fo_(true), cc_(false), fc_(false), cnb_(10), co_(controls) { #ifdef WINDOWS if (hOut == 0) { @@ -149,57 +153,68 @@ PICout::~PICout() { } -PICout PICout::operator<<(const PICoutAction v) { +PICout PICout::operator <<(const PICoutAction v) { #ifdef WINDOWS CONSOLE_SCREEN_BUFFER_INFO sbi; COORD coord; CONSOLE_CURSOR_INFO curinfo; #endif switch (v) { - case PICoutManipulators::Flush: std::cout << std::flush; break; + case PICoutManipulators::Flush: + if (!PICout::buffer_) + std::cout << std::flush; + break; case PICoutManipulators::Backspace: + if (!PICout::buffer_) { #ifdef WINDOWS - GetConsoleScreenBufferInfo(hOut, &sbi); - coord = sbi.dwCursorPosition; - coord.X = piMax(0, int(coord.X) - 1); - SetConsoleCursorPosition(hOut, coord); - printf(" "); - SetConsoleCursorPosition(hOut, coord); + GetConsoleScreenBufferInfo(hOut, &sbi); + coord = sbi.dwCursorPosition; + coord.X = piMax(0, int(coord.X) - 1); + SetConsoleCursorPosition(hOut, coord); + printf(" "); + SetConsoleCursorPosition(hOut, coord); #else - printf("\e[1D \e[1D"); + printf("\e[1D \e[1D"); #endif + } break; case PICoutManipulators::ShowCursor: + if (!PICout::buffer_) { #ifdef WINDOWS - GetConsoleCursorInfo(hOut, &curinfo); - curinfo.bVisible = true; - SetConsoleCursorInfo(hOut, &curinfo); + GetConsoleCursorInfo(hOut, &curinfo); + curinfo.bVisible = true; + SetConsoleCursorInfo(hOut, &curinfo); #else - printf("\e[?25h"); + printf("\e[?25h"); #endif + } break; case PICoutManipulators::HideCursor: + if (!PICout::buffer_) { #ifdef WINDOWS - GetConsoleCursorInfo(hOut, &curinfo); - curinfo.bVisible = false; - SetConsoleCursorInfo(hOut, &curinfo); + GetConsoleCursorInfo(hOut, &curinfo); + curinfo.bVisible = false; + SetConsoleCursorInfo(hOut, &curinfo); #else - printf("\e[?25l"); + printf("\e[?25l"); #endif + } break; case PICoutManipulators::ClearScreen: + if (!PICout::buffer_) { #ifdef WINDOWS - /// TODO !!! - /*GetConsoleCursorInfo(hOut, &curinfo); - curinfo.bVisible = false; - SetConsoleCursorInfo(hOut, &curinfo); - - SetConsoleCursorPosition(hOut, ulcoord); - FillConsoleOutputAttribute(hOut, dattr, width * (height + 1), ulcoord, &written); - FillConsoleOutputCharacter(hOut, ' ', width * (height + 1), ulcoord, &written);*/ + /// TODO !!! + /*GetConsoleCursorInfo(hOut, &curinfo); + curinfo.bVisible = false; + SetConsoleCursorInfo(hOut, &curinfo); + + SetConsoleCursorPosition(hOut, ulcoord); + FillConsoleOutputAttribute(hOut, dattr, width * (height + 1), ulcoord, &written); + FillConsoleOutputCharacter(hOut, ' ', width * (height + 1), ulcoord, &written);*/ #else - printf("\e[H\e[J"); + printf("\e[H\e[J"); #endif + } break; case PICoutManipulators::SaveContol: saveControl(); break; case PICoutManipulators::RestoreControl: restoreControl(); break; @@ -209,9 +224,19 @@ PICout PICout::operator<<(const PICoutAction v) { } -#define PINUMERICCOUT if (cnb_ == 10) std::cout << v; else std::cout << PIString::fromNumber(v, cnb_); +#define PICOUTTOTARGET(v) {if (PICout::buffer_) __PICout_string__ << (v); else std::cout << (v);} +#define PINUMERICCOUT if (cnb_ == 10) PICOUTTOTARGET(v) else PICOUTTOTARGET(PIString::fromNumber(v, cnb_)) -PICout PICout::operator <<(const uchar v) {space(); if (cnb_ == 10) std::cout << ushort(v); else std::cout << PIString::fromNumber(v, cnb_); return *this;} + +PICout PICout::operator <<(const char * v) {space(); quote(); PICOUTTOTARGET(v) quote(); return *this;} + +PICout PICout::operator <<(const string & v) {space(); quote(); PICOUTTOTARGET(v) quote(); return *this;} + +PICout PICout::operator <<(const bool v) {space(); if (v) PICOUTTOTARGET("true") else PICOUTTOTARGET("false") return *this;} + +PICout PICout::operator <<(const char v) {space(); PICOUTTOTARGET(v) return *this;} + +PICout PICout::operator <<(const uchar v) {space(); if (cnb_ == 10) PICOUTTOTARGET(ushort(v)) else PICOUTTOTARGET(PIString::fromNumber(v, cnb_)) return *this;} PICout PICout::operator <<(const short int v) {space(); PINUMERICCOUT return *this;} @@ -229,18 +254,91 @@ PICout PICout::operator <<(const llong v) {space(); PINUMERICCOUT return *this;} PICout PICout::operator <<(const ullong v) {space(); PINUMERICCOUT return *this;} -PICout PICout::operator <<(const float v) {space(); std::cout << v; return *this;} +PICout PICout::operator <<(const float v) {space(); PICOUTTOTARGET(v) return *this;} -PICout PICout::operator <<(const double v) {space(); std::cout << v; return *this;} +PICout PICout::operator <<(const double v) {space(); PICOUTTOTARGET(v) return *this;} -PICout PICout::operator <<(const void * v) {space(); std::cout << "0x" << PIString::fromNumber(ullong(v), 16); return *this;} +PICout PICout::operator <<(const void * v) {space(); PICOUTTOTARGET("0x") PICOUTTOTARGET(PIString::fromNumber(ullong(v), 16)) return *this;} -PICout PICout::operator <<(const PIObject * v) {space(); if (v == 0) std::cout << "PIObject*(0x0)"; else std::cout << v->className() << "*(" << "0x" << PIString::fromNumber(ullong(v), 16) << ", \"" << v->name() << "\")"; return *this;} +PICout PICout::operator <<(const PIObject * v) { + space(); + if (v == 0) PICOUTTOTARGET("PIObject*(0x0)") + else { + PICOUTTOTARGET(v->className()) + PICOUTTOTARGET("*(0x") + PICOUTTOTARGET(PIString::fromNumber(ullong(v), 16)) + PICOUTTOTARGET(", \"") + PICOUTTOTARGET(v->name()) + PICOUTTOTARGET("\")") + } + return *this; +} +PICout PICout::operator <<(const PICoutSpecialChar v) { + switch (v) { + case Null: + if (PICout::buffer_) __PICout_string__ << PIChar(0); + else std::cout << char(0); + break; + case NewLine: + if (PICout::buffer_) __PICout_string__ << "\n"; + else std::cout << '\n'; + fo_ = true; + break; + case Tab: + if (PICout::buffer_) __PICout_string__ << "\t"; + else std::cout << '\t'; + break; + case Esc: +#ifdef CC_VC + if (PICout::buffer_) __PICout_string__ << PIChar(27); + else std::cout << char(27); +#else + if (PICout::buffer_) __PICout_string__ << "\e"; + else std::cout << '\e'; +#endif + break; + case Quote: + if (PICout::buffer_) __PICout_string__ << "\""; + else std::cout << '"'; + break; + }; + return *this; +} + +#undef PICOUTTOTARGET #undef PINUMERICCOUT +PICout & PICout::space() { + if (!fo_ && co_[AddSpaces]) { + if (PICout::buffer_) __PICout_string__ << " "; + else std::cout << ' '; + } + fo_ = false; + return *this; +} + +PICout & PICout::quote() { + if (co_[AddQuotes]) { + if (PICout::buffer_) __PICout_string__ << "\""; + else std::cout << '"'; + } + fo_ = false; + return *this; +} + +PICout & PICout::newLine() { + if (co_[AddNewLine]) { + if (PICout::buffer_) __PICout_string__ << "\n"; + else std::cout << std::endl; + } + fo_ = false; + return *this; +} + void PICout::applyFormat(PICoutFormat f) { + if (PICout::buffer_) return; fc_ = true; #ifdef WINDOWS static int mask_fore = ~(FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE); @@ -300,6 +398,34 @@ void PICout::applyFormat(PICoutFormat f) { } +bool PICout::setBufferActive(bool on, bool clear) { + PIMutexLocker ml(__PICout_mutex__); + bool ret = PICout::buffer_; + if (clear) __PICout_string__.clear(); + PICout::buffer_ = on; + return ret; +} + + +bool PICout::isBufferActive() { + return PICout::buffer_; +} + + +PIString PICout::buffer(bool clear) { + PIMutexLocker ml(__PICout_mutex__); + PIString ret = __PICout_string__; + if (clear) __PICout_string__.clear(); + return ret; +} + + +void PICout::clearBuffer() { + PIMutexLocker ml(__PICout_mutex__); + __PICout_string__.clear(); +} + + /*! \class PICout * \brief Class for formatted output similar std::cout * @@ -326,11 +452,12 @@ void PICout::applyFormat(PICoutFormat f) { * PIP - Platform-Independent Primitives - is crossplatform library for C++ developers. * It is wrap around STL and pure C++. This library can help developers write non-GUI * projects much more quickly, efficiently and customizable than on pure C++. - * Library contains more classes, some of them are pure abstract, some classes + * Library contains many classes, some of them are pure abstract, some classes * can be used as they are, some classes should be inherited to new classes. * PIP provide classes: * * direct output to console (\a PICout) * * containers (\a PIVector, \a PIList, \a PIMap, \a PIStack) + * * byte array (\a PIByteArray) * * string (\a PIString, \a PIStringList) * * base object (events and handlers) (\a PIObject) * * thread (\a PIThread) @@ -346,6 +473,8 @@ void PICout::applyFormat(PICoutFormat f) { * * ethernet (\a PIEthernet) * * USB (\a PIUSB) * * packets extractor (\a PIPacketExtractor) + * * binary log (\a PIBinaryLog) + * * connection quality diagnotic (\a PIDiagnostics) * * command-line arguments parser (\a PICLI) * * math evaluator (\a PIEvaluator) * * peering net node (\a PIPeer) diff --git a/piincludes.h b/piincludes.h index c85ba065..4861d2fc 100644 --- a/piincludes.h +++ b/piincludes.h @@ -39,7 +39,7 @@ #define PIP_VERSION_REVISION PIP_VERSION & 0xFF //! Suffix of PIP version -#define PIP_VERSION_SUFFIX "_prealpha" +#define PIP_VERSION_SUFFIX "_beta2" #ifdef DOXYGEN @@ -747,7 +747,10 @@ private: class PIObject; class PIMutex; +class PIString; + extern PIMutex __PICout_mutex__; +extern PIString __PICout_string__; //! \brief Namespace contains enums controlled PICout namespace PICoutManipulators { @@ -825,16 +828,16 @@ public: ~PICout(); //! Output operator for strings with "const char * " type - PICout operator <<(const char * v) {space(); quote(); std::cout << v; quote(); return *this;} + PICout operator <<(const char * v); //! Output operator for strings with "std::string" type - PICout operator <<(const string & v) {space(); quote(); std::cout << v; quote(); return *this;} + PICout operator <<(const string & v); //! Output operator for boolean values - PICout operator <<(const bool v) {space(); std::cout << (v ? "true" : "false"); return *this;} + PICout operator <<(const bool v); //! Output operator for "char" values - PICout operator <<(const char v) {space(); std::cout << v; return *this;} + PICout operator <<(const char v); //! Output operator for "unsigned char" values PICout operator <<(const uchar v); @@ -876,23 +879,7 @@ public: PICout operator <<(const PIObject * v); //! Output operator for \a PICoutSpecialChar values - PICout operator <<(const PICoutSpecialChar v) { - switch (v) { - case Null: std::cout << char(0); break; - case NewLine: std::cout << '\n'; fo_ = true; break; - case Tab: std::cout << '\t'; break; - case Esc: -#ifdef CC_VC - std::cout << char(27); -#else - std::cout << '\e'; -#endif - break; - case Quote: std::cout << '"'; break; - }; - return *this; - - } + PICout operator <<(const PICoutSpecialChar v); //! Output operator for \a PIFlags values PICout operator <<(const PIFlags v) { @@ -955,21 +942,27 @@ public: /*! \brief Conditional put space character to output * \details If it is not a first output and control \a AddSpaces is set * space character is put \sa \a quote(), \a newLine() */ - inline PICout & space() {if (!fo_ && co_[AddSpaces]) std::cout << ' '; fo_ = false; return *this;} + PICout & space(); /*! \brief Conditional put quote character to output * \details If control \a AddQuotes is set * quote character is put \sa \a space(), \a newLine() */ - inline PICout & quote() {if (co_[AddQuotes]) std::cout << '"'; fo_ = false; return *this;} + PICout & quote(); /*! \brief Conditional put new line character to output * \details If control \a AddNewLine is set * new line character is put \sa \a space(), \a quote() */ - inline PICout & newLine() {if (co_[AddNewLine]) std::cout << std::endl; fo_ = false; return *this;} + PICout & newLine(); + + static bool setBufferActive(bool on, bool clear = false); + static bool isBufferActive(); + static PIString buffer(bool clear = false); + static void clearBuffer(); private: void applyFormat(PICoutFormat f); + static bool buffer_; bool fo_, cc_, fc_; int cnb_, attr_; PICoutControls co_; diff --git a/piiodevice.h b/piiodevice.h index 0744c0d2..33d536e9 100644 --- a/piiodevice.h +++ b/piiodevice.h @@ -127,6 +127,9 @@ public: //! Return content of threaded read buffer const uchar * threadedReadBuffer() const {return buffer_tr.data();} + //! Return custom data that will be passed to "threaded read slot" + void * threadedReadData() const {return ret_data_;} + //! Return \b true if threaded read is started bool isThreadedRead() const {return isRunning();} @@ -189,6 +192,9 @@ public: bool configure(const PIString & config_file, const PIString & section, bool parent_section = false); + //! Reimplement to construct full unambiguous string, describes this device, default returns \a path() + virtual PIString constructFullPath() const {return path();} + //! \brief Try to determine suitable device, create new one, configure it with \a configureFromFullPath() and returns it. //! \details To function \a configureFromFullPath() "full_path" passed without \a fullPathPrefix() + "://". //! See \ref PIIODevice_sec7 @@ -197,7 +203,7 @@ public: EVENT_HANDLER(bool, open) {if (!init_) init(); opened_ = openDevice(); if (opened_) opened(); return opened_;} EVENT_HANDLER1(bool, open, const PIString &, _path) {setPath(_path); if (!init_) init(); opened_ = openDevice(); if (opened_) opened(); return opened_;} - EVENT_HANDLER1(bool, open, const DeviceMode &, _type) {mode_ = _type; if (!init_) init(); opened_ = openDevice(); if (opened_) opened(); return opened_;} + EVENT_HANDLER1(bool, open, const DeviceMode &, _mode) {mode_ = _mode; if (!init_) init(); opened_ = openDevice(); if (opened_) opened(); return opened_;} EVENT_HANDLER2(bool, open, const PIString &, _path, const DeviceMode &, _mode) {setPath(_path); mode_ = _mode; if (!init_) init(); opened_ = openDevice(); if (opened_) opened(); return opened_;} EVENT_HANDLER(bool, close) {opened_ = !closeDevice(); if (!opened_) closed(); return !opened_;} EVENT_HANDLER(bool, initialize) {init_ = init(); return init_;} @@ -289,9 +295,6 @@ protected: //! Reimplement to construct full unambiguous string prefix. \ref PIIODevice_sec7 virtual PIString fullPathPrefix() const {return PIString();} - //! Reimplement to construct full unambiguous string, describes this device, default returns \a path() - virtual PIString constructFullPath() const {return path();} - //! Reimplement to configure your device with parameters of full unambiguous string. Default implementation does nothing virtual void configureFromFullPath(const PIString & full_path) {;} diff --git a/pikbdlistener.cpp b/pikbdlistener.cpp index 22ac9135..dddd46c7 100644 --- a/pikbdlistener.cpp +++ b/pikbdlistener.cpp @@ -90,9 +90,9 @@ void PIKbdListener::run() { case 40: ret = 1; lc = (ctrl ? CtrlDownArrow : DownArrow); break; default: ret = 1; lc = (shift ? char(toupper(ker.uChar.AsciiChar)) : ker.uChar.AsciiChar); break; } - if (lc == 0) return; - } else return; - } else return; + if (lc == 0) {piMSleep(10); return;} + } else {piMSleep(10); return;} + } else {piMSleep(10); return;} /*if (lc == 0) { ReadConsole(hIn, &rc, 1, &ret, 0); //cout << "read console" << endl; @@ -105,7 +105,7 @@ void PIKbdListener::run() { cout << endl << std::hex << rc << endl;*/ #else ret = read(0, &rc, 4); - if (ret < 0 || ret > 3) return; + if (ret < 0 || ret > 3) {piMSleep(10); return;} lc = char(((uchar * )&rc)[ret - 1]); //for (int i = 0; i < ret; ++i) // cout << std::hex << int(((uchar * )&rc)[i]) << ' '; diff --git a/pimap.h b/pimap.h index 8368cd09..9c680288 100644 --- a/pimap.h +++ b/pimap.h @@ -26,9 +26,10 @@ #define PIMAP_H #include "pivector.h" +#include "pideque.h" -#if 0 // !defined(PIP_CONTAINERS_STL) || defined(DOXYGEN) +#if !defined(PIP_CONTAINERS_STL) || defined(DOXYGEN) template void piQuickSort(T * a, ssize_t N) { @@ -54,7 +55,7 @@ template class PIMap { public: PIMap() {;} - PIMap(const PIMap & other) {;} + PIMap(const PIMap & other) {*this = other;} ~PIMap() {;} PIMap & operator =(const PIMap & other) { @@ -69,6 +70,42 @@ public: typedef Key key_type; typedef PIPair value_type; + class iterator { + friend class PIMap; + private: + iterator(const PIMap * v, ssize_t p): parent(v), pos(p) {} + const PIMap * parent; + ssize_t pos; + public: + iterator(): parent(0) {} + const Key & key() const {return const_cast * >(parent)->_key(pos);} + T & value() const {return const_cast * >(parent)->_value(pos);} + void operator ++() {++pos;} + void operator ++(int) {++pos;} + void operator --() {--pos;} + void operator --(int) {--pos;} + bool operator ==(const iterator & it) const {return (pos == it.pos);} + bool operator !=(const iterator & it) const {return (pos != it.pos);} + }; + + class reverse_iterator { + friend class PIMap; + private: + reverse_iterator(const PIMap * v, ssize_t p): parent(v), pos(p) {} + const PIMap * parent; + ssize_t pos; + public: + reverse_iterator(): parent(0) {} + const Key & key() const {return const_cast * >(parent)->_key(pos);} + T & value() const {return const_cast * >(parent)->_value(pos);} + void operator ++() {--pos;} + void operator ++(int) {--pos;} + void operator --() {++pos;} + void operator --(int) {++pos;} + bool operator ==(const reverse_iterator & it) const {return (pos == it.pos);} + bool operator !=(const reverse_iterator & it) const {return (pos != it.pos);} + }; + class const_iterator { friend class PIMap; private: @@ -78,12 +115,14 @@ public: public: const_iterator(): parent(0) {} const PIMap::value_type operator *() const {return parent->_pair(pos);} + const PIMap::value_type* operator ->() const {cval = parent->_pair(pos); return &cval;} void operator ++() {++pos;} void operator ++(int) {++pos;} void operator --() {--pos;} void operator --(int) {--pos;} bool operator ==(const const_iterator & it) const {return (pos == it.pos);} bool operator !=(const const_iterator & it) const {return (pos != it.pos);} + mutable value_type cval; }; class const_reverse_iterator { @@ -95,20 +134,22 @@ public: public: const_reverse_iterator(): parent(0) {} const PIMap::value_type operator *() const {return parent->_pair(pos);} + const PIMap::value_type* operator ->() const {cval = parent->_pair(pos); return &cval;} void operator ++() {--pos;} void operator ++(int) {--pos;} void operator --() {++pos;} void operator --(int) {++pos;} bool operator ==(const const_reverse_iterator & it) const {return (pos == it.pos);} bool operator !=(const const_reverse_iterator & it) const {return (pos != it.pos);} + mutable value_type cval; }; -// iterator begin() {return iterator(this, 0);} -// iterator end() {return iterator(this, size());} + iterator begin() {return iterator(this, 0);} + iterator end() {return iterator(this, size());} const_iterator begin() const {return const_iterator(this, 0);} const_iterator end() const {return const_iterator(this, size());} -// reverse_iterator rbegin() {return reverse_iterator(this, size() - 1);} -// reverse_iterator rend() {return reverse_iterator(this, -1);} + reverse_iterator rbegin() {return reverse_iterator(this, size() - 1);} + reverse_iterator rend() {return reverse_iterator(this, -1);} const_reverse_iterator rbegin() const {return const_reverse_iterator(this, size() - 1);} const_reverse_iterator rend() const {return const_reverse_iterator(this, -1);} @@ -126,6 +167,20 @@ public: return pim_content.back(); } const T operator [](const Key & key) const {bool f(false); ssize_t i = _find(key, f); if (f) return pim_content[pim_index[i].index]; return T();} + T & at(const Key & key) {return (*this)[key];} + const T at(const Key & key) const {return (*this)[key];} + + PIMap & operator <<(const PIMap & other) { + if (other.isEmpty()) return *this; + if (other.size() == 1) {insert(other.pim_index[0].key, other.pim_content[0]); return *this;} + if (other.size() == 2) {insert(other.pim_index[0].key, other.pim_content[0]); insert(other.pim_index[1].key, other.pim_content[1]); return *this;} + pim_content << other.pim_content; + size_t si = pim_index.size(); + for (int i = 0; i < other.pim_content.size_s(); ++i) + pim_index << MapIndex(other.pim_index[i].key, other.pim_index[i].index + si); + _sort(); + return *this; + } bool operator ==(const PIMap & t) const {return (pim_content == t.pim_content && pim_index == t.pim_index);} bool operator !=(const PIMap & t) const {return (pim_content != t.pim_content || pim_index != t.pim_index);} @@ -136,6 +191,8 @@ public: //PIMap & removeAll(const T & v) {for (llong i = 0; i < pim_size; ++i) if (pim_data[i] == v) {remove(i); --i;} return *this;} PIMap & removeOne(const Key & key) {bool f(false); ssize_t i = _find(key, f); if (f) _remove(i); return *this;} + PIMap & remove(const Key & key) {return removeOne(key);} + PIMap & erase(const Key & key) {return removeOne(key);} PIMap & clear() {pim_content.clear(); pim_index.clear(); return *this;} void swap(PIMap & other) { @@ -159,6 +216,13 @@ public: } //const T value(const Key & key, const T & default_ = T()) const {MapIndex * i = _find(key); if (i == 0) return default_; return pim_content[i->index];} const T value(const Key & key, const T & default_ = T()) const {bool f(false); ssize_t i = _find(key, f); if (!f) return default_; return pim_content[pim_index[i].index];} + Key key(const T & value_, const Key & default_ = Key()) const {for (int i = 0; i < pim_index.size_s(); ++i) if (pim_content[pim_index[i].index] == value_) return pim_index[i].key; return default_;} + PIVector keys() const { + PIVector ret; + for (int i = 0; i < pim_index.size_s(); ++i) + ret << pim_index[i].key; + return ret; + } void dump() { piCout << "PIMap" << size() << "entries" << NewLine << "content:"; @@ -174,8 +238,10 @@ private: MapIndex(Key k = Key(), size_t i = 0): key(k), index(i) {;} Key key; size_t index; - //bool operator <(const MapIndex & s) const {return key < s.key;} - //bool operator >(const MapIndex & s) const {return key > s.key;} + bool operator ==(const MapIndex & s) const {return key == s.key;} + bool operator !=(const MapIndex & s) const {return key != s.key;} + bool operator <(const MapIndex & s) const {return key < s.key;} + bool operator >(const MapIndex & s) const {return key > s.key;} }; ssize_t binarySearch(ssize_t first, ssize_t last, const Key & key, bool & found) const { @@ -184,10 +250,7 @@ private: mid = (first + last) / 2; if (key > pim_index[mid].key) first = mid + 1; else if (key < pim_index[mid].key) last = mid - 1; - else { - found = true; - return mid; - } + else {found = true; return mid;} } found = false; return first; @@ -225,16 +288,18 @@ private: //piCout << "_pair" << index << pim_index[index].index; return value_type(pim_index[index].key, pim_content[pim_index[index].index]); } + Key & _key(ssize_t index) {return pim_index[index].key;} + T & _value(ssize_t index) {return pim_content[pim_index[index].index];} PIVector pim_content; - PIVector pim_index; + PIDeque pim_index; }; //template bool operator <(const typename PIMap::MapIndex & f, const typename PIMap::MapIndex & s) {return f.key < s.key;} //template bool operator >(const typename PIMap::MapIndex & f, const typename PIMap::MapIndex & s) {return f.key > s.key;} -#define __PIMAP_SIMPLE_FUNCTIONS__(T) -/* template<> inline PIMap::~PIMap() {dealloc(); _reset();} \ +/*#define __PIMAP_SIMPLE_FUNCTIONS__(T) + template<> inline PIMap::~PIMap() {dealloc(); _reset();} \ template<> inline PIMap & PIMap::push_back(const T & v) {alloc(pim_size + 1); pim_data[pim_size - 1] = v; return *this;} \ template<> inline PIMap & PIMap::fill(const T & f) { \ for (size_t i = 0; i < pim_size; ++i) \ @@ -269,7 +334,7 @@ private: memmove(&(pim_data[index]), &(pim_data[index + count]), os * sizeof(T)); \ pim_size -= count; \ return *this; \ - }*/ + } __PIMAP_SIMPLE_FUNCTIONS__(char) __PIMAP_SIMPLE_FUNCTIONS__(uchar) @@ -283,7 +348,7 @@ __PIMAP_SIMPLE_FUNCTIONS__(llong) __PIMAP_SIMPLE_FUNCTIONS__(ullong) __PIMAP_SIMPLE_FUNCTIONS__(float) __PIMAP_SIMPLE_FUNCTIONS__(double) -__PIMAP_SIMPLE_FUNCTIONS__(ldouble) +__PIMAP_SIMPLE_FUNCTIONS__(ldouble)*/ #else @@ -301,7 +366,7 @@ public: int size_s() const {return static_cast(_stlc::size());} _CMap & insert(const Key & key_, const Type & value_) {_stlc::insert(_stlpair(key_, value_)); return *this;} _CMap & insert(PIPair entry_) {_stlc::insert(_stlpair(entry_.first, entry_.second)); return *this;} - Key key(Type value_) const {for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); i++) if (i->second == value_) return i->first; return Key();} + Key key(Type value_, const Key & default_ = Key()) const {for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); i++) if (i->second == value_) return i->first; return default_;} PIVector keys() const { PIVector ret; for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); i++) @@ -325,7 +390,7 @@ public: _CMultiMap & insert(PIPair entry_) {_stlc::insert(_stlpair(entry_.first, entry_.second)); return *this;} bool isEmpty() const {return _stlc::empty();} bool contains(const Key & key_) const {return _stlc::count(key_) > 0;} - Key key(Type value_) const {for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); i++) if (i->second == value_) return i->first; return Key();} + Key key(Type value_, const Key & default_ = Key()) const {for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); i++) if (i->second == value_) return i->first; return default_;} PIVector keys(Type value_) const { PIVector ret; for (typename _stlc::const_iterator i = _stlc::begin(); i != _stlc::end(); i++) diff --git a/pimath.h b/pimath.h index 1ad57bc3..86f8885f 100644 --- a/pimath.h +++ b/pimath.h @@ -23,7 +23,7 @@ #ifndef PIMATH_H #define PIMATH_H -#include "picontainers.h" +#include "pibytearray.h" #ifndef QNX # include # include @@ -94,10 +94,10 @@ const complexd complexd_i(0., 1.); const complexd complexd_0(0.); const complexd complexd_1(1.); -__PIVECTOR_SIMPLE_FUNCTIONS__(complexi) -__PIVECTOR_SIMPLE_FUNCTIONS__(complexf) -__PIVECTOR_SIMPLE_FUNCTIONS__(complexd) -__PIVECTOR_SIMPLE_FUNCTIONS__(complexld) +__PICONTAINERS_SIMPLE_TYPE__(complexi) +__PICONTAINERS_SIMPLE_TYPE__(complexf) +__PICONTAINERS_SIMPLE_TYPE__(complexd) +__PICONTAINERS_SIMPLE_TYPE__(complexld) const double deg2rad = M_PI_180; const double rad2deg = M_180_PI; @@ -165,6 +165,7 @@ class PIMathMatrixT; #define PIMV_FOR(v, s) for (uint v = s; v < Size; ++v) +#pragma pack(push, 1) template class PIP_EXPORT PIMathVectorT { typedef PIMathVectorT _CVector; @@ -190,7 +191,7 @@ public: Type angleRad(const _CVector & v) const {return acos(angleCos(v));} Type angleDeg(const _CVector & v) const {return toDeg(acos(angleCos(v)));} _CVector projection(const _CVector & v) {Type tv = v.length(); return (tv == Type(0) ? _CVector() : v * (((*this) ^ v) / tv));} - _CVector & normalize() {Type tv = length(); if (tv == Type(1)) return *this; PIMV_FOR(i, 0) c[i] /= tv; return *this;} + _CVector & normalize() {Type tv = length(); if (tv == Type(1)) return *this; if (piAbs(tv) <= Type(1E-100)) {fill(Type(0)); return *this;} PIMV_FOR(i, 0) c[i] /= tv; return *this;} _CVector normalized() {_CVector tv(*this); tv.normalize(); return tv;} bool isNull() const {PIMV_FOR(i, 0) if (c[i] != Type(0)) return false; return true;} bool isOrtho(const _CVector & v) const {return ((*this) ^ v) == Type(0);} @@ -199,7 +200,7 @@ public: Type at(uint index) const {return c[index];} Type & operator [](uint index) {return c[index];} Type operator [](uint index) const {return c[index];} - _CVector & operator =(const _CVector & v) {memcpy(&c, &(v.c), sizeof(Type) * Size); return *this;} + _CVector & operator =(const _CVector & v) {memcpy(c, v.c, sizeof(Type) * Size); return *this;} bool operator ==(const _CVector & v) const {PIMV_FOR(i, 0) if (c[i] != v[i]) return false; return true;} bool operator !=(const _CVector & v) const {return !(*this == c);} void operator +=(const _CVector & v) {PIMV_FOR(i, 0) c[i] += v[i];} @@ -233,6 +234,7 @@ private: Type c[Size]; }; +#pragma pack(pop) template inline std::ostream & operator <<(std::ostream & s, const PIMathVectorT & v) {s << '{'; PIMV_FOR(i, 0) {s << v[i]; if (i < Size - 1) s << ", ";} s << '}'; return s;} @@ -245,6 +247,11 @@ inline PIMathVectorT sqrt(const PIMathVectorT & v) {PIMa template inline PIMathVectorT sqr(const PIMathVectorT & v) {PIMathVectorT ret; PIMV_FOR(i, 0) {ret[i] = sqr(v[i]);} return ret;} +template +inline PIByteArray & operator <<(PIByteArray & s, const PIMathVectorT & v) {for (int i = 0; i < Size; ++i) s << v[i]; return s;} +template +inline PIByteArray & operator >>(PIByteArray & s, PIMathVectorT & v) {for (int i = 0; i < Size; ++i) s >> v[i]; return s;} + //template /// vector {Size0, Type0} to vector {Size1, Type1} //inline operator PIMathVectorT(const PIMathVectorT & v) {PIMathVectorT tv; uint sz = piMin(Size0, Size1); for (uint i = 0; i < sz; ++i) tv[i] = v[i]; return tv;} @@ -264,6 +271,7 @@ typedef PIMathVectorT<4u, double> PIMathVectorT4d; #define PIMM_FOR_C(v) for (uint v = 0; v < Cols; ++v) #define PIMM_FOR_R(v) for (uint v = 0; v < Rows; ++v) +#pragma pack(push, 1) template class PIP_EXPORT PIMathMatrixT { typedef PIMathMatrixT _CMatrix; @@ -299,7 +307,8 @@ public: Type & at(uint col, uint row) {return m[col][row];} Type at(uint col, uint row) const {return m[col][row];} Type * operator [](uint col) {return m[col];} - void operator =(const _CMatrix & sm) {memcpy(&m, &(sm.m), sizeof(Type) * Cols * Rows);} + const Type * operator [](uint col) const {return m[col];} + void operator =(const _CMatrix & sm) {memcpy(m, sm.m, sizeof(Type) * Cols * Rows);} bool operator ==(const _CMatrix & sm) const {PIMM_FOR_WB(c, r) if (m[c][r] != sm.m[c][r]) return false; return true;} bool operator !=(const _CMatrix & sm) const {return !(*this == sm);} void operator +=(const _CMatrix & sm) {PIMM_FOR_WB(c, r) m[c][r] += sm.m[c][r];} @@ -350,7 +359,7 @@ public: } } if (ok != 0) *ok = true; - m = smat.m; + memcpy(m, smat.m, sizeof(Type) * Cols * Rows); return *this; } @@ -407,7 +416,7 @@ public: } } if (ok != 0) *ok = true; - m = mtmp.m; + memcpy(m, mtmp.m, sizeof(Type) * Cols * Rows); return *this; } _CMatrix inverted(bool * ok = 0) {_CMatrix tm(*this); tm.invert(ok); return tm;} @@ -419,6 +428,7 @@ private: Type m[Cols][Rows]; }; +#pragma pack(pop) template<> inline PIMathMatrixT<2u, 2u> PIMathMatrixT<2u, 2u>::rotation(double angle) {double c = cos(angle), s = sin(angle); PIMathMatrixT<2u, 2u> tm; tm[0][0] = tm[1][1] = c; tm[0][1] = -s; tm[1][0] = s; return tm;} @@ -512,7 +522,7 @@ public: Type angleRad(const _CVector & v) const {return acos(angleCos(v));} Type angleDeg(const _CVector & v) const {return toDeg(acos(angleCos(v)));} _CVector projection(const _CVector & v) {Type tv = v.length(); return (tv == Type(0) ? _CVector() : v * (((*this) ^ v) / tv));} - _CVector & normalize() {Type tv = length(); if (tv == Type(1)) return *this; PIMV_FOR(i, 0) c[i] /= tv; return *this;} + _CVector & normalize() {Type tv = length(); if (tv == Type(1)) return *this; if (piAbs(tv) <= Type(1E-100)) {fill(Type(0)); return *this;} PIMV_FOR(i, 0) c[i] /= tv; return *this;} _CVector normalized() {_CVector tv(*this); tv.normalize(); return tv;} bool isNull() const {PIMV_FOR(i, 0) if (c[i] != Type(0)) return false; return true;} bool isOrtho(const _CVector & v) const {return ((*this) ^ v) == Type(0);} diff --git a/piobject.cpp b/piobject.cpp index 8a0843df..46d74ed5 100644 --- a/piobject.cpp +++ b/piobject.cpp @@ -55,7 +55,7 @@ handler A: event to event */ -PIObject::PIObject(const PIString & name) { +PIObject::PIObject(const PIString & name): emitter_(0) { piMonitor.objects++; setName(name); setDebug(true); diff --git a/piobject.h b/piobject.h index 77cf7bfe..e811c28a 100644 --- a/piobject.h +++ b/piobject.h @@ -26,6 +26,7 @@ #define PIOBJECT_H #include "pivariant.h" +#include "pimutex.h" #ifdef DOXYGEN @@ -258,7 +259,7 @@ public: PIVariant property(const PIString & name) const {if (!properties_.contains(name)) return PIVariant(); return properties_.value(name);} //! Set property with name "name" to "value". If there is no such property in object it will be added - void setProperty(const PIString & name, const PIVariant & value) {properties_[name] = value;} + void setProperty(const PIString & name, const PIVariant & value) {properties_[name] = value; propertyChanged(name);} //! Returns if property with name "name" exists bool isPropertyExists(const PIString & name) const {return properties_.contains(name);} @@ -373,7 +374,11 @@ public: for (int j = 0; j < sender->connections.size_s(); ++j) { Connection & i(sender->connections[j]); if (i.event != event) continue; + ((PIObject*)(i.dest))->mutex_.lock(); + ((PIObject*)(i.dest))->emitter_ = sender; ((void(*)(void * ))i.slot)(i.dest); + ((PIObject*)(i.dest))->emitter_ = 0; + ((PIObject*)(i.dest))->mutex_.unlock(); } } template @@ -381,7 +386,11 @@ public: for (int j = 0; j < sender->connections.size_s(); ++j) { Connection & i(sender->connections[j]); if (i.event != event) continue; + ((PIObject*)(i.dest))->mutex_.lock(); + ((PIObject*)(i.dest))->emitter_ = sender; ((void(*)(void * , T0))i.slot)(i.dest, v0); + ((PIObject*)(i.dest))->emitter_ = 0; + ((PIObject*)(i.dest))->mutex_.unlock(); } } template @@ -389,7 +398,11 @@ public: for (int j = 0; j < sender->connections.size_s(); ++j) { Connection & i(sender->connections[j]); if (i.event != event) continue; + ((PIObject*)(i.dest))->mutex_.lock(); + ((PIObject*)(i.dest))->emitter_ = sender; ((void(*)(void * , T0, T1))i.slot)(i.dest, v0, v1); + ((PIObject*)(i.dest))->emitter_ = 0; + ((PIObject*)(i.dest))->mutex_.unlock(); } } template @@ -397,7 +410,11 @@ public: for (int j = 0; j < sender->connections.size_s(); ++j) { Connection & i(sender->connections[j]); if (i.event != event) continue; + ((PIObject*)(i.dest))->mutex_.lock(); + ((PIObject*)(i.dest))->emitter_ = sender; ((void(*)(void * , T0, T1, T2))i.slot)(i.dest, v0, v1, v2); + ((PIObject*)(i.dest))->emitter_ = 0; + ((PIObject*)(i.dest))->mutex_.unlock(); } } template @@ -405,7 +422,11 @@ public: for (int j = 0; j < sender->connections.size_s(); ++j) { Connection & i(sender->connections[j]); if (i.event != event) continue; + ((PIObject*)(i.dest))->mutex_.lock(); + ((PIObject*)(i.dest))->emitter_ = sender; ((void(*)(void * , T0, T1, T2, T3))i.slot)(i.dest, v0, v1, v2, v3); + ((PIObject*)(i.dest))->emitter_ = 0; + ((PIObject*)(i.dest))->mutex_.unlock(); } } /* @@ -476,7 +497,7 @@ public: raiseEvent(name,dest , v0, v1, v2, v3); } - //! Returns PIObject* with name "name" or 0, if there is no objects found + //! Returns PIObject* with name "name" or 0, if there is no object found static PIObject * findByName(const PIString & name) { piForeach (PIObject * i, PIObject::objects) { if (i->name() != name) continue; @@ -486,6 +507,12 @@ public: }; protected: + + //! Returns PIObject* which has raised an event. This value is correct only in definition of some event handler + PIObject * emitter() const {return emitter_;} + + //! Virtual function executes after property with name "name" has been changed + virtual void propertyChanged(const PIString & name) {} private: struct Connection { @@ -500,6 +527,8 @@ private: PIMap properties_; static PIVector objects; + PIMutex mutex_; + PIObject * emitter_; }; diff --git a/pip.pro b/pip.pro index 6ac42c67..c6954533 100644 --- a/pip.pro +++ b/pip.pro @@ -52,7 +52,9 @@ HEADERS += \ pidiagnostics.h \ pibinarylog.h \ picodeparser.h \ - piusb.h + picodeinfo.h \ + piusb.h \ + piconnection.h SOURCES += main.cpp \ pivariant.cpp \ pitimer.cpp \ @@ -85,7 +87,9 @@ SOURCES += main.cpp \ pidiagnostics.cpp \ pibinarylog.cpp \ picodeparser.cpp \ - piusb.cpp + picodeinfo.cpp \ + piusb.cpp \ + piconnection.cpp win32 { LIBS += -lws2_32 -lIphlpapi } else { diff --git a/pip_resource_win.rc b/pip_resource_win.rc index 3e6fa186..660cbd18 100644 --- a/pip_resource_win.rc +++ b/pip_resource_win.rc @@ -19,7 +19,7 @@ VS_VERSION_INFO VERSIONINFO BEGIN VALUE "CompanyName", "Peri4\0" VALUE "FileDescription", "Platform-Independent Primitives\0" - VALUE "FileVersion", "0.4.0_prealpha\0" + VALUE "FileVersion", "0.4.0_beta2\0" VALUE "LegalCopyright", "\0" VALUE "OriginalFilename", "libpip.dll\0" VALUE "ProductName", "PIP\0" diff --git a/pipacketextractor.cpp b/pipacketextractor.cpp index 0392baf8..ee406b7c 100644 --- a/pipacketextractor.cpp +++ b/pipacketextractor.cpp @@ -60,13 +60,34 @@ REGISTER_DEVICE(PIPacketExtractor); -PIPacketExtractor::PIPacketExtractor(PIIODevice * device_, void * recHeaderPtr, int recHeaderSize, int recDataSize) { - ret_func_header = 0; - setPacketData(recHeaderPtr, recHeaderSize, recDataSize); +PIPacketExtractor::PIPacketExtractor(PIIODevice * device_, PIPacketExtractor::SplitMode mode) { + init_(); + setDevice(device_); + setSplitMode(mode); +} + + +void PIPacketExtractor::init_() { + ret_func_header = ret_func_footer = 0; + setPayloadSize(0); + setTimeout(100); setThreadedReadBufferSize(65536); setBufferSize(65536); - setDevice(device_); - allReaded = addSize = curInd = missed = 0; + setDevice(0); + setPacketSize(0); + setSplitMode(None); + allReaded = addSize = curInd = missed = footerInd = 0; + header_found = false; +} + + +void PIPacketExtractor::propertyChanged(const PIString &) { + packetSize_ = property("packetSize").toInt(); + mode_ = (SplitMode)(property("splitMode").toInt()); + dataSize = property("payloadSize").toInt(); + src_header = property("header").toByteArray(); + src_footer = property("footer").toByteArray(); + packetSize_hf = src_header.size_s() + src_footer.size_s() + payloadSize(); } @@ -76,55 +97,181 @@ void PIPacketExtractor::setDevice(PIIODevice * device_) { } +void PIPacketExtractor::setPayloadSize(int size) { + setProperty("payloadSize", size); + dataSize = size; + packetSize_hf = src_header.size_s() + src_footer.size_s() + payloadSize(); +} + + +void PIPacketExtractor::setHeader(const PIByteArray & data) { + setProperty("header", data); + src_header = data; + packetSize_hf = src_header.size_s() + src_footer.size_s() + payloadSize(); +} + + +void PIPacketExtractor::setFooter(const PIByteArray & data) { + setProperty("footer", data); + src_footer = data; + packetSize_hf = src_header.size_s() + src_footer.size_s() + payloadSize(); +} + + bool PIPacketExtractor::threadedRead(uchar * readed, int size_) { - memcpy(buffer.data(allReaded), readed, size_); - allReaded += size_; - while (allReaded >= packetSize + addSize && allReaded > 0) { - if (headerSize > 0) { - if (allReaded + curInd >= buffer_size) { - memcpy(sbuffer.data(), buffer.data(), buffer_size); - memcpy(buffer.data(), sbuffer.data(buffer_size - packetSize), allReaded); - allReaded = packetSize; - addSize = curInd = 0; + //piCout << "readed" << size_; + int ss; + switch (mode_) { + case PIPacketExtractor::None: + packetReceived(readed, size_); + break; + case PIPacketExtractor::Header: + tmpbuf.append(readed, size_); + ss = src_header.size_s() + dataSize; + while (tmpbuf.size_s() >= ss) { + while (!validateHeader(src_header.data(), tmpbuf.data(), src_header.size_s())) { + tmpbuf.pop_front(); + ++missed; + if (tmpbuf.size_s() < ss) return true; } - bool brk = false; - while (!packetHeaderValidate((uchar * )headerPtr, buffer.data(curInd), headerSize)) { - curInd++; missed++; - if (packetSize > 0) missed_packets = missed / packetSize; - if (curInd > addSize) { - addSize += packetSize; - brk = true; - break; + while (!validatePayload(tmpbuf.data(src_header.size_s()), dataSize)) { + tmpbuf.pop_front(); + ++missed; + if (tmpbuf.size_s() < ss) return true; + } + packetReceived(tmpbuf.data(), ss); + tmpbuf.remove(0, ss); + } + break; + case PIPacketExtractor::Footer: + /*memcpy(buffer.data(allReaded), readed, size_); + allReaded += size_; + footer_ = (mode_ == PIPacketExtractor::Footer); + while (allReaded >= packetSize_hf + addSize && allReaded > 0) { + if (!src_header.isEmpty()) { + if (allReaded + curInd >= buffer_size) { + memcpy(sbuffer.data(), buffer.data(), buffer_size); + memcpy(buffer.data(), sbuffer.data(buffer_size - packetSize_hf), allReaded); + allReaded = packetSize_hf; + addSize = curInd = 0; + } + bool brk = false; + while (!validateHeader((uchar * )(footer_ ? src_footer.data() : src_header.data()), buffer.data(curInd + (footer_ ? dataSize : 0)), footer_ ? src_footer.size_s() : src_header.size_s())) { + ++curInd; ++missed; + if (packetSize_hf > 0) missed_packets = missed / packetSize_hf; + if (curInd > addSize) { + addSize += packetSize_hf; + brk = true; + break; + } + } + if (brk) continue; + //memcpy(mheader.data(), buffer.data(curInd + (footer_ ? dataSize : 0)), src_header.size_s()); + if (!src_header.isEmpty()) memcpy(src_header.data(), buffer.data(curInd), src_header.size_s()); + if (!validatePayload(buffer.data(curInd + src_header.size_s()), dataSize)) { + ++curInd; ++missed; + if (packetSize_hf > 0) missed_packets = missed / packetSize_hf; + continue; + } + packetReceived(buffer.data(curInd), packetSize_hf); + memcpy(sbuffer.data(), buffer.data(), allReaded); + memcpy(buffer.data(), sbuffer.data(packetSize_hf + curInd), allReaded); + allReaded -= packetSize_hf + curInd; + curInd = addSize = 0; + } else { + if (dataSize == 0) { + if (validatePayload(buffer.data(), size_)) + packetReceived(buffer.data(), size_); + memcpy(sbuffer.data(), buffer.data(), allReaded); + memcpy(buffer.data(), sbuffer.data(size_), allReaded); + allReaded -= size_; + } else { + if (validatePayload(buffer.data(), dataSize)) + packetReceived(buffer.data(), dataSize); + memcpy(sbuffer.data(), buffer.data(), allReaded); + memcpy(buffer.data(), sbuffer.data(packetSize_hf), allReaded); + allReaded -= packetSize_hf; } } - if (brk) continue; - memcpy(mheader.data(), buffer.data(curInd), headerSize); - if (headerPtr != 0) memcpy(headerPtr, buffer.data(curInd), headerSize); - if (!packetValidate(buffer.data(curInd + headerSize), dataSize)) { - curInd++; missed++; - if (packetSize > 0) missed_packets = missed / packetSize; - continue; + }*/ + tmpbuf.append(readed, size_); + ss = src_footer.size_s() + dataSize; + while (tmpbuf.size_s() >= ss) { + while (!validateFooter(src_footer.data(), tmpbuf.data(dataSize), src_footer.size_s())) { + tmpbuf.pop_front(); + ++missed; + if (tmpbuf.size_s() < ss) return true; } - packetReceived(buffer.data(curInd), packetSize); - memcpy(sbuffer.data(), buffer.data(), allReaded); - memcpy(buffer.data(), sbuffer.data(packetSize + curInd), allReaded); - allReaded -= packetSize + curInd; - curInd = addSize = 0; - } else { - if (dataSize == 0) { - if (packetValidate(buffer.data(), size_)) - packetReceived(buffer.data(), size_); - memcpy(sbuffer.data(), buffer.data(), allReaded); - memcpy(buffer.data(), sbuffer.data(size_), allReaded); - allReaded -= size_; + while (!validatePayload(tmpbuf.data(), dataSize)) { + tmpbuf.pop_front(); + ++missed; + if (tmpbuf.size_s() < ss) return true; + } + packetReceived(tmpbuf.data(), ss); + tmpbuf.remove(0, ss); + } + break; + case PIPacketExtractor::HeaderAndFooter: + tmpbuf.append(readed, size_); + ss = src_header.size_s() + src_footer.size_s(); + while (tmpbuf.size_s() >= ss) { + if (!header_found) { + if (tmpbuf.size_s() < ss) return true; + while (!validateHeader(src_header.data(), tmpbuf.data(), src_header.size_s())) { + tmpbuf.pop_front(); + ++missed; + if (tmpbuf.size_s() < ss) return true; + } + header_found = true; + footerInd = src_header.size_s(); } else { - if (packetValidate(buffer.data(), dataSize)) - packetReceived(buffer.data(), dataSize); - memcpy(sbuffer.data(), buffer.data(), allReaded); - memcpy(buffer.data(), sbuffer.data(packetSize), allReaded); - allReaded -= packetSize; + if (tmpbuf.size_s() < footerInd + src_footer.size_s()) return true; + while (!validateFooter(src_footer.data(), tmpbuf.data(footerInd), src_footer.size_s())) { + ++footerInd; + if (tmpbuf.size_s() < footerInd + src_footer.size_s()) return true; + } + //piCout << "footer found at" << footerInd; + header_found = false; + if (!validatePayload(tmpbuf.data(src_header.size_s()), footerInd - src_header.size_s())) { + tmpbuf.pop_front(); + ++missed; + continue; + } + packetReceived(tmpbuf.data(), footerInd + src_footer.size_s()); + tmpbuf.remove(0, footerInd + src_footer.size_s()); + footerInd = src_header.size_s(); } } - } + break; + case PIPacketExtractor::Timeout: + memcpy(buffer.data(), readed, size_); + trbuf = dev->readForTime(time_); + memcpy(buffer.data(size_), trbuf.data(), trbuf.size()); + if (size_ + trbuf.size() > 0) + packetReceived(buffer.data(), size_ + trbuf.size()); + break; + case PIPacketExtractor::Size: + tmpbuf.append(readed, size_); + if (packetSize_ <= 0) { + tmpbuf.clear(); + return true; + } + while (tmpbuf.size_s() >= packetSize_) { + if (!validatePayload(tmpbuf.data(), packetSize_)) { + tmpbuf.pop_front(); + ++missed; + missed_packets = missed / packetSize_; + continue; + } + packetReceived(tmpbuf.data(), packetSize_); + tmpbuf.remove(0, packetSize_); + } + break; + }; return true; } + + +PIString PIPacketExtractor::constructFullPath() const { + return fullPathPrefix() + "://"; +} diff --git a/pipacketextractor.h b/pipacketextractor.h index 90d1efb4..024dd226 100644 --- a/pipacketextractor.h +++ b/pipacketextractor.h @@ -27,43 +27,66 @@ #include "piiodevice.h" // Pass data, recHeaderPtr, received_data, recHeaderSize. Return true if packet is correct nor return false. -typedef bool (*HeaderCheckFunc)(void * , uchar * , uchar * , int ); +typedef bool (*PacketExtractorCheckFunc)(void * , uchar * , uchar * , int ); class PIP_EXPORT PIPacketExtractor: public PIIODevice { PIIODEVICE(PIPacketExtractor) + friend class PIConnection; public: + enum SplitMode { + None, + Header, + Footer, + HeaderAndFooter, + Size, + Timeout + }; + //! Contructs extractor with child device "device_", header content pointer "recHeaderPtr", header size "recHeaderSize" and payload size "recDataSize" - PIPacketExtractor(PIIODevice * device_ = 0, void * recHeaderPtr = 0, int recHeaderSize = 0, int recDataSize = 0); + PIPacketExtractor(PIIODevice * device_ = 0, SplitMode mode = None); virtual ~PIPacketExtractor() {stop();} - + //! Returns child %device PIIODevice * device() {return dev;} //! Set child %device to "device_" void setDevice(PIIODevice * device_); - + //! Returns buffer size int bufferSize() const {return buffer_size;} //! Set buffer size to "new_size" bytes, should be at least greater than whole packet size void setBufferSize(int new_size) {buffer_size = new_size; buffer.resize(buffer_size); sbuffer.resize(buffer_size); memset(buffer.data(), 0, buffer.size()); memset(sbuffer.data(), 0, sbuffer.size());} - - void setHeaderCheckSlot(HeaderCheckFunc f) {ret_func_header = f;} - //! Set header content pointer "recHeaderPtr", header size "recHeaderSize" and payload size "recDataSize" - void setPacketData(void * recHeaderPtr, int recHeaderSize, int recDataSize) {headerPtr = recHeaderPtr; headerSize = recHeaderSize; dataSize = recDataSize; packetSize = headerSize + dataSize; if (headerSize > 0) mheader.resize(headerSize);} - + void setHeaderCheckSlot(PacketExtractorCheckFunc f) {ret_func_header = f;} + void setFooterCheckSlot(PacketExtractorCheckFunc f) {ret_func_footer = f;} + void setPayloadCheckSlot(ReadRetFunc f) {ret_func_ = f;} + + void setSplitMode(SplitMode mode) {setProperty("splitMode", int(mode)); mode_ = mode;} + void setPayloadSize(int size); + void setHeader(const PIByteArray & data); + void setFooter(const PIByteArray & data); + void setTimeout(double msecs) {setProperty("timeout", msecs); time_ = msecs;} + void setPacketSize(int size) {setProperty("packetSize", size); packetSize_ = size;} + + SplitMode splitMode() const {return (SplitMode)(property("splitMode").toInt());} + int payloadSize() const {return property("payloadSize").toInt();} + PIByteArray header() const {return src_header;} + PIByteArray footer() const {return src_footer;} + double timeout() const {return property("timeout").toDouble();} + int packetSize() const {return property("packetSize").toInt();} + //! Returns missed by validating functions bytes count ullong missedBytes() const {return missed;} //! Returns missed by validating functions packets count, = missedBytes() / packetSize - ullong missedPackets() const {if (packetSize == 0) return missed; return missed / packetSize;} + ullong missedPackets() const {/*if (packetSize_hf == 0) return missed; return missed / packetSize_hf*/; return missed_packets;} //! Returns pointer to \a missedBytes() count. Useful for output to PIConsole const ullong * missedBytes_ptr() const {return &missed;} @@ -82,6 +105,8 @@ public: //! Directly call \a write() function of child %device int write(const void * data, int max_size) {if (dev == 0) return -1; return dev->write(data, max_size);} + PIString constructFullPath() const; + EVENT2(packetReceived, uchar * , data, int, size) //! \events @@ -95,25 +120,40 @@ public: protected: /** \brief Function to validate header - * \param src Your header content passed from constructor or with function \a setPacketData() + * \param src Your header content * \param rec Received header * \param size Header size * \details Default implementation returns by-byte "src" with "rec" compare result */ - virtual bool packetHeaderValidate(uchar * src, uchar * rec, int size) {if (ret_func_header != 0) return ret_func_header(ret_data_, src, rec, size); for (int i = 0; i < size; ++i) if (src[i] != rec[i]) return false; return true;} + virtual bool validateHeader(uchar * src, uchar * rec, int size) {if (ret_func_header != 0) return ret_func_header(ret_data_, src, rec, size); for (int i = 0; i < size; ++i) if (src[i] != rec[i]) return false; return true;} + + /** \brief Function to validate footer + * \param src Your footer content + * \param rec Received footer + * \param size Footer size + * \details Default implementation returns by-byte "src" with "rec" compare result */ + virtual bool validateFooter(uchar * src, uchar * rec, int size) {if (ret_func_footer != 0) return ret_func_footer(ret_data_, src, rec, size); for (int i = 0; i < size; ++i) if (src[i] != rec[i]) return false; return true;} - //! Function to validate packet paylod after successfully header validate. Default implementation returns \b true - virtual bool packetValidate(uchar * rec, int size) {if (ret_func_ != 0) return ret_func_(ret_data_, rec, size); return true;} + /** \brief Function to validate payload + * \param rec Received payload + * \param size payload size + * \details Default implementation returns \b true */ + virtual bool validatePayload(uchar * rec, int size) {if (ret_func_ != 0) return ret_func_(ret_data_, rec, size); return true;} private: + void init_(); + void propertyChanged(const PIString & ); bool threadedRead(uchar * readed, int size); PIString fullPathPrefix() const {return "pckext";} bool openDevice() {if (dev == 0) return false; return dev->open();} PIIODevice * dev; - PIByteArray mheader, buffer, sbuffer; - HeaderCheckFunc ret_func_header; - void * headerPtr, * data; - int buffer_size, dataSize, headerSize, packetSize, allReaded, addSize, curInd; + PIByteArray mheader, buffer, sbuffer, tmpbuf, src_header, src_footer, trbuf; + PacketExtractorCheckFunc ret_func_header, ret_func_footer; + SplitMode mode_; + void * data; + int buffer_size, dataSize, packetSize_hf, allReaded, addSize, curInd, footerInd, packetSize_; + double time_; + bool header_found; ullong missed, missed_packets; diff --git a/piprotocol.cpp b/piprotocol.cpp index 4ba54bea..d4acb651 100644 --- a/piprotocol.cpp +++ b/piprotocol.cpp @@ -53,7 +53,8 @@ PIProtocol::PIProtocol(const PIString & config, const PIString & name_, void * r dataSize = recDataSize; sendDataPtr = (uchar * )sendDataPtr_; sendDataSize = sendDataSize_; - packet_ext->setPacketData(recHeaderPtr, recHeaderSize, recDataSize); + packet_ext->setHeader(PIByteArray(recHeaderPtr, recHeaderSize)); + packet_ext->setPayloadSize(recDataSize); } @@ -83,7 +84,7 @@ PIProtocol::~PIProtocol() { void PIProtocol::init() { - packet_ext = new PIPacketExtractor(); + packet_ext = new PIPacketExtractor(0, PIPacketExtractor::Header); packet_ext->setThreadedReadData(this); packet_ext->setThreadedReadSlot(receiveEvent); packet_ext->setHeaderCheckSlot(headerValidateEvent); @@ -94,6 +95,7 @@ void PIProtocol::init() { mp_owner = 0; net_diag = PIProtocol::Unknown; cur_pckt = 0; + packets[0] = packets[1] = pckt_cnt = pckt_cnt_max = 0; diagTimer = 0; timeout_ = 3.f; sendTimer = new PITimer(sendEvent, this); @@ -259,11 +261,11 @@ void PIProtocol::init_sender(PIConfig::Entry & b, PIConfig::Entry & sb, const PI } if (history_write_send) { history_path_send = sb.getValue("historyFile", "./history_" + protName + "_send_" + - date2string(currentDate(), "__dd_mm_yyyy_") + - time2string(currentTime(), "_hh_mm_ss_")).value(); + PIDate::current().toString("__dd_mm_yyyy_") + + PITime::current().toString("_hh_mm_ss_")).value(); history_id_send = sb.getValue("historyID", 0, &ok); if (!ok) { - history_id_send = protName.toByteArray().checksumCRC16() + 1; + history_id_send = ushort(protName.toByteArray().checksumPlain32()) + 1; piCoutObj << "Warning: no sender history ID defined, write with ID = " << history_id_send; } history_file_send.open(history_path_send, PIIODevice::WriteOnly); @@ -432,11 +434,11 @@ void PIProtocol::init_receiver(PIConfig::Entry & b, PIConfig::Entry & rb, const } if (history_write_rec) { history_path_rec = rb.getValue("historyFile", "./history_" + protName + "_rec_" + - date2string(currentDate(), "__dd_mm_yyyy_") + - time2string(currentTime(), "_hh_mm_ss_")).value(); + PIDate::current().toString("__dd_mm_yyyy_") + + PITime::current().toString("_hh_mm_ss_")).value(); history_id_rec = rb.getValue("historyID", 0, &ok); if (!ok) { - history_id_rec = protName.toByteArray().checksumCRC16(); + history_id_rec = ushort(protName.toByteArray().checksumPlain32()); piCoutObj << "Warning: no receiver history ID defined, write with ID = " << history_id_rec; } history_file_rec.open(history_path_rec, PIIODevice::WriteOnly); diff --git a/piprotocol.h b/piprotocol.h index 09064ea5..23cf6b78 100644 --- a/piprotocol.h +++ b/piprotocol.h @@ -100,8 +100,8 @@ public: EVENT_HANDLER0(void, stopReceive); void setExpectedFrequency(float frequency); // for connection quality diagnostic void setReceiverDevice(const PIString & device, PISerial::Speed speed, bool force = false); // for Serial - void setReceiverData(void * dataPtr, int dataSize) {this->dataPtr = (uchar * )dataPtr; this->dataSize = dataSize; packet_ext->setPacketData(headerPtr, headerSize, dataSize);} - void setReceiverDataHeader(void * headerPtr, int headerSize) {this->headerPtr = (uchar * )headerPtr; this->headerSize = headerSize; packet_ext->setPacketData(headerPtr, headerSize, dataSize);} + void setReceiverData(void * dataPtr, int dataSize) {this->dataPtr = (uchar * )dataPtr; this->dataSize = dataSize; packet_ext->setHeader(PIByteArray(headerPtr, headerSize)); packet_ext->setPayloadSize(dataSize);} + void setReceiverDataHeader(void * headerPtr, int headerSize) {this->headerPtr = (uchar * )headerPtr; this->headerSize = headerSize; packet_ext->setHeader(PIByteArray(headerPtr, headerSize)); packet_ext->setPayloadSize(dataSize);} void setReceiverAddress(const PIString & ip, int port, bool force = false); // for Ethernet void setReceiverParameters(PIFlags parameters) {if (type_rec == PIProtocol::Serial || type_send == PIProtocol::Serial) ser->setParameters(parameters);} // for Serial void setReceiveSlot(ReceiveFunc slot) {ret_func = slot;} diff --git a/piserial.cpp b/piserial.cpp index 825dc936..44fb89cb 100644 --- a/piserial.cpp +++ b/piserial.cpp @@ -344,7 +344,7 @@ PIByteArray PISerial::readData(int size, double timeout_ms) { bool PISerial::openDevice() { - piCout << "ser open" << path(); + //piCout << "ser open" << path(); if (path().isEmpty()) return false; #ifdef WINDOWS DWORD ds = 0, sm = 0; @@ -519,6 +519,19 @@ bool PISerial::configureDevice(const void * e_main, const void * e_parent) { } +PIString PISerial::constructFullPath() const { + PIString ret(fullPathPrefix() + "://"); + ret << path() << ":" << int(inSpeed()) << ":" << dataBitsCount(); + if (parameters()[ParityControl]) { + if (parameters()[ParityOdd]) ret << ":O"; + else ret << ":E"; + } else ret << ":N"; + if (parameters()[TwoStopBits]) ret << ":2"; + else ret << ":1"; + return ret; +} + + void PISerial::configureFromFullPath(const PIString & full_path) { PIStringList pl = full_path.split(":"); for (int i = 0; i < pl.size_s(); ++i) { @@ -553,9 +566,10 @@ PIStringList PISerial::availableDevices(bool test) { HKEY key = 0; RegOpenKey(HKEY_LOCAL_MACHINE, (LPCTSTR)"HARDWARE\\DEVICEMAP\\SERIALCOMM", &key); if (key != 0) { - char name[256], data[1024]; - DWORD name_len = 256, data_len = 1024, type = 0, index = 0; - while (RegEnumValue(key, index, (LPTSTR)name, &name_len, NULL, &type, (uchar * )data, &data_len) == ERROR_SUCCESS) { + char name[1024], data[1024]; + DWORD name_len = 1024, data_len = 1024, type = 0, index = 0; + LONG ret; + while ((ret = RegEnumValue(key, index, (LPTSTR)name, &name_len, NULL, &type, (uchar * )data, &data_len)) != ERROR_NO_MORE_ITEMS) { dl << PIString(data); index++; } diff --git a/piserial.h b/piserial.h index d2738b52..5d6ae328 100644 --- a/piserial.h +++ b/piserial.h @@ -241,6 +241,8 @@ public: //! \brief Write to device byte array "data" and wait for data written if "wait" is \b true. //! \returns \b true if sended bytes count = size of string bool send(const PIByteArray & data, bool wait = false) {return (write(data.data(), data.size_s(), wait) == data.size_s());} + + PIString constructFullPath() const; //! \brief Returns all available speeds for serial devices @@ -271,7 +273,7 @@ public: bool twoStopBits; #endif //! \} - + protected: PIString fullPathPrefix() const {return "ser";} void configureFromFullPath(const PIString & full_path); diff --git a/pistring.cpp b/pistring.cpp index 491345aa..12cc7407 100644 --- a/pistring.cpp +++ b/pistring.cpp @@ -155,8 +155,8 @@ PIString & PIString::operator +=(const wstring & str) { PIString & PIString::operator +=(const PIString & str) { - uint l = str.size(); - for (uint i = 0; i < l; ++i) push_back(str[i]); + //uint l = str.size(); + *((PIDeque*)this) << *((PIDeque*)&str); return *this; } @@ -208,23 +208,25 @@ bool PIString::operator >(const PIString & str) const { PIString PIString::mid(const int start, const int len) const { - PIString str; + //PIString str; int s = start, l = len; - if (l == 0) return str; + if (l == 0) return PIString(); if (s < 0) { l += s; s = 0; } if (l < 0) { - for (uint i = s; i < size(); ++i) - str += at(i); + //for (uint i = s; i < size(); ++i) + // str += at(i); + return PIString(&(at(s)), size() - s); } else { if (l > length() - s) l = length() - s; - for (int i = s; i < s + l; ++i) - str += at(i); + //for (int i = s; i < s + l; ++i) + // str += at(i); + return PIString(&(at(s)), l); } - return str; + return PIString(); } @@ -254,7 +256,9 @@ PIString & PIString::trim() { for (int i = length() - 1; i >= 0; --i) if (at(i) != ' ' && at(i) != '\t' && at(i) != '\n' && at(i) != '\r' && at(i) != char(12)) {fn = i; break;} - *this = mid(st, fn - st + 1); + //*this = mid(st, fn - st + 1); + if (fn < size_s() - 1) cutRight(size_s() - fn - 1); + if (st > 0) cutLeft(st); return *this; } @@ -281,6 +285,7 @@ PIString & PIString::replace(int from, int count, const PIString & with) { PIString & PIString::replace(const PIString & what, const PIString & with, bool * ok) { + //piCout << "replace" << what << with; if (what.isEmpty()) { if (ok != 0) *ok = false; return *this; @@ -301,8 +306,9 @@ PIString & PIString::replaceAll(const PIString & what, const PIString & with) { PIString & PIString::insert(int index, const PIString & str) { - uint c = str.length(); - for (uint i = 0; i < c; ++i) insert(index + i, str[i]); + //uint c = str.length(); + //for (uint i = 0; i < c; ++i) insert(index + i, str[i]); + PIDeque::insert(index, *((const PIDeque*)&str)); return *this; } @@ -740,10 +746,10 @@ PIStringList& PIStringList::removeDuplicates() { PIStringList l; PIString s; bool ae; - for (uint i = 0; i < size(); ++i) { + for (int i = 0; i < size_s(); ++i) { ae = false; s = at(i); - for (uint j = 0; j < l.size(); ++j) { + for (int j = 0; j < l.size_s(); ++j) { if (s != l[j]) continue; ae = true; break; } diff --git a/pistring.h b/pistring.h index fd1a1f95..2fce77c9 100644 --- a/pistring.h +++ b/pistring.h @@ -31,11 +31,11 @@ class PIStringList; -class PIP_EXPORT PIString: public PIVector +class PIP_EXPORT PIString: public PIDeque { public: //! Contructs an empty string - PIString(): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--;} + PIString(): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--;} //inline PIString & operator +=(const char c) {push_back(c); return *this;} PIString & operator +=(const PIChar & c) {push_back(c); return *this;} @@ -49,56 +49,59 @@ public: #endif //PIString(const char c) {*this += c;} - PIString(const PIString & o): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += o;} + PIString(const PIString & o): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += o;} //! Contructs string with single symbol "c" - PIString(const PIChar & c): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += c;} - PIString(const char c): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += PIChar(c);} + PIString(const PIChar & c): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += c;} + PIString(const char c): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += PIChar(c);} /*! \brief Contructs string from c-string "str" * \details "str" should be null-terminated\n * Example: \snippet pistring.cpp PIString(char * ) */ - PIString(const char * str): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += str;} + PIString(const char * str): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += str;} /*! \brief Contructs string from \c wchar_t c-string "str" * \details "str" should be null-terminated\n * Example: \snippet pistring.cpp PIString(wchar_t * ) */ - PIString(const wchar_t * str): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += str;} + PIString(const wchar_t * str): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += str;} //! Contructs string from std::string "str" - PIString(const string & str): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += str;} + PIString(const string & str): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += str;} #ifdef HAS_LOCALE - PIString(const wstring & str): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += str;} + PIString(const wstring & str): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += str;} #endif //! Contructs string from byte array "ba" - PIString(const PIByteArray & ba): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += ba;} + PIString(const PIByteArray & ba): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += ba;} + + //! \brief Contructs string from "len" characters of buffer "str" + PIString(const PIChar * str, const int len): PIDeque(str, size_t(len)) {/*reserve(256); */piMonitor.strings++; piMonitor.containers--;} /*! \brief Contructs string from "len" characters of buffer "str" * \details Example: \snippet pistring.cpp PIString(char * , int) */ - PIString(const char * str, const int len): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += string(str, len);} + PIString(const char * str, const int len): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this += string(str, len);} /*! \brief Contructs string as sequence of characters "c" of buffer with length "len" * \details Example: \snippet pistring.cpp PIString(int, char) */ - PIString(const int len, const char c): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; for (int i = 0; i < len; ++i) push_back(c);} + PIString(const int len, const char c): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; for (int i = 0; i < len; ++i) push_back(c);} /*! \brief Contructs string as sequence of symbols "c" of buffer with length "len" * \details Example: \snippet pistring.cpp PIString(int, PIChar) */ - PIString(const int len, const PIChar & c): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; for (int i = 0; i < len; ++i) push_back(c);} + PIString(const int len, const PIChar & c): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; for (int i = 0; i < len; ++i) push_back(c);} - PIString(const short & value): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} - PIString(const ushort & value): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} - PIString(const int & value): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} - PIString(const uint & value): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} - PIString(const long & value): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} - PIString(const ulong & value): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} - PIString(const llong & value): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} - PIString(const ullong & value): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} - PIString(const float & value): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} - PIString(const double & value): PIVector() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} + PIString(const short & value): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} + PIString(const ushort & value): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} + PIString(const int & value): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} + PIString(const uint & value): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} + PIString(const long & value): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} + PIString(const ulong & value): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} + PIString(const llong & value): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} + PIString(const ullong & value): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} + PIString(const float & value): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} + PIString(const double & value): PIDeque() {/*reserve(256); */piMonitor.strings++; piMonitor.containers--; *this = fromNumber(value);} //~PIString() {piMonitor.strings--; piMonitor.containers++;} @@ -119,7 +122,7 @@ public: //! Return symbol at index "pos" PIChar operator [](const int pos) const {return at(pos);} - //! Return const reference symbol at index "pos" + //! Return reference to symbol at index "pos" PIChar & operator [](const int pos) {return at(pos);} //! Compare operator @@ -241,14 +244,20 @@ public: /*! \brief Append string representation of "num" at the end of string * \details Example: \snippet pistring.cpp PIString::<<(int) */ PIString & operator <<(const int & num) {*this += PIString::fromNumber(num); return *this;} + PIString & operator <<(const uint & num) {*this += PIString::fromNumber(num); return *this;} /*! \brief Append string representation of "num" at the end of string * \details Example: \snippet pistring.cpp PIString::<<(int) */ PIString & operator <<(const short & num) {*this += PIString::fromNumber(num); return *this;} + PIString & operator <<(const ushort & num) {*this += PIString::fromNumber(num); return *this;} /*! \brief Append string representation of "num" at the end of string * \details Example: \snippet pistring.cpp PIString::<<(int) */ PIString & operator <<(const long & num) {*this += PIString::fromNumber(num); return *this;} + PIString & operator <<(const ulong & num) {*this += PIString::fromNumber(num); return *this;} + + PIString & operator <<(const llong & num) {*this += PIString::fromNumber(num); return *this;} + PIString & operator <<(const ullong & num) {*this += PIString::fromNumber(num); return *this;} /*! \brief Append string representation of "num" at the end of string * \details Example: \snippet pistring.cpp PIString::<<(int) */ @@ -257,6 +266,13 @@ public: /*! \brief Append string representation of "num" at the end of string * \details Example: \snippet pistring.cpp PIString::<<(int) */ PIString & operator <<(const double & num) {*this += PIString::fromNumber(num); return *this;} + + + //! \brief Insert string "str" at the begin of string + PIString & prepend(const PIString & str) {insert(0, str); return *this;} + + //! \brief Insert string "str" at the end of string + PIString & append(const PIString & str) {*this += str; return *this;} /*! \brief Return part of string from symbol at index "start" and maximum length "len" @@ -330,9 +346,17 @@ public: PIString & replaceAll(const PIString & what, const PIString & with); PIString replaceAll(const PIString & what, const PIString & with) const {PIString str(*this); str.replaceAll(what, with); return str;} + /*! \brief Repeat content of string "times" times and return this string + * \details Example: \snippet pistring.cpp PIString::repeat */ + PIString & repeat(int times) {PIString ss(*this); times--; piForTimes (times) *this += ss; return *this;} + + /*! \brief Returns repeated "times" times string + * \details Example: \snippet pistring.cpp PIString::repeated */ + PIString repeated(int times) const {PIString ss(*this); return ss.repeat(times);} + /*! \brief Insert symbol "c" after index "index" and return this string * \details Example: \snippet pistring.cpp PIString::insert_0 */ - PIString & insert(const int index, const PIChar & c) {PIVector::insert(index, c); return *this;} + PIString & insert(const int index, const PIChar & c) {PIDeque::insert(index, c); return *this;} /*! \brief Insert symbol "c" after index "index" and return this string * \details Example: \snippet pistring.cpp PIString::insert_1 */ @@ -494,11 +518,11 @@ public: //! \details Example: \snippet pistring.cpp PIString::findLast int findLast(const string str, const int start = 0) const {return findLast(PIString(str), start);} - //! \brief Search word "word" from symbol at index "start" and return last occur position. + //! \brief Search word "word" from symbol at index "start" and return first occur position. //! \details Example: \snippet pistring.cpp PIString::findWord int findWord(const PIString & word, const int start = 0) const; - //! \brief Search C-style word "word" from symbol at index "start" and return last occur position. + //! \brief Search C-style word "word" from symbol at index "start" and return first occur position. //! \details Example: \snippet pistring.cpp PIString::findCWord int findCWord(const PIString & word, const int start = 0) const; @@ -801,7 +825,7 @@ inline char chrLwr(char c); /*!\brief Strings array class * \details This class is based on \a PIVector and * expand it functionality. */ -class PIP_EXPORT PIStringList: public PIVector +class PIP_EXPORT PIStringList: public PIDeque { public: @@ -820,7 +844,7 @@ public: //! Contructs empty strings list with strings "s0", "s1", "s2" and "s3" PIStringList(const PIString & s0, const PIString & s1, const PIString & s2, const PIString & s3) {push_back(s0); push_back(s1); push_back(s2); push_back(s3);} - PIStringList(const PIStringList & o): PIVector() {resize(o.size()); for (uint i = 0; i < size(); ++i) (*this)[i] = o[i];} + PIStringList(const PIStringList & o): PIDeque() {resize(o.size()); for (uint i = 0; i < size(); ++i) (*this)[i] = o[i];} //! \brief Join all strings in one with delimiter "delim" and return it @@ -831,14 +855,14 @@ public: //! \details Example: \snippet pistring.cpp PIStringList::removeStrings PIStringList & removeStrings(const PIString & value) {for (uint i = 0; i < size(); ++i) {if (at(i) == value) {remove(i); --i;}} return *this;} - PIStringList & remove(uint num) {PIVector::remove(num); return *this;} - PIStringList & remove(uint num, uint count) {PIVector::remove(num, count); return *this;} + PIStringList & remove(uint num) {PIDeque::remove(num); return *this;} + PIStringList & remove(uint num, uint count) {PIDeque::remove(num, count); return *this;} //! \brief Remove duplicated strings and return this //! \details Example: \snippet pistring.cpp PIStringList::removeDuplicates PIStringList & removeDuplicates(); - //! \brief + //! \brief Trim all strings //! \details Example: \snippet pistring.cpp PIStringList::trim PIStringList & trim() {for (uint i = 0; i < size(); ++i) at(i).trim(); return *this;} diff --git a/pitime.cpp b/pitime.cpp index 93a46ae6..bbfdd230 100644 --- a/pitime.cpp +++ b/pitime.cpp @@ -114,7 +114,7 @@ bool operator >(const PIDateTime & t0, const PIDateTime & t1) { } -PITime currentTime() { +PITime PITime::current() { time_t rt = time(0); tm * pt = localtime(&rt); PITime t; @@ -125,7 +125,7 @@ PITime currentTime() { } -PIDate currentDate() { +PIDate PIDate::current() { time_t rt = time(0); tm * pt = localtime(&rt); PIDate d; @@ -136,7 +136,7 @@ PIDate currentDate() { } -PIDateTime currentDateTime() { +PIDateTime PIDateTime::current() { time_t rt = time(0); tm * pt = localtime(&rt); PIDateTime dt; @@ -151,7 +151,7 @@ PIDateTime currentDateTime() { } -PISystemTime currentSystemTime() { +PISystemTime PISystemTime::current() { #ifdef WINDOWS FILETIME ft, sft; GetSystemTimeAsFileTime(&ft); diff --git a/pitime.h b/pitime.h index d8a00680..660bebe4 100644 --- a/pitime.h +++ b/pitime.h @@ -141,6 +141,9 @@ public: //! Contructs system time from nanoseconds "v" static PISystemTime fromNanoseconds(double v) {long s = piFloord(v / 1000000000.); return PISystemTime(s, (v / 1000000000. - s) * 1000000000);} + //! Returns current system time + static PISystemTime current(); + //! Seconds of stored system time long seconds; @@ -169,6 +172,7 @@ struct PIP_EXPORT PITime { int minutes; int hours; PIString toString(const PIString & format = "h:mm:ss") const; + static PITime current(); }; PIP_EXPORT bool operator ==(const PITime & t0, const PITime & t1); PIP_EXPORT bool operator <(const PITime & t0, const PITime & t1); @@ -183,6 +187,7 @@ struct PIP_EXPORT PIDate { int month; int year; PIString toString(const PIString & format = "d.MM.yyyy") const; + static PIDate current(); }; PIP_EXPORT bool operator ==(const PIDate & t0, const PIDate & t1); PIP_EXPORT bool operator <(const PIDate & t0, const PIDate & t1); @@ -212,6 +217,7 @@ struct PIP_EXPORT PIDateTime { void operator -=(const PIDateTime & d1) {year -= d1.year; month -= d1.month; day -= d1.day; hours -= d1.hours; minutes -= d1.minutes; seconds -= d1.seconds; normalize();} static PIDateTime fromSecondSinceEpoch(const time_t sec); static PIDateTime fromSystemTime(const PISystemTime & st) {PIDateTime dt = fromSecondSinceEpoch(st.seconds); dt.milliseconds = piClampi(st.nanoseconds / 1000000, 0, 999); return dt;} + static PIDateTime current(); }; inline PIDateTime operator +(const PIDateTime & d0, const PIDateTime & d1) {PIDateTime td = d0; td += d1; return td.normalized();} inline PIDateTime operator -(const PIDateTime & d0, const PIDateTime & d1) {PIDateTime td = d0; td -= d1; return td.normalized();} @@ -222,14 +228,14 @@ inline bool operator !=(const PIDateTime & t0, const PIDateTime & t1) {return !( inline bool operator <=(const PIDateTime & t0, const PIDateTime & t1) {return !(t0 > t1);} inline bool operator >=(const PIDateTime & t0, const PIDateTime & t1) {return !(t0 < t1);} -PIP_EXPORT PITime currentTime(); -PIP_EXPORT PIDate currentDate(); -PIP_EXPORT PIDateTime currentDateTime(); +DEPRECATED inline PITime currentTime() {return PITime::current();} // obsolete, use PITime::current() instead +DEPRECATED inline PIDate currentDate() {return PIDate::current();} // obsolete, use PIDate::current() instead +DEPRECATED inline PIDateTime currentDateTime() {return PIDateTime::current();} // obsolete, use PIDateTime::current() instead //! \relatesalso PISystemTime \brief Returns current system time -PIP_EXPORT PISystemTime currentSystemTime(); -PIP_EXPORT PIString time2string(const PITime & time, const PIString & format = "h:mm:ss"); // obsolete, use PITime.toString() instead -PIP_EXPORT PIString date2string(const PIDate & date, const PIString & format = "d.MM.yyyy"); // obsolete, use PITime.toString() instead -PIP_EXPORT PIString datetime2string(const PIDateTime & datetime, const PIString & format = "h:mm:ss d.MM.yyyy"); // obsolete, use PIDateTime.toString() instead +DEPRECATED inline PISystemTime currentSystemTime() {return PISystemTime::current();} // obsolete, use PISystemTime::current() instead +DEPRECATED PIP_EXPORT PIString time2string(const PITime & time, const PIString & format = "h:mm:ss"); // obsolete, use PITime.toString() instead +DEPRECATED PIP_EXPORT PIString date2string(const PIDate & date, const PIString & format = "d.MM.yyyy"); // obsolete, use PITime.toString() instead +DEPRECATED PIP_EXPORT PIString datetime2string(const PIDateTime & datetime, const PIString & format = "h:mm:ss d.MM.yyyy"); // obsolete, use PIDateTime.toString() instead #endif // PITIME_H diff --git a/pitimer.cpp b/pitimer.cpp index e7afed4a..9d2248df 100644 --- a/pitimer.cpp +++ b/pitimer.cpp @@ -309,7 +309,7 @@ void PITimer::start(double msecs) { if (msecs < 0 || running_) return; interval_ = msecs; inc_time = PISystemTime::fromMilliseconds(msecs); - st_time = currentSystemTime() + inc_time; + st_time = PISystemTime::current() + inc_time; deferred_ = false; running_ = true; PIThread::start(); @@ -320,9 +320,9 @@ void PITimer::deferredStart(double interval_msecs, double delay_msecs) { //piCoutObj << "defStart exec with" << delay_msecs << interval_msecs; if (interval_msecs < 0 || running_) return; interval_ = interval_msecs; - PISystemTime cst = currentSystemTime(); + PISystemTime cst = PISystemTime::current(); inc_time = PISystemTime::fromMilliseconds(interval_msecs); - st_time = currentSystemTime() + PISystemTime::fromMilliseconds(delay_msecs); + st_time = PISystemTime::current() + PISystemTime::fromMilliseconds(delay_msecs); if (st_time < cst) st_time = cst; running_ = deferred_ = true; PIThread::start(); @@ -334,7 +334,7 @@ void PITimer::deferredStart(double interval_msecs, const PIDateTime & start_date //piCoutObj << "defStart exec to" << start_datetime.toString() << interval_msecs; if (interval_msecs < 0 || running_) return; interval_ = interval_msecs; - PISystemTime cst = currentSystemTime(); + PISystemTime cst = PISystemTime::current(); inc_time = PISystemTime::fromMilliseconds(interval_msecs); st_time = start_datetime.toSystemTime(); if (st_time < cst) st_time = cst; @@ -347,7 +347,7 @@ void PITimer::deferredStart(double interval_msecs, const PIDateTime & start_date void PITimer::run() { if (!running_) return; while (deferred_) { - PISystemTime tst = st_time - currentSystemTime(); + PISystemTime tst = st_time - PISystemTime::current(); if (tst.seconds > 0) { piMSleep(100); if (!running_) return; @@ -365,7 +365,7 @@ void PITimer::run() { #ifdef WINDOWS tt_st = __PIQueryPerformanceCounter(); #else - (st_time - currentSystemTime()).sleep(); + (st_time - PISystemTime::current()).sleep(); st_time += inc_time; #endif //if (lockRun) lock(); diff --git a/piusb.cpp b/piusb.cpp index 393e27b1..d1f6decb 100644 --- a/piusb.cpp +++ b/piusb.cpp @@ -388,6 +388,13 @@ PICout operator<<(PICout s, const PIUSB::Endpoint & v) { } +PIString PIUSB::constructFullPath() const { + PIString ret(fullPathPrefix() + "://"); + ret << PIString::fromNumber(vendorID(), 16).toLowerCase() << ":" << PIString::fromNumber(productID(), 16).toLowerCase() << ":" << deviceNumber() << ":" << endpointRead().address << ":" << endpointWrite().address; + return ret; +} + + void PIUSB::configureFromFullPath(const PIString & full_path) { PIStringList pl = full_path.split(":"); for (int i = 0; i < pl.size_s(); ++i) { diff --git a/piusb.h b/piusb.h index 0e68924f..437c1b5b 100644 --- a/piusb.h +++ b/piusb.h @@ -100,8 +100,8 @@ public: int deviceNumber() const {return property("deviceNumber").toInt();} int timeoutRead() const {return property("timeoutRead").toInt();} int timeoutWrite() const {return property("timeoutWrite").toInt();} - const PIUSB::Endpoint & endpointRead() {return ep_read;} - const PIUSB::Endpoint & endpointWrite() {return ep_write;} + const PIUSB::Endpoint & endpointRead() const {return ep_read;} + const PIUSB::Endpoint & endpointWrite() const {return ep_write;} const PIVector & endpoints() const {return eps;} PIVector endpointsRead(); @@ -126,6 +126,8 @@ public: void flush(); + PIString constructFullPath() const; + protected: PIString fullPathPrefix() const {return "usb";} void configureFromFullPath(const PIString & full_path); diff --git a/pivariant.cpp b/pivariant.cpp index f1761236..e9a4424a 100644 --- a/pivariant.cpp +++ b/pivariant.cpp @@ -20,13 +20,42 @@ #include "pivariant.h" +/** \class PIVariant + * \brief Variant type + * \details + * \section PIVariant_sec0 Synopsis + * This class provides general type that can contains all standard types, some + * PIP types or custom type. In case of standard types this class also provides + * convertions between them. + * + * \section PIVariant_sec1 Usage + * %PIVariant useful if you want pass many variables with different types in + * single array, e.g.: + * \code{cpp} + * PIVector array; + * array << PIVariant(10) << PIVariant(1.61) << PIVariant(true) << PIVariant("0xFF"); + * piCout << array; + * piForeachC (PIVariant & i, array) + * piCout << i.toInt(); + * \endcode + * Result: + * \code{cpp} + * {PIVariant(Int, 10), PIVariant(Double, 1,61), PIVariant(Bool, true), PIVariant(String, 0xFF)} + * 10 + * 1 + * 1 + * 255 + * \endcode + * */ + + PIVariant::PIVariant() { type_ = PIVariant::Invalid; memset(_vraw, 0, __PIVARIANT_UNION_SIZE__); } -void PIVariant::operator =(const PIVariant & v) { +PIVariant & PIVariant::operator =(const PIVariant & v) { type_ = v.type_; memcpy(_vraw, v._vraw, __PIVARIANT_UNION_SIZE__); _vbytearray = v._vbytearray; @@ -34,6 +63,7 @@ void PIVariant::operator =(const PIVariant & v) { _vstring = v._vstring; _vstringlist = v._vstringlist; _vcustom = v._vcustom; + return *this; } @@ -134,6 +164,12 @@ PIString PIVariant::typeName(PIVariant::Type type) { } +/** \brief Returns variant content as boolean + * \details In case of numeric types returns \b true if value != 0. \n + * In case of String type returns \a PIString::toBool(). \n + * In case of StringList type returns \b false if string list is empty, + * otherwise returns \a PIString::toBool() of first string. \n + * In case of other types returns \b false. */ bool PIVariant::toBool() const { switch (type_) { case PIVariant::Bool: @@ -160,6 +196,13 @@ bool PIVariant::toBool() const { } + +/** \brief Returns variant content as int + * \details In case of numeric types returns integer value. \n + * In case of String type returns \a PIString::toInt(). \n + * In case of StringList type returns \b 0 if string list is empty, + * otherwise returns \a PIString::toInt() of first string. \n + * In case of other types returns \b 0. */ int PIVariant::toInt() const { switch (type_) { case PIVariant::Bool: @@ -179,13 +222,19 @@ int PIVariant::toInt() const { case PIVariant::Complexd: return _vcomplexd.real(); case PIVariant::Complexld: return _vcomplexld.real(); case PIVariant::String: return _vstring.toInt(); - case PIVariant::StringList: if (_vstringlist.isEmpty()) return false; return _vstringlist.front().toInt(); + case PIVariant::StringList: if (_vstringlist.isEmpty()) return 0; return _vstringlist.front().toInt(); default: break; } return 0; } +/** \brief Returns variant content as long long + * \details In case of numeric types returns integer value. \n + * In case of String type returns \a PIString::toLLong(). \n + * In case of StringList type returns \b 0L if string list is empty, + * otherwise returns \a PIString::toLLong() of first string. \n + * In case of other types returns \b 0L. */ llong PIVariant::toLLong() const { switch (type_) { case PIVariant::Bool: @@ -205,13 +254,19 @@ llong PIVariant::toLLong() const { case PIVariant::Complexd: return _vcomplexd.real(); case PIVariant::Complexld: return _vcomplexld.real(); case PIVariant::String: return _vstring.toLLong(); - case PIVariant::StringList: if (_vstringlist.isEmpty()) return false; return _vstringlist.front().toLLong(); + case PIVariant::StringList: if (_vstringlist.isEmpty()) return 0L; return _vstringlist.front().toLLong(); default: break; } return 0L; } +/** \brief Returns variant content as float + * \details In case of numeric types returns float value. \n + * In case of String type returns \a PIString::toFloat(). \n + * In case of StringList type returns \b 0.f if string list is empty, + * otherwise returns \a PIString::toFloat() of first string. \n + * In case of other types returns \b 0.f. */ float PIVariant::toFloat() const { switch (type_) { case PIVariant::Bool: @@ -231,13 +286,19 @@ float PIVariant::toFloat() const { case PIVariant::Complexd: return _vcomplexd.real(); case PIVariant::Complexld: return _vcomplexld.real(); case PIVariant::String: return _vstring.toFloat(); - case PIVariant::StringList: if (_vstringlist.isEmpty()) return false; return _vstringlist.front().toFloat(); + case PIVariant::StringList: if (_vstringlist.isEmpty()) return 0.f; return _vstringlist.front().toFloat(); default: break; } return 0.f; } +/** \brief Returns variant content as double + * \details In case of numeric types returns double value. \n + * In case of String type returns \a PIString::toDouble(). \n + * In case of StringList type returns \b 0. if string list is empty, + * otherwise returns \a PIString::toDouble() of first string. \n + * In case of other types returns \b 0.. */ double PIVariant::toDouble() const { switch (type_) { case PIVariant::Bool: @@ -257,13 +318,19 @@ double PIVariant::toDouble() const { case PIVariant::Complexd: return _vcomplexd.real(); case PIVariant::Complexld: return _vcomplexld.real(); case PIVariant::String: return _vstring.toDouble(); - case PIVariant::StringList: if (_vstringlist.isEmpty()) return false; return _vstringlist.front().toDouble(); + case PIVariant::StringList: if (_vstringlist.isEmpty()) return 0.; return _vstringlist.front().toDouble(); default: break; } return 0.; } +/** \brief Returns variant content as long double + * \details In case of numeric types returns long double value. \n + * In case of String type returns \a PIString::toLDouble(). \n + * In case of StringList type returns \b 0. if string list is empty, + * otherwise returns \a PIString::toLDouble() of first string. \n + * In case of other types returns \b 0.. */ ldouble PIVariant::toLDouble() const { switch (type_) { case PIVariant::Bool: @@ -283,13 +350,19 @@ ldouble PIVariant::toLDouble() const { case PIVariant::Complexd: return _vcomplexd.real(); case PIVariant::Complexld: return _vcomplexld.real(); case PIVariant::String: return _vstring.toLDouble(); - case PIVariant::StringList: if (_vstringlist.isEmpty()) return false; return _vstringlist.front().toLDouble(); + case PIVariant::StringList: if (_vstringlist.isEmpty()) return 0.; return _vstringlist.front().toLDouble(); default: break; } return 0.; } +/** \brief Returns variant content as complex + * \details In case of numeric types returns complex value. \n + * In case of String type returns \a PIString::toDouble(). \n + * In case of StringList type returns \b 0. if string list is empty, + * otherwise returns \a PIString::toDouble() of first string. \n + * In case of other types returns \b 0.. */ complexd PIVariant::toComplexd() const { switch (type_) { case PIVariant::Bool: @@ -309,13 +382,19 @@ complexd PIVariant::toComplexd() const { case PIVariant::Complexd: return _vcomplexd.real(); case PIVariant::Complexld: return _vcomplexld.real(); case PIVariant::String: return _vstring.toDouble(); - case PIVariant::StringList: if (_vstringlist.isEmpty()) return false; return _vstringlist.front().toDouble(); + case PIVariant::StringList: if (_vstringlist.isEmpty()) return complexd_0; return _vstringlist.front().toDouble(); default: break; } return complexd_0; } +/** \brief Returns variant content as long complex + * \details In case of numeric types returns long complex value. \n + * In case of String type returns \a PIString::toLDouble(). \n + * In case of StringList type returns \b 0. if string list is empty, + * otherwise returns \a PIString::toLDouble() of first string. \n + * In case of other types returns \b 0.. */ complexld PIVariant::toComplexld() const { switch (type_) { case PIVariant::Bool: @@ -335,13 +414,17 @@ complexld PIVariant::toComplexld() const { case PIVariant::Complexd: return _vcomplexd.real(); case PIVariant::Complexld: return _vcomplexld.real(); case PIVariant::String: return _vstring.toLDouble(); - case PIVariant::StringList: if (_vstringlist.isEmpty()) return false; return _vstringlist.front().toLDouble(); + case PIVariant::StringList: if (_vstringlist.isEmpty()) return complexld_0; return _vstringlist.front().toLDouble(); default: break; } return complexld_0; } +/** \brief Returns variant content as time + * \details In case of Time type returns time value. \n + * In case of DateTime type returns time part of value. \n + * In case of other types returns \a PITime(). */ PITime PIVariant::toTime() const { if (type_ == PIVariant::Time) return _vtime; if (type_ == PIVariant::DateTime) return _vtime; @@ -349,6 +432,10 @@ PITime PIVariant::toTime() const { } +/** \brief Returns variant content as date + * \details In case of Date type returns date value. \n + * In case of DateTime type returns date part of value. \n + * In case of other types returns \a PIDate(). */ PIDate PIVariant::toDate() const { if (type_ == PIVariant::Date) return _vdate; if (type_ == PIVariant::DateTime) return *((PIDate*)(&(_vdatetime.day))); @@ -356,6 +443,11 @@ PIDate PIVariant::toDate() const { } +/** \brief Returns variant content as date and time + * \details In case of Time type returns time value with null date. \n + * In case of Date type returns date value with null time. \n + * In case of DateTime type returns date and time. \n + * In case of other types returns \a PIDateTime(). */ PIDateTime PIVariant::toDateTime() const { if (type_ == PIVariant::DateTime) return _vdatetime; if (type_ == PIVariant::Time) return PIDateTime(_vtime); @@ -364,12 +456,25 @@ PIDateTime PIVariant::toDateTime() const { } +/** \brief Returns variant content as system time + * \details In case of SystemTime type returns system time. \n + * In case of other types returns \a PISystemTime::fromSeconds() from + * double value of variant content. */ PISystemTime PIVariant::toSystemTime() const { if (type_ == PIVariant::SystemTime) return _vsystime; return PISystemTime::fromSeconds(toDouble()); } +/** \brief Returns variant content as string + * \details In case of numeric types returns \a PIString::fromNumber(). \n + * In case of String type returns string value. \n + * In case of StringList type returns joined string ("(" + PIStringList::join("; ") + ")"). \n + * In case of BitArray or ByteArray types returns number of bits/bytes. \n + * In case of Time, Date or DateTime types returns toString() of this values. \n + * In case of SystemTime types returns second and nanoseconds of time + * ("(PISystemTime::seconds s, PISystemTime::nanoseconds ns)"). \n + * In case of other types returns \b "". */ PIString PIVariant::toString() const { switch (type_) { case PIVariant::Bool: return _vint == 0 ? "false" : "true"; @@ -389,7 +494,7 @@ PIString PIVariant::toString() const { case PIVariant::Complexd: return "(" + PIString::fromNumber(_vcomplexd.real()) + "; " + PIString::fromNumber(_vcomplexd.imag()) + ")"; case PIVariant::Complexld: return "(" + PIString::fromNumber(_vcomplexld.real()) + "; " + PIString::fromNumber(_vcomplexld.imag()) + ")"; case PIVariant::BitArray: return PIString::fromNumber(_vbitarray.bitSize()) + " bits"; - case PIVariant::ByteArray: return PIString::fromNumber(_vbytearray.size()) + " bytes"; + case PIVariant::ByteArray: return _vbytearray.toString(); case PIVariant::String: return _vstring; case PIVariant::StringList: return "(" + _vstringlist.join("; ") + ")"; case PIVariant::Time: return _vtime.toString(); @@ -402,18 +507,27 @@ PIString PIVariant::toString() const { } +/** \brief Returns variant content as strings list + * \details In case of StringList type returns strings list value. \n + * In case of other types returns \a PIStringList with one string value of variant content. */ PIStringList PIVariant::toStringList() const { if (type_ == PIVariant::StringList) return _vstringlist; return PIStringList(toString()); } +/** \brief Returns variant content as bit array + * \details In case of BitArray type returns bit array value. \n + * In case of other types returns \a PIBitArray from \a toLLong() value. */ PIBitArray PIVariant::toBitArray() const { if (type_ == PIVariant::BitArray) return _vbitarray; return PIBitArray(ullong(toLLong())); } +/** \brief Returns variant content as byte array + * \details In case of ByteArray type returns byte array value. \n + * In case of other types returns empty \a PIByteArray. */ PIByteArray PIVariant::toByteArray() const { if (type_ == PIVariant::ByteArray) return _vbytearray; return PIByteArray(); diff --git a/pivariant.h b/pivariant.h index cf234639..7cba2770 100644 --- a/pivariant.h +++ b/pivariant.h @@ -49,88 +49,192 @@ class PIP_EXPORT PIVariant { friend PICout operator <<(PICout s, const PIVariant & v); public: + + //! Type of %PIVariant content enum Type { - Invalid = 0, - Bool, - Char, - UChar, - Short, - UShort, - Int, - UInt, - Long, - ULong, - LLong, - ULLong, - Float, - Double, - LDouble, - Complexd, - Complexld, - BitArray, - ByteArray, - String, - StringList, - Time, - Date, - DateTime, - SystemTime, - Custom = 0xFF + Invalid /** Invalid type , default type of empty contructor */ = 0 , + Bool /** bool */ , + Char /** char */ , + UChar /** uchar */ , + Short /** short */ , + UShort /** ushort */ , + Int /** int */ , + UInt /** uint */ , + Long /** long */ , + ULong /** ulong */ , + LLong /** llong */ , + ULLong /** ullong */ , + Float /** float */ , + Double /** double */ , + LDouble /** ldouble */ , + Complexd /** complexd */ , + Complexld /** complexld */ , + BitArray /** PIBitArray */ , + ByteArray /** PIByteArray */ , + String /** PIString */ , + StringList /** PIStringList */ , + Time /** PITime */ , + Date /** PIDate */ , + DateTime /** PIDateTime */ , + SystemTime /** PISystemTime */ , + Custom /** Custom */ = 0xFF }; + //! Empty constructor, \a type() will be set to \a Invalid PIVariant(); + + //! Constructs variant from string PIVariant(const char * v) {setValue(PIString(v));} + + //! Constructs variant from boolean PIVariant(const bool v) {setValue(v);} + + //! Constructs variant from char PIVariant(const char v) {setValue(v);} + + //! Constructs variant from integer PIVariant(const uchar v) {setValue(v);} + + //! Constructs variant from integer PIVariant(const short v) {setValue(v);} + + //! Constructs variant from integer PIVariant(const ushort v) {setValue(v);} + + //! Constructs variant from integer PIVariant(const int & v) {setValue(v);} + + //! Constructs variant from integer PIVariant(const uint & v) {setValue(v);} + + //! Constructs variant from integer PIVariant(const long & v) {setValue(v);} + + //! Constructs variant from integer PIVariant(const ulong & v) {setValue(v);} + + //! Constructs variant from integer PIVariant(const llong & v) {setValue(v);} + + //! Constructs variant from integer PIVariant(const ullong & v) {setValue(v);} + + //! Constructs variant from float PIVariant(const float & v) {setValue(v);} + + //! Constructs variant from double PIVariant(const double & v) {setValue(v);} + + //! Constructs variant from long double PIVariant(const ldouble & v) {setValue(v);} + + //! Constructs variant from complex PIVariant(const complexd & v) {setValue(v);} + + //! Constructs variant from complex PIVariant(const complexld & v) {setValue(v);} + + //! Constructs variant from bit array PIVariant(const PIBitArray & v) {setValue(v);} + + //! Constructs variant from byte array PIVariant(const PIByteArray & v) {setValue(v);} + + //! Constructs variant from string PIVariant(const PIString & v) {setValue(v);} + + //! Constructs variant from strings list PIVariant(const PIStringList & v) {setValue(v);} + + //! Constructs variant from time PIVariant(const PITime & v) {setValue(v);} + + //! Constructs variant from date PIVariant(const PIDate & v) {setValue(v);} + + //! Constructs variant from date and time PIVariant(const PIDateTime & v) {setValue(v);} + + //! Constructs variant from system time PIVariant(const PISystemTime & v) {setValue(v);} + + //! Set variant content and type to string void setValue(const char * v) {setValue(PIString(v));} + + //! Set variant content and type to boolean void setValue(const bool v) {type_ = PIVariant::Bool; _vint = (v ? 1 : 0);} + + //! Set variant content and type to char void setValue(const char v) {type_ = PIVariant::Char; _vint = v;} + + //! Set variant content and type to integer void setValue(const uchar v) {type_ = PIVariant::UChar; _vint = v;} + + //! Set variant content and type to integer void setValue(const short v) {type_ = PIVariant::Short; _vint = v;} + + //! Set variant content and type to integer void setValue(const ushort v) {type_ = PIVariant::UShort; _vint = v;} + + //! Set variant content and type to integer void setValue(const int & v) {type_ = PIVariant::Int; _vint = v;} + + //! Set variant content and type to integer void setValue(const uint & v) {type_ = PIVariant::UInt; _vint = v;} + + //! Set variant content and type to integer void setValue(const long & v) {type_ = PIVariant::Long; _vint = v;} + + //! Set variant content and type to integer void setValue(const ulong & v) {type_ = PIVariant::ULong; _vint = v;} + + //! Set variant content and type to integer void setValue(const llong & v) {type_ = PIVariant::LLong; _vllong = v;} + + //! Set variant content and type to integer void setValue(const ullong & v) {type_ = PIVariant::ULLong; _vllong = v;} + + //! Set variant content and type to float void setValue(const float & v) {type_ = PIVariant::Float; _vfloat = v;} + + //! Set variant content and type to double void setValue(const double & v) {type_ = PIVariant::Double; _vdouble = v;} + + //! Set variant content and type to long double void setValue(const ldouble & v) {type_ = PIVariant::LDouble; _vldouble = v;} + + //! Set variant content and type to complex void setValue(const complexd & v) {type_ = PIVariant::Complexd; _vcomplexd = v;} + + //! Set variant content and type to complex void setValue(const complexld & v) {type_ = PIVariant::Complexld; _vcomplexld = v;} + + //! Set variant content and type to bit array void setValue(const PIBitArray & v) {type_ = PIVariant::BitArray; _vbitarray = v;} + + //! Set variant content and type to byte array void setValue(const PIByteArray & v) {type_ = PIVariant::ByteArray; _vbytearray = v;} + + //! Set variant content and type to string void setValue(const PIString & v) {type_ = PIVariant::String; _vstring = v;} + + //! Set variant content and type to strings list void setValue(const PIStringList & v) {type_ = PIVariant::StringList; _vstringlist = v;} + + //! Set variant content and type to time void setValue(const PITime & v) {type_ = PIVariant::Time; _vtime = v;} + + //! Set variant content and type to date void setValue(const PIDate & v) {type_ = PIVariant::Date; _vdate = v;} + + //! Set variant content and type to date and time void setValue(const PIDateTime & v) {type_ = PIVariant::DateTime; _vdatetime = v;} + + //! Set variant content and type to system time void setValue(const PISystemTime & v) {type_ = PIVariant::SystemTime; _vsystime = v;} + bool toBool() const; int toInt() const; llong toLLong() const; @@ -148,6 +252,10 @@ public: PIBitArray toBitArray() const; PIByteArray toByteArray() const; + + /** \brief Returns variant content as custom type + * \details In case of known types this function equivalent \a to function. \n + * Otherwise returns content as type T. */ template T toValue() const {if (_vcustom.size() != sizeof(T)) return T(); return *((T*)_vcustom.data());} /* @@ -177,46 +285,89 @@ public: operator const char*() const {return toString().data();} operator void*() const {return (void*)(toLLong());} */ - void operator =(const PIVariant & v); - void operator =(const char * v) {setValue(PIString(v));} - void operator =(const bool v) {setValue(v);} - void operator =(const char v) {setValue(v);} - void operator =(const uchar v) {setValue(v);} - void operator =(const short v) {setValue(v);} - void operator =(const ushort v) {setValue(v);} - void operator =(const int & v) {setValue(v);} - void operator =(const uint & v) {setValue(v);} - void operator =(const long & v) {setValue(v);} - void operator =(const ulong & v) {setValue(v);} - void operator =(const llong & v) {setValue(v);} - void operator =(const ullong & v) {setValue(v);} - void operator =(const float & v) {setValue(v);} - void operator =(const double & v) {setValue(v);} - void operator =(const ldouble & v) {setValue(v);} - void operator =(const complexd & v) {setValue(v);} - void operator =(const complexld & v) {setValue(v);} - void operator =(const PIBitArray & v) {setValue(v);} - void operator =(const PIByteArray & v) {setValue(v);} - void operator =(const PIString & v) {setValue(v);} - void operator =(const PIStringList & v) {setValue(v);} - void operator =(const PITime & v) {setValue(v);} - void operator =(const PIDate & v) {setValue(v);} - void operator =(const PIDateTime & v) {setValue(v);} - void operator =(const PISystemTime & v) {setValue(v);} + //! Assign operator + PIVariant & operator =(const PIVariant & v); + //! Assign operator + PIVariant & operator =(const char * v) {setValue(PIString(v)); return *this;} + //! Assign operator + PIVariant & operator =(const bool v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const char v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const uchar v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const short v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const ushort v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const int & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const uint & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const long & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const ulong & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const llong & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const ullong & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const float & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const double & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const ldouble & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const complexd & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const complexld & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const PIBitArray & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const PIByteArray & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const PIString & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const PIStringList & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const PITime & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const PIDate & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const PIDateTime & v) {setValue(v); return *this;} + //! Assign operator + PIVariant & operator =(const PISystemTime & v) {setValue(v); return *this;} + + + //! Compare operator bool operator ==(const PIVariant & v) const; + //! Compare operator bool operator !=(const PIVariant & v) const {return !(*this == v);} + //! Returns type of variant content PIVariant::Type type() const {return type_;} + + //! Returns type name of variant content PIString typeName() const {return typeName(type_);} + + //! Returns \b true if type is not Invalid bool isValid() const {return type_ != PIVariant::Invalid;} + + /** \brief Returns new variant from custom type + * \details In case of known types this function equivalent \a PIVariant(T) constructors. \n + * Otherwise returns variant with content \a v and type Custom. */ template static PIVariant fromValue(const T & v) {PIVariant ret; ret._vcustom.resize(sizeof(T)); new((T*)(ret._vcustom.data()))T(v); ret.type_ = PIVariant::Custom; return ret;} + + //! Returns type from name static PIVariant::Type typeFromName(const PIString & tname); + + //! Returns type name static PIString typeName(PIVariant::Type type); private: diff --git a/pivector.h b/pivector.h index 3c3beb6e..97860bb9 100644 --- a/pivector.h +++ b/pivector.h @@ -41,8 +41,7 @@ public: PIVector(const PIVector & other): piv_data(0), piv_size(0), piv_rsize(0) { //printf("new vector 2 %p (%s) ... !{\n", this, typeid(T).name()); alloc(other.piv_size); - for (size_t i = 0; i < piv_size; ++i) - new(piv_data + i)T(other.piv_data[i]); + newT(piv_data, other.piv_data, piv_size); //printf("(s=%d, d=%p) }!\n", int(piv_size), piv_data); } PIVector(size_t piv_size, const T & f = T()): piv_data(0), piv_size(0), piv_rsize(0) { @@ -77,10 +76,11 @@ public: return *this; }*/ if (!oj) { + deleteT(piv_data, piv_size); alloc(other.piv_size); //zeroRaw(piv_data, piv_size); for (size_t i = 0; i < piv_size; ++i) - new(piv_data + i)T(other.piv_data[i]); //piv_data[i] = other.piv_data[i]; + elementNew(piv_data + i, other.piv_data[i]); //piv_data[i] = other.piv_data[i]; } else { printf("JUNK other\n"); } @@ -174,6 +174,7 @@ public: size_t size() const {return piv_size;} ssize_t size_s() const {return piv_size;} size_t length() const {return piv_size;} + size_t capacity() const {return piv_rsize;} bool isEmpty() const {return (piv_size == 0);} T & operator [](size_t index) {return piv_data[index];} @@ -197,7 +198,7 @@ public: deleteT(piv_data, piv_size); //zeroRaw(piv_data, piv_size); for (size_t i = 0; i < piv_size; ++i) - new(piv_data + i)T(f); + elementNew(piv_data + i, f); return *this; } PIVector & assign(const T & f = T()) {return fill(f);} @@ -213,7 +214,7 @@ public: alloc(new_size); //if (sizeof(T) == 1) memset(&(piv_data[os]), f, ds); //zeroRaw(&(piv_data[os]), new_size - os); - for (size_t i = os; i < new_size; ++i) new(piv_data + i)T(f); + for (size_t i = os; i < new_size; ++i) elementNew(piv_data + i, f); } return *this; } @@ -226,18 +227,27 @@ public: memmove(&(piv_data[index + 1]), &(piv_data[index]), os * sizeof(T)); } //zeroRaw(&(piv_data[index]), 1); - new(piv_data + index)T(v); + elementNew(piv_data + index, v); + return *this; + } + PIVector & insert(size_t index, const PIVector & other) { + if (other.isEmpty()) return *this; + ssize_t os = piv_size - index; + alloc(piv_size + other.pid_size, true); + if (os > 0) + memmove(&(piv_data[index + other.piv_size]), &(piv_data[index]), os * sizeof(T)); + newT(piv_data + index, other.piv_data, other.piv_size); return *this; } PIVector & remove(size_t index, size_t count = 1) { + if (count == 0) return *this; if (index + count >= piv_size) { resize(index); return *this; } size_t os = piv_size - index - count; - T * de = &(piv_data[index]); - deleteT(de, count); + deleteT(&(piv_data[index]), count); memmove(&(piv_data[index]), &(piv_data[index + count]), os * sizeof(T)); piv_size -= count; return *this; @@ -258,14 +268,13 @@ public: PIVector & removeOne(const T & v) {for (size_t i = 0; i < piv_size; ++i) if (piv_data[i] == v) {remove(i); return *this;} return *this;} PIVector & removeAll(const T & v) {for (llong i = 0; i < piv_size; ++i) if (piv_data[i] == v) {remove(i); --i;} return *this;} - PIVector & push_back(const T & v) {alloc(piv_size + 1); new(piv_data + piv_size - 1)T(v); return *this;} + PIVector & push_back(const T & v) {alloc(piv_size + 1); elementNew(piv_data + piv_size - 1, v); return *this;} PIVector & append(const T & v) {return push_back(v);} PIVector & operator <<(const T & v) {return push_back(v);} - PIVector & operator <<(const PIVector & t) { + PIVector & operator <<(const PIVector & other) { size_t ps = piv_size; - alloc(piv_size + t.piv_size); - for (int i = 0; i < t.piv_size; ++i) - new(piv_data + ps + i)T(t.piv_data[i]); + alloc(piv_size + other.piv_size); + newT(piv_data + ps, other.piv_data, other.piv_size); return *this; } @@ -288,6 +297,10 @@ private: while (s_ >> t) ++t; return (1 << t); } + inline void newT(T * dst, const T * src, size_t s) { + for (size_t i = 0; i < s; ++i) + elementNew(dst + i, src[i]); + } T * newRaw(size_t s) { //cout << std::dec << " ![("< ok]~" << endl; @@ -320,6 +333,8 @@ private: if ((uchar*)d != 0) memset(d, 0, s*sizeof(T)); //cout << " > ok]~" << endl; } + inline void elementNew(T * to, const T & from) {new(to)T(from);} + inline void elementDelete(T & from) {from.~T();} void dealloc() {deleteRaw(piv_data);} inline void alloc(size_t new_size) { if (new_size <= piv_rsize) { @@ -348,7 +363,7 @@ private: T * piv_data; size_t piv_size, piv_rsize; }; - +/* #define __PIVECTOR_SIMPLE_FUNCTIONS__(T) \ template<> inline PIVector::~PIVector() {dealloc(); _reset();} \ template<> inline PIVector & PIVector::push_back(const T & v) {alloc(piv_size + 1); piv_data[piv_size - 1] = v; return *this;} \ @@ -377,6 +392,7 @@ private: return *this; \ } \ template<> inline PIVector & PIVector::remove(size_t index, size_t count) { \ + if (count == 0) return *this; \ if (index + count >= piv_size) { \ resize(index); \ return *this; \ @@ -399,7 +415,12 @@ __PIVECTOR_SIMPLE_FUNCTIONS__(llong) __PIVECTOR_SIMPLE_FUNCTIONS__(ullong) __PIVECTOR_SIMPLE_FUNCTIONS__(float) __PIVECTOR_SIMPLE_FUNCTIONS__(double) -__PIVECTOR_SIMPLE_FUNCTIONS__(ldouble) +__PIVECTOR_SIMPLE_FUNCTIONS__(ldouble)*/ +#define __PIVECTOR_SIMPLE_TYPE__(T) \ + template<> inline void PIVector::newT(T * dst, const T * src, size_t s) {memcpy(dst, src, s * sizeof(T));} \ + template<> inline void PIVector::deleteT(T * d, size_t sz) {;} \ + template<> inline void PIVector::elementNew(T * to, const T & from) {(*to) = from;} \ + template<> inline void PIVector::elementDelete(T & from) {;} #else @@ -484,7 +505,7 @@ public: #endif }; -#define __PIVECTOR_SIMPLE_FUNCTIONS__(T) +#define __PIVECTOR_SIMPLE_TYPE__(T) #endif