MythTV  master
mythrender_base.h
Go to the documentation of this file.
1 #ifndef MYTHRENDER_H_
2 #define MYTHRENDER_H_
3 
4 #include <QString>
5 #include <QMutex>
6 #include <QSize>
7 
8 #include "referencecounter.h"
9 #include "mythuiexp.h"
10 #include "mythuidefines.h"
11 
12 typedef enum
13 {
20 } RenderType;
21 
23 {
24  public:
26  ReferenceCounter(QString("MythRender:%1").arg(type)),
27  m_type(type), m_size(QSize()), m_errored(false)
28  {
29  }
30 
33  bool IsShared(void) const
34  {
35  return const_cast<QAtomicInt&>(m_referenceCount)
36  .fetchAndAddOrdered(0) > 1;
37  }
38 
39  RenderType Type(void) const { return m_type; }
40  bool IsErrored(void) const { return m_errored; }
41  QSize GetSize(void) const { return m_size; }
42  virtual void Release(void) { }
43 
44  protected:
45  virtual ~MythRender() = default;
46 
48  QSize m_size;
49  bool m_errored;
50 };
51 
52 #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)
QSize GetSize(void) const
RenderType m_type
VERBOSE_PREAMBLE false
Definition: verbosedefs.h:85
#define MUI_PUBLIC
Definition: mythuiexp.h:9
bool IsErrored(void) const
virtual void Release(void)
RenderType