#include "store_filter.hpp" #include "context.hpp" #include "grid.hpp" #include "timer.hpp" #include "tracer.hpp" namespace xios { CStoreFilter::CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid, bool detectMissingValues /*= false*/, double missingValue /*= 0.0*/) : CInputPin(gc, 1) , gc(gc) , context(context) , grid(grid) , detectMissingValues(detectMissingValues) , missingValue(missingValue) { if (!context) ERROR("CStoreFilter::CStoreFilter(CContext* context, CGrid* grid)", "Impossible to construct a store filter without providing a context."); if (!grid) ERROR("CStoreFilter::CStoreFilter(CContext* context, CGrid* grid)", "Impossible to construct a store filter without providing a grid."); } CConstDataPacketPtr CStoreFilter::getPacket(Time timestamp) { CTimer timer("CStoreFilter::getPacket"); // timer.resume(); info(0)<<"ENTERING CStoreFilter::getPacket"<::const_iterator it = packets.find(timestamp); if (it != packets.end()) packet = it->second; else // if the packet is not available yet, check if it can be received //ym context->checkBuffersAndListen(); context->eventLoop(); timer.suspend(); } while (!packet && timer.getCumulatedTime() < timeout); // timer.resume(); traceOn() ; // timer.suspend(); if (!packet) { std::map::const_iterator it ; info(0)<<"Impossible to get the packet with timestamp = " << timestamp<first<<" "; info(0)<