Coin Logo http://www.sim.no
http://www.coin3d.org

SoSensorManager.h
1 #ifndef COIN_SOSENSORMANAGER_H
2 #define COIN_SOSENSORMANAGER_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) 1998-2007 by Systems in Motion. All rights reserved.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Systems in Motion about acquiring
18  * a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/SbBasic.h>
28 
29 class SoDelayQueueSensor;
30 class SoTimerQueueSensor;
31 class SoTimerSensor;
32 class SbTime;
33 
34 class COIN_DLL_API SoSensorManager {
35 public:
36  SoSensorManager(void);
37  ~SoSensorManager();
38 
39  void insertDelaySensor(SoDelayQueueSensor * s);
40  void insertTimerSensor(SoTimerQueueSensor * s);
41  void removeDelaySensor(SoDelayQueueSensor * s);
42  void removeTimerSensor(SoTimerQueueSensor * s);
43 
44  void setChangedCallback(void (*sensorQueueChangedCB)(void *), void * data);
45 
46  void rescheduleTimer(SoTimerSensor * s);
47  void removeRescheduledTimer(SoTimerQueueSensor * s);
48 
49  void processDelayQueue(SbBool isidle);
50  void processImmediateQueue(void);
51  void processTimerQueue(void);
52 
53  SbBool isDelaySensorPending(void);
54  SbBool isTimerSensorPending(SbTime & tm);
55 
56  void setDelaySensorTimeout(const SbTime & t);
57  const SbTime & getDelaySensorTimeout(void);
58 
59  int doSelect(int nfds, void * readfds, void * writefds,
60  void * exceptfds, struct timeval * userTimeOut);
61 
62 private:
63  void notifyChanged(void);
64 
65  int mergeTimerQueues(void);
66  int mergeDelayQueues(void);
67 
68  class SoSensorManagerP * pimpl;
69  friend class SoSensorManagerP;
70 };
71 
72 #endif // !COIN_SOSENSORMANAGER_H
SoDebugError::post
static void post(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:314
SoSensor
The SoSensor class is the abstract base class for all sensors.
Definition: SoSensor.h:34
SoSensorManager::isTimerSensorPending
SbBool isTimerSensorPending(SbTime &tm)
Definition: SoSensorManager.cpp:713
SoSensorManager::setChangedCallback
void setChangedCallback(void(*sensorQueueChangedCB)(void *), void *data)
Definition: SoSensorManager.cpp:789
SoSensorManager::getDelaySensorTimeout
const SbTime & getDelaySensorTimeout(void)
Definition: SoSensorManager.cpp:774
SoTimerQueueSensor::getTriggerTime
const SbTime & getTriggerTime(void) const
Definition: SoTimerQueueSensor.cpp:138
SoDebugError::postWarning
static void postWarning(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:324
SoDelayQueueSensor
The SoDelayQueueSensor class is the abstract base class for priority scheduled sensors.
Definition: SoDelayQueueSensor.h:31
SoSensorManager::processTimerQueue
void processTimerQueue(void)
Definition: SoSensorManager.cpp:435
SoSensorManager::SoSensorManager
SoSensorManager(void)
Definition: SoSensorManager.cpp:241
SbList::insert
void insert(const Type item, const int insertbefore)
Definition: SbList.h:109
SoSensorManager::doSelect
int doSelect(int nfds, void *readfds, void *writefds, void *exceptfds, struct timeval *userTimeOut)
Definition: SoSensorManager.cpp:824
SbList< SoDelayQueueSensor * >
SoDebugError::postInfo
static void postInfo(const char *const source, const char *const format,...)
Definition: SoDebugError.cpp:334
SoSensor::trigger
virtual void trigger(void)
Definition: SoSensor.cpp:181
SoSensorManager::insertDelaySensor
void insertDelaySensor(SoDelayQueueSensor *s)
Definition: SoSensorManager.cpp:276
SbList::getLength
int getLength(void) const
Definition: SbList.h:145
SoAlarmSensor
The SoAlarmSensor class is a sensor which will trigger once at a specified time.
Definition: SoAlarmSensor.h:29
SoTimerSensor
The SoTimerSensor class is a sensor which will trigger at given intervals.
Definition: SoTimerSensor.h:29
SoSensorManager::removeDelaySensor
void removeDelaySensor(SoDelayQueueSensor *s)
Definition: SoSensorManager.cpp:373
SoSensorManager::processDelayQueue
void processDelayQueue(SbBool isidle)
Definition: SoSensorManager.cpp:526
SoSensorManager::~SoSensorManager
~SoSensorManager()
Definition: SoSensorManager.cpp:259
SbTime::getValue
double getValue(void) const
Definition: SbTime.cpp:259
SoSensorManager
The SoSensorManager class handles the sensor queues.
Definition: SoSensorManager.h:34
SoSensorManager::rescheduleTimer
void rescheduleTimer(SoTimerSensor *s)
Definition: SoSensorManager.cpp:663
SbMutex
A basic class for managing a mutex.
Definition: SbMutex.h:30
SoTimerQueueSensor
The SoTimerQueueSensor class is the abstract base class for sensors triggering on certain timer event...
Definition: SoTimerQueueSensor.h:30
SoSensorManager::removeTimerSensor
void removeTimerSensor(SoTimerQueueSensor *s)
Definition: SoSensorManager.cpp:411
SoDelayQueueSensor::getPriority
uint32_t getPriority(void) const
Definition: SoDelayQueueSensor.cpp:125
SbTime
The SbTime class instances represents time values.
Definition: SbTime.h:41
SoSensorManager::setDelaySensorTimeout
void setDelaySensorTimeout(const SbTime &t)
Definition: SoSensorManager.cpp:745
SbTime::getTimeOfDay
static SbTime getTimeOfDay(void)
Definition: SbTime.cpp:139
SbTime::zero
static SbTime zero(void)
Definition: SbTime.cpp:164
SoDelayQueueSensor::isIdleOnly
virtual SbBool isIdleOnly(void) const
Definition: SoDelayQueueSensor.cpp:209
SoDelayQueueSensor::trigger
virtual void trigger(void)
Definition: SoDelayQueueSensor.cpp:144
SoSensorManager::removeRescheduledTimer
void removeRescheduledTimer(SoTimerQueueSensor *s)
Definition: SoSensorManager.cpp:676
SoSensorManager::isDelaySensorPending
SbBool isDelaySensorPending(void)
Definition: SoSensorManager.cpp:697
SoSensorManager::processImmediateQueue
void processImmediateQueue(void)
Definition: SoSensorManager.cpp:612
SoSensorManager::insertTimerSensor
void insertTimerSensor(SoTimerQueueSensor *s)
Definition: SoSensorManager.cpp:330

Copyright © 1998-2007 by Systems in Motion AS. All rights reserved.

Generated on Mon Jul 27 2020 for Coin by Doxygen. 1.8.18