 |
AGXDynamics
2.35.0.3
|
Go to the documentation of this file.
17 #ifndef AGXDATA_TRACK_H
18 #define AGXDATA_TRACK_H
28 #include <condition_variable>
143 agx::UInt getAccumulatedNumBytes()
const;
148 agx::UInt getAccumulatedNumFrames()
const;
154 void flush(
bool force =
false);
164 bool isQueueEmpty()
const;
174 bool isInputEOF()
const;
179 bool isRunning()
const;
184 void setEnableLooping(
bool flag);
189 bool getEnableLooping()
const;
194 void setExpandFrames(
bool flag);
199 bool getExpandFrames()
const;
214 bool hasJumped()
const;
233 void setActiveTimeRangeStart(
agx::Real time);
234 void setActiveTimeRangeEnd(
agx::Real time);
236 agx::Real getActiveTimeRangeStart()
const;
242 void loadCache(
Track *other);
246 void pushFrame(Frame *frame);
249 FrameRef popFrame(
bool blocking =
true);
259 void finalizePop(Frame *frame);
260 void flush(
bool force,
bool needLock);
264 void updateDataRate(Frame *frame);
280 bool waitForFreeSlot();
287 typedef std::pair<FrameRef, FrameList::iterator> FrameEntry;
295 FrameCache(
const FrameCache& other);
297 FrameCache& operator= (
const FrameCache& other);
299 void addFrame(Frame *frame);
302 void evictFrame(Frame *frame);
327 FrameCache m_frameCache;
328 FrameList m_frameQueue;
333 ExceptionHandler m_exceptionHandler;
335 mutable std::mutex m_mutex;
336 std::mutex m_outputVectorMutex;
337 std::mutex m_jumpMutex;
339 std::condition_variable_any m_hasFramesCondition;
340 std::atomic<bool> m_hasFramesForceOpen;
341 std::condition_variable_any m_hasFreeSlotsCondition;
342 std::atomic<bool> m_hasFreeSlotsForceOpen;
344 InputThreadRef m_inputThread;
345 OutputThreadRef m_outputThread;
351 bool m_enableLooping;
362 ThreadRef m_exceptionThread;
418 std::atomic<bool> m_running;
419 std::atomic<bool> m_active;
472 std::lock_guard<std::mutex> lock(m_mutex);
Thread(Track *track, agx::Callback entryPoint, const agx::Name &="Thread")
agx::Real getDataRate() const
Basic wrapper class aroud std::thread.
FrameWriter * getOutput()
agx::Event1< Frame * > FrameEvent
agx::ref_ptr< Frame > FrameRef
agx::UInt getAccumulatedNumFrames() const
agx::UInt getAccumulatedNumBytes() const
Generalized callback, using std::function.
Contains classes for low level data storage for AGX.
A model is an abstract representation of the class of an agx::Object.
Block synchronization primitive.
bool getEnableLooping() const
void activate()
Activate the thread.
Inheritance with partial specialization due to bug with ref_ptr containers.
Representation of a name string.
agx::Object is a refcounted object with a name.
A component is an object containing other objects, enabling hierarchical structuring.
agx::Callback2< Track *, std::exception & > ExceptionHandler
void deactivate()
Deactivate the thread.
#define AGX_DECLARE_POINTER_TYPES(type)
The Timer class permits timing execution speed with the same refinement as the built in hardware cloc...
agx::UInt getFrameStride() const
The FrameWriter writes frames to an external target.
FrameEvent pushFrameEvent
The FrameReader reads frames from an external source.
OutputThread(Track *track)
AGXTERRAIN_EXPORT void clear()
bool start()
Launches the thread.
RealModeEnum
The data type for basic floating point representation.
void stop()
Stop the thread.