Sensor that triggers a callback each time a file is changed. More...
#include <Inventor/sensors/SoFileSensor.h>
Public Member Functions | |
SoFileSensor () | |
SoFileSensor (SoSensorCB *func, void *data) | |
virtual | ~SoFileSensor () |
void | addFile (const SbString &filename) |
void | removeFile (const SbString &filename) |
void | clearFiles () |
SbString | getFilename () const |
Sensor that triggers a callback each time a file is changed.
File sensors trigger their callback function when a watched file changes. Files are checked at the interval specified with SoTimerSensor::setInterval.
SoOneShotSensor, SoAlarmSensor, SoTimerQueueSensor, SbTime
SoFileSensor::SoFileSensor | ( | ) |
Default constructor.
SoFileSensor::SoFileSensor | ( | SoSensorCB * | func, | |
void * | data | |||
) |
Constructor that takes the callback function and data to be called when the sensor is triggered.
virtual SoFileSensor::~SoFileSensor | ( | ) | [virtual] |
Destroys the sensor, freeing up any memory associated with it after unscheduling it.
void SoFileSensor::addFile | ( | const SbString & | filename | ) |
Add file to be monitored.
If file does not exist, the method does nothing.
void SoFileSensor::clearFiles | ( | ) |
Stop monitoring all previously registered files.
SbString SoFileSensor::getFilename | ( | ) | const [inline] |
Return changed file name.
Note: Only valid when called from the callback function.
void SoFileSensor::removeFile | ( | const SbString & | filename | ) |
Remove file from monitored list.
If file is not being monitored, the method does nothing.