foobar2000 SDK  2015-08-03
Public Member Functions | Private Types | Private Attributes
pfc::syncd_storage_flagged< t_object >

#include <syncd_storage.h>

Public Member Functions

 syncd_storage_flagged ()
 
template<typename t_source >
 syncd_storage_flagged (const t_source &p_source, bool initChanged=false)
 
t_object get ()
 
t_object get (bool &bHasChanged)
 
template<typename t_destination >
void get (t_destination &p_out)
 
template<typename t_destination >
bool get_if_changed (t_destination &p_out)
 
bool has_changed () const
 
template<typename t_source >
const t_selfoperator= (t_source const &p_source)
 
t_object peek () const
 
template<typename t_source >
void set (t_source const &p_in)
 
void set_changed (bool p_flag=true)
 

Private Types

typedef syncd_storage_flagged< t_object > t_self
 

Private Attributes

volatile bool m_changed_flag
 
t_object m_object
 
mutable::pfc::readWriteLock m_sync
 

Detailed Description

template<typename t_object>
class pfc::syncd_storage_flagged< t_object >

Definition at line 35 of file syncd_storage.h.

Member Typedef Documentation

template<typename t_object >
typedef syncd_storage_flagged<t_object> pfc::syncd_storage_flagged< t_object >::t_self
private

Definition at line 37 of file syncd_storage.h.

Constructor & Destructor Documentation

template<typename t_object >
pfc::syncd_storage_flagged< t_object >::syncd_storage_flagged ( )
inline

Definition at line 39 of file syncd_storage.h.

39 : m_changed_flag(false) {}
volatile bool m_changed_flag
Definition: syncd_storage.h:88
template<typename t_object >
template<typename t_source >
pfc::syncd_storage_flagged< t_object >::syncd_storage_flagged ( const t_source &  p_source,
bool  initChanged = false 
)
inline

Definition at line 41 of file syncd_storage.h.

41 : m_changed_flag(initChanged), m_object(p_source) {}
volatile bool m_changed_flag
Definition: syncd_storage.h:88

Member Function Documentation

template<typename t_object >
t_object pfc::syncd_storage_flagged< t_object >::get ( )
inline

Definition at line 68 of file syncd_storage.h.

68  {
69  inReadSync(m_sync);
70  m_changed_flag = false;
71  return m_object;
72  }
mutable::pfc::readWriteLock m_sync
Definition: syncd_storage.h:89
volatile bool m_changed_flag
Definition: syncd_storage.h:88
template<typename t_object >
t_object pfc::syncd_storage_flagged< t_object >::get ( bool &  bHasChanged)
inline

Definition at line 73 of file syncd_storage.h.

73  {
74  inReadSync(m_sync);
75  bHasChanged = m_changed_flag;
76  m_changed_flag = false;
77  return m_object;
78  }
mutable::pfc::readWriteLock m_sync
Definition: syncd_storage.h:89
volatile bool m_changed_flag
Definition: syncd_storage.h:88
template<typename t_object >
template<typename t_destination >
void pfc::syncd_storage_flagged< t_object >::get ( t_destination &  p_out)
inline

Definition at line 80 of file syncd_storage.h.

80  {
81  inReadSync(m_sync);
82  p_out = m_object;
83  m_changed_flag = false;
84  }
mutable::pfc::readWriteLock m_sync
Definition: syncd_storage.h:89
volatile bool m_changed_flag
Definition: syncd_storage.h:88
template<typename t_object >
template<typename t_destination >
bool pfc::syncd_storage_flagged< t_object >::get_if_changed ( t_destination &  p_out)
inline

Definition at line 58 of file syncd_storage.h.

58  {
59  inReadSync(m_sync);
60  if (m_changed_flag) {
61  p_out = m_object;
62  m_changed_flag = false;
63  return true;
64  } else {
65  return false;
66  }
67  }
mutable::pfc::readWriteLock m_sync
Definition: syncd_storage.h:89
volatile bool m_changed_flag
Definition: syncd_storage.h:88
template<typename t_object >
bool pfc::syncd_storage_flagged< t_object >::has_changed ( ) const
inline

Definition at line 52 of file syncd_storage.h.

52  {
53  inReadSync(m_sync);
54  return m_changed_flag;
55  }
mutable::pfc::readWriteLock m_sync
Definition: syncd_storage.h:89
volatile bool m_changed_flag
Definition: syncd_storage.h:88
template<typename t_object >
template<typename t_source >
const t_self& pfc::syncd_storage_flagged< t_object >::operator= ( t_source const &  p_source)
inline

Definition at line 86 of file syncd_storage.h.

86 {set(p_source); return *this;}
template<typename t_object >
t_object pfc::syncd_storage_flagged< t_object >::peek ( ) const
inline

Definition at line 56 of file syncd_storage.h.

56 {inReadSync(m_sync); return m_object;}
mutable::pfc::readWriteLock m_sync
Definition: syncd_storage.h:89
template<typename t_object >
template<typename t_source >
void pfc::syncd_storage_flagged< t_object >::set ( t_source const &  p_in)
inline

Definition at line 47 of file syncd_storage.h.

47  {
48  inWriteSync(m_sync);
49  m_object = p_in;
50  m_changed_flag = true;
51  }
mutable::pfc::readWriteLock m_sync
Definition: syncd_storage.h:89
volatile bool m_changed_flag
Definition: syncd_storage.h:88
template<typename t_object >
void pfc::syncd_storage_flagged< t_object >::set_changed ( bool  p_flag = true)
inline

Definition at line 42 of file syncd_storage.h.

42  {
43  inWriteSync(m_sync);
44  m_changed_flag = p_flag;
45  }
mutable::pfc::readWriteLock m_sync
Definition: syncd_storage.h:89
volatile bool m_changed_flag
Definition: syncd_storage.h:88

Field Documentation

template<typename t_object >
volatile bool pfc::syncd_storage_flagged< t_object >::m_changed_flag
mutableprivate

Definition at line 88 of file syncd_storage.h.

template<typename t_object >
t_object pfc::syncd_storage_flagged< t_object >::m_object
private

Definition at line 90 of file syncd_storage.h.

template<typename t_object >
mutable ::pfc::readWriteLock pfc::syncd_storage_flagged< t_object >::m_sync
private

Definition at line 89 of file syncd_storage.h.


The documentation for this class was generated from the following file: