00001 #include "Sensor.h" 00002 #include "Device.h" 00003 #include "Shot.h" 00004 #include "Frame.h" 00005 00006 namespace FCam { 00007 00008 Sensor::Sensor() { 00009 // A sensor affects the frames it returns, so it is attached 00010 // to itself. This is pointless for the base sensor, but is 00011 // useful for fancier derived sensors so that they get a 00012 // chance to tag the frames they return. 00013 attach(this); 00014 dropPolicy = Sensor::DropOldest; 00015 frameLimit = 128; 00016 } 00017 00018 Sensor::~Sensor() {} 00019 00020 void Sensor::attach(Device *d) { 00021 devices.push_back(d); 00022 } 00023 00024 void Sensor::setFrameLimit(int l) { 00025 frameLimit = l; 00026 enforceDropPolicy(); 00027 } 00028 00029 int Sensor::getFrameLimit() { 00030 return frameLimit; 00031 } 00032 00033 void Sensor::setDropPolicy(Sensor::DropPolicy d) { 00034 dropPolicy = d; 00035 } 00036 00037 Sensor::DropPolicy Sensor::getDropPolicy() { 00038 return dropPolicy; 00039 } 00040 00041 }
1.5.6