Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

176 lines
4.9 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////
  2. // DVBSLocatorimpl.h : implementation helper template for DVBSlocator interface
  3. // Copyright (c) Microsoft Corporation 2000.
  4. #ifndef DVBSLOCATORIMPL_H
  5. #define DVBSLOCATORIMPL_H
  6. #include <locatorimpl.h>
  7. namespace BDATuningModel {
  8. template<class T,
  9. class MostDerived = IDVBSLocator,
  10. LPCGUID iid = &__uuidof(MostDerived),
  11. LPCGUID LibID = &LIBID_TunerLib,
  12. WORD wMajor = 1,
  13. WORD wMinor = 0,
  14. class tihclass = CComTypeInfoHolder
  15. > class ATL_NO_VTABLE IDVBSLocatorImpl :
  16. public ILocatorImpl<T, MostDerived, iid, LibID, wMajor, wMinor, tihclass>
  17. {
  18. // IDVBSLocator
  19. public:
  20. typedef ILocatorImpl<T, MostDerived, iid, LibID, wMajor, wMinor, tihclass> basetype;
  21. typedef IDVBSLocatorImpl<T, MostDerived, iid, LibID, wMajor, wMinor, tihclass> thistype;
  22. Polarisation m_SignalPolarisation;
  23. VARIANT_BOOL m_WestPosition;
  24. long m_OrbitalPosition;
  25. long m_Azimuth;
  26. long m_Elevation;
  27. IDVBSLocatorImpl() : m_SignalPolarisation(BDA_POLARISATION_NOT_SET),
  28. m_WestPosition(VARIANT_TRUE),
  29. m_OrbitalPosition(-1),
  30. m_Azimuth(-1),
  31. m_Elevation(-1) {}
  32. virtual ~IDVBSLocatorImpl() {}
  33. BEGIN_PROP_MAP(thistype)
  34. CHAIN_PROP_MAP(basetype)
  35. PROP_DATA_ENTRY("Polarisation", m_SignalPolarisation, VT_I4)
  36. PROP_DATA_ENTRY("OrbitalPosition", m_OrbitalPosition, VT_I4)
  37. PROP_DATA_ENTRY("Azimuth", m_Azimuth, VT_I4)
  38. PROP_DATA_ENTRY("Elevation", m_Elevation, VT_I4)
  39. PROP_DATA_ENTRY("WestPosition", m_WestPosition, VT_BOOL)
  40. END_PROP_MAP()
  41. // IDVBSLocator
  42. public:
  43. STDMETHOD(get_SignalPolarisation)(/*[out, retval]*/ Polarisation *pSignalPolarisation) {
  44. try {
  45. if (!pSignalPolarisation) {
  46. return E_POINTER;
  47. }
  48. ATL_LOCKT();
  49. *pSignalPolarisation = m_SignalPolarisation;
  50. return NOERROR;
  51. } catch (...) {
  52. return E_POINTER;
  53. }
  54. }
  55. STDMETHOD(put_SignalPolarisation)(/*[in]*/ Polarisation NewSignalPolarisation) {
  56. ATL_LOCKT();
  57. m_SignalPolarisation = NewSignalPolarisation;
  58. MARK_DIRTY(T);
  59. return NOERROR;
  60. }
  61. STDMETHOD(get_WestPosition)(/*[out, retval]*/ VARIANT_BOOL *pWestPosition) {
  62. try {
  63. if (!pWestPosition) {
  64. return E_POINTER;
  65. }
  66. ATL_LOCKT();
  67. *pWestPosition = m_WestPosition;
  68. return NOERROR;
  69. } catch (...) {
  70. return E_POINTER;
  71. }
  72. }
  73. STDMETHOD(put_WestPosition)(/*[in]*/ VARIANT_BOOL NewWestPosition) {
  74. ATL_LOCKT();
  75. m_WestPosition = NewWestPosition;
  76. MARK_DIRTY(T);
  77. return NOERROR;
  78. }
  79. STDMETHOD(get_OrbitalPosition)(/*[out, retval]*/ long *pOrbitalPosition) {
  80. try {
  81. if (!pOrbitalPosition) {
  82. return E_POINTER;
  83. }
  84. ATL_LOCKT();
  85. *pOrbitalPosition = m_OrbitalPosition;
  86. return NOERROR;
  87. } catch (...) {
  88. return E_POINTER;
  89. }
  90. }
  91. STDMETHOD(put_OrbitalPosition)(/*[in]*/ long NewOrbitalPosition) {
  92. ATL_LOCKT();
  93. m_OrbitalPosition = NewOrbitalPosition;
  94. MARK_DIRTY(T);
  95. return NOERROR;
  96. }
  97. STDMETHOD(get_Azimuth)(/*[out, retval]*/ long *pAzimuth) {
  98. try {
  99. if (!pAzimuth) {
  100. return E_POINTER;
  101. }
  102. ATL_LOCKT();
  103. *pAzimuth = m_Azimuth;
  104. return NOERROR;
  105. } catch (...) {
  106. return E_POINTER;
  107. }
  108. }
  109. STDMETHOD(put_Azimuth)(/*[in]*/ long NewAzimuth) {
  110. ATL_LOCKT();
  111. m_Azimuth = NewAzimuth;
  112. MARK_DIRTY(T);
  113. return NOERROR;
  114. }
  115. STDMETHOD(get_Elevation)(/*[out, retval]*/ long *pElevation) {
  116. try {
  117. if (!pElevation) {
  118. return E_POINTER;
  119. }
  120. ATL_LOCKT();
  121. *pElevation = m_Elevation;
  122. return NOERROR;
  123. } catch (...) {
  124. return E_POINTER;
  125. }
  126. }
  127. STDMETHOD(put_Elevation)(/*[in]*/ long NewElevation) {
  128. ATL_LOCKT();
  129. m_Elevation = NewElevation;
  130. MARK_DIRTY(T);
  131. return NOERROR;
  132. }
  133. STDMETHOD(Clone) (ILocator **ppNew) {
  134. try {
  135. if (!ppNew) {
  136. return E_POINTER;
  137. }
  138. ATL_LOCKT();
  139. HRESULT hr = basetype::Clone(ppNew);
  140. if (FAILED(hr)) {
  141. return hr;
  142. }
  143. T* pt = static_cast<T*>(*ppNew);
  144. pt->m_SignalPolarisation = m_SignalPolarisation;
  145. pt->m_WestPosition = m_WestPosition;
  146. pt->m_OrbitalPosition = m_OrbitalPosition;
  147. pt->m_Azimuth = m_Azimuth;
  148. pt->m_Elevation = m_Elevation;
  149. return NOERROR;
  150. } catch (HRESULT h) {
  151. return h;
  152. } catch (...) {
  153. return E_POINTER;
  154. }
  155. }
  156. };
  157. typedef CComQIPtr<IDVBSLocator> PQDVBSLocator;
  158. }; // namespace
  159. #endif // DVBSLOCATORIMPL_H
  160. // end of file -- DVBSlocatorimpl.h