17 #ifndef AGXDATA_TRACK_H 18 #define AGXDATA_TRACK_H 28 #include <condition_variable> 95 void setExceptionHandler(
const ExceptionHandler& handler);
100 const ExceptionHandler& getExceptionHandler()
const;
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);
317 FrameList m_frameList;
318 FrameTable m_frameTable;
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;
351 bool m_enableLooping;
377 void start(
bool activate =
true);
387 bool isRunning()
const;
405 bool isActive()
const;
418 std::atomic<bool> m_running;
419 std::atomic<bool> m_active;
472 std::lock_guard<std::mutex> lock(m_mutex);
Basic wrapper class aroud std::thread.
AGXTERRAIN_EXPORT void clear()
agx::UInt getAccumulatedNumFrames() const
agx::Event1< Frame * > FrameEvent
FrameWriter * getOutput()
A component is an object containing other objects, enabling hierarchical structuring.
A model is an abstract representation of the class of an agx::Object.
Generalized callback, using std::function.
agx::UInt getAccumulatedNumBytes() const
The FrameReader reads frames from an external source.
agx::ref_ptr< Frame > FrameRef
#define AGX_DECLARE_POINTER_TYPES(type)
agx::Real getDataRate() const
Representation of a name string.
The Timer class permits timing execution speed with the same refinement as the built in hardware cloc...
agx::Callback2< Track *, std::exception & > ExceptionHandler
Block synchronization primitive.
The FrameWriter writes frames to an external target.
bool getEnableLooping() const
Contains classes for low level data storage for AGX.
RealModeEnum
The data type for basic floating point representation.
FrameEvent pushFrameEvent
agx::UInt getFrameStride() const
Inheritance with partial specialization due to bug with ref_ptr containers.
agx::Object is a refcounted object with a name.