/// /// \file cafeVectors.h /// \author Jan Chrin, PSI /// \date Release: February 2015 /// \version CAFE 1.0.0 /// #ifndef CAFEVECTORS_H #define CAFEVECTORS_H #include #include int get(const unsigned int _handle, std::vector & V); //0 int get(const unsigned int _handle, std::vector & V); //1 int get(const unsigned int _handle, std::vector & V); //2 int get(const unsigned int _handle, std::vector & V); //3 int get(const unsigned int _handle, std::vector & V); //4 int get(const unsigned int _handle, std::vector & V); //5 int get(const unsigned int _handle, std::vector & V); //5 int get(const unsigned int _handle, std::vector & V); //6 int getStringVector(const unsigned int _handle, std::vector & V) {return get(_handle, V);}; //0 int getShortVector(const unsigned int _handle, std::vector & V) {return get(_handle, V);}; //1 int getFloatVector(const unsigned int _handle, std::vector & V) {return get(_handle, V);}; //2 int getUShortVector(const unsigned int _handle, std::vector & V) {return get(_handle, V);};//3 int getUCharVector(const unsigned int _handle, std::vector & V) {return get(_handle, V);}; //4 int getLongVector(const unsigned int _handle, std::vector & V) {return get(_handle, V);}; //5 int getLongLongVector(const unsigned int _handle, std::vector & V) {return get(_handle, V);}; //5 int getDoubleVector(const unsigned int _handle, std::vector & V) {return get(_handle, V);}; //6 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//0 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//1 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//2 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//3 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//4 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//5 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//5 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//6 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//0 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//1 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//2 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//3 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//4 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//5 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//5 int get(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);// int getCache(const unsigned int _handle, std::vector & V); //0 int getCache(const unsigned int _handle, std::vector & V); //1 int getCache(const unsigned int _handle, std::vector & V); //2 int getCache(const unsigned int _handle, std::vector & V);//3 int getCache(const unsigned int _handle, std::vector & V);//4 int getCache(const unsigned int _handle, std::vector & V); //5 int getCache(const unsigned int _handle, std::vector & V); //5 int getCache(const unsigned int _handle, std::vector & V); //6 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//0 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//1 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//2 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//3 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//4 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//5 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//5 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//6 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//0 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//1 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//2 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//3 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//4 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//5 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//5 int getCache(const unsigned int _handle, std::vector & V, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//6 //NON_BLOCKING int get(std::vector handleV, std::vector &statusV); int getV(std::vector handleV, std::vector &statusV) { status=get(handleV, statusV); ca_flush_io(); //Yes let's flush here! return status; } int get(std::vector pvV, std::vector &statusV) { std::vector hV; hV.reserve(pvV.size()); hV=handleHelper.getHandlesFromPVs(pvV); return get(hV, statusV); } int getScalars(std::vector handleV, std::vector & V, std::vector &statusV) //0 { CAFE::get(handleV, statusV); CAFE::waitForBundledEvents(handleV, statusV); return CAFE::getCache(handleV, V, statusV); } int getScalars(std::vector handleV, std::vector & V, std::vector &statusV) //1 { CAFE::get(handleV, statusV); CAFE::waitForBundledEvents(handleV, statusV); return CAFE::getCache(handleV, V, statusV); } int getScalars(std::vector handleV, std::vector & V, std::vector &statusV) //2 { CAFE::get(handleV, statusV); CAFE::waitForBundledEvents(handleV, statusV); return CAFE::getCache(handleV, V, statusV); } int getScalars(std::vector handleV, std::vector & V, std::vector &statusV) //3 { CAFE::get(handleV, statusV); CAFE::waitForBundledEvents(handleV, statusV); return CAFE::getCache(handleV, V, statusV); } int getScalars(std::vector handleV, std::vector & V, std::vector &statusV) //4 { CAFE::get(handleV, statusV); CAFE::waitForBundledEvents(handleV, statusV); return CAFE::getCache(handleV, V, statusV); } int getScalars(std::vector handleV, std::vector & V, std::vector &statusV) //5 { CAFE::get(handleV, statusV); CAFE::waitForBundledEvents(handleV, statusV); return CAFE::getCache(handleV, V, statusV); } int getScalars(std::vector handleV, std::vector & V, std::vector &statusV) //5 { CAFE::get(handleV, statusV); CAFE::waitForBundledEvents(handleV, statusV); return CAFE::getCache(handleV, V, statusV); } int getScalars(std::vector handleV, std::vector & V, std::vector &statusV) //6 { CAFE::get(handleV, statusV); //for (size_t i=0; i< handleV.size(); ++i) { cout << "/Asyn/h=" << handleV[i] << "s=" << statusV[i] << " [" << i << "] " << endl;} CAFE::waitForBundledEvents(handleV, statusV); //for (size_t i=0; i< handleV.size(); ++i) { cout << "/Wait/h=" << handleV[i] << "s=" << statusV[i] << " [" << i << "] " << endl;} status=CAFE::getCache(handleV, V, statusV); //for (size_t i=0; i< handleV.size(); ++i) { cout << "/Cach/h=" << handleV[i] << "s=" << statusV[i] << " [" << i << "] " << endl;} return status; } int getCacheVStr(std::vector handleV, std::vector & V, std::vector &statusV) { return getCache(handleV, V, statusV); } int getCacheVLong(std::vector handleV, std::vector & V, std::vector &statusV) { return getCache(handleV, V, statusV); } int getCacheVDouble(std::vector handleV, std::vector & V, std::vector &statusV) { return getCache(handleV, V, statusV); } int getCache(std::vector handleV, std::vector & V, std::vector &statusV); //0 int getCache(std::vector handleV, std::vector & V, std::vector &statusV); //1 int getCache(std::vector handleV, std::vector & V, std::vector &statusV); //2 int getCache(std::vector handleV, std::vector & V, std::vector &statusV); //3 int getCache(std::vector handleV, std::vector & V, std::vector &statusV); //4 int getCache(std::vector handleV, std::vector & V, std::vector &statusV); //5 int getCache(std::vector handleV, std::vector & V, std::vector &statusV); //5 int getCache(std::vector handleV, std::vector & V, std::vector &statusV); //6 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV); //0 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV); //1 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV); //2 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV); //3 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV); //4 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV); //5 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV); //5 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV); //6 //0 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV, std::vector &tsV); //1 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV, std::vector &tsV); //2 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV, std::vector &tsV); //3 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV, std::vector &tsV); //4 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV, std::vector &tsV); //5 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV, std::vector &tsV); int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV, std::vector &tsV); //6 int getCache(std::vector handleV, std::vector & V, std::vector &statusV, std::vector &alarmStatusV, std::vector &alarmSeverityV, std::vector &tsV); /////////////////////////////////////////////////////////////////////////////////////////// int set(const unsigned int _handle, std::vector V); //0 int set(const unsigned int _handle, std::vector V); //1 int set(const unsigned int _handle, std::vector V); //2 int set(const unsigned int _handle, std::vector V);//3 int set(const unsigned int _handle, std::vector V);//4 int set(const unsigned int _handle, std::vector V); //5 int set(const unsigned int _handle, std::vector V); //5+ int set(const unsigned int _handle, std::vector V); //6 int set(std::vector _handleV, std::vector V, std::vector &statusV); //0 int set(std::vector _handleV, std::vector V, std::vector &statusV); //1 int set(std::vector _handleV, std::vector V, std::vector &statusV); //2 int set(std::vector _handleV, std::vector V, std::vector &statusV); //3 int set(std::vector _handleV, std::vector V, std::vector &statusV); //4 int set(std::vector _handleV, std::vector V, std::vector &statusV); //5 int set(std::vector _handleV, std::vector V, std::vector &statusV); //5+ int set(std::vector _handleV, std::vector V, std::vector &statusV); //6 int get (std::vector handleV, PVDataHolder * pvd) { return get(&handleV[0], (unsigned int) handleV.size(), pvd); }; int getCache (std::vector handleV, PVDataHolder * pvd) { return getCache(&handleV[0], (unsigned int) handleV.size(), pvd); }; int getPVArray (std::vector handleV, PVDataHolder * pvd) { //unsigned int * handleArray = new unsigned int [handleV.size()]; //for (size_t i=0; i< (size_t) handleV.size(); ++i) {handleArray[i]= (unsigned int) handleV[i];} //status=get(handleArray, (unsigned int) handleV.size(), pvd); //delete [] handleArray; return status; return get(&handleV[0], (unsigned int) handleV.size(), pvd); }; /* int getPVArrayCache (std::vector handleV, PVDataHolder * pvd){ //unsigned int * handleArray = new unsigned int [handleV.size()]; //for (size_t i=0; i< (size_t) handleV.size(); ++i) {handleArray[i]= (unsigned int) handleV[i];} //status=getCache(handleArray, (unsigned int) handleV.size(), pvd); //delete [] handleArray; return status; return getCache(&handleV[0], (unsigned int) handleV.size(), pvd); }; */ //setPVArray is in cafeStd::Vectors.h and .cc //For Cython int setPVArray(std::vector handleV, PVDataHolder * pvd); int setVVString(std::vector handleV, std::vector V, std::vector &statusV) { return set(handleV, V, statusV); }; int setVVChar(std::vector handleV, std::vector V, std::vector &statusV) { return set(handleV, V, statusV); }; int setVVLong(std::vector handleV, std::vector V, std::vector &statusV) { return set(handleV, V, statusV); }; int setVVDouble(std::vector handleV, std::vector V, std::vector &statusV) { return set(handleV, V, statusV); }; int setVString(const unsigned int handle, std::vector V) { return set(handle, V); }; int setVChar (const unsigned int handle, std::vector V) { return set(handle, V); }; int setVLong (const unsigned int handle, std::vector V) { return set(handle, V); }; int setVShort (const unsigned int handle, std::vector V) { return set(handle, V); }; int setVUShort(const unsigned int handle, std::vector V) { return set(handle, V); }; int setVFloat (const unsigned int handle, std::vector V) { return set(handle, V); }; int setVDouble(const unsigned int handle, std::vector V) { return set(handle, V); }; #endif // CAFEVECTORS_H