MythTV  master
mythrender_base.h
Go to the documentation of this file.
1 #ifndef MYTHRENDER_H_
2 #define MYTHRENDER_H_
3 
4 // Qt
5 #include <QString>
6 #include <QMutex>
7 #include <QSize>
8 #include <QStringList>
9 
10 // MythTV
11 #include "referencecounter.h"
12 #include "mythuiexp.h"
13 
15 {
21 };
22 
24 {
25  public:
27  ReferenceCounter(QString("MythRender:%1").arg(type)),
28  m_type(type), m_size(QSize()), m_errored(false)
29  {
30  }
31 
34  bool IsShared(void) const
35  {
36  return const_cast<QAtomicInt&>(m_referenceCount)
37  .fetchAndAddOrdered(0) > 1;
38  }
39 
40  RenderType Type(void) const { return m_type; }
41  bool IsErrored(void) const { return m_errored; }
42  QSize GetSize(void) const { return m_size; }
43  virtual QStringList GetDescription(void) { return QStringList(); }
44 
45  protected:
46  ~MythRender() override = default;
47  virtual void ReleaseResources(void) { }
48 
50  QSize m_size;
51  bool m_errored;
52 };
53 
54 #endif
bool IsShared(void) const
Warning: The reference count can be decremented between the call to this function and the use of it's...
General purpose reference counter.
RenderType Type(void) const
MythRender(RenderType type)
virtual void ReleaseResources(void)
QSize GetSize(void) const
virtual QStringList GetDescription(void)
RenderType m_type
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
#define MUI_PUBLIC
Definition: mythuiexp.h:9
bool IsErrored(void) const
RenderType