FeatureContainer.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*=============================================================================
  2. Copyright (C) 2012 Allied Vision Technologies. All Rights Reserved.
  3. Redistribution of this file, in original or modified form, without
  4. prior written consent of Allied Vision Technologies is prohibited.
  5. -------------------------------------------------------------------------------
  6. File: FeatureContainer.h
  7. Description: Definition of class AVT::VmbAPI::FeatureContainer.
  8. -------------------------------------------------------------------------------
  9. THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  10. WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE,
  11. NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  12. DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  13. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  14. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  15. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  16. AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
  17. TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  18. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  19. =============================================================================*/
  20. #ifndef AVT_VMBAPI_FEATURECONTAINER_H
  21. #define AVT_VMBAPI_FEATURECONTAINER_H
  22. #include <VimbaC/Include/VmbCommonTypes.h>
  23. #include <VimbaCPP/Include/VimbaCPPCommon.h>
  24. #include <VimbaCPP/Include/BasicLockable.h>
  25. #include <VimbaCPP/Include/SharedPointerDefines.h>
  26. #include <VimbaCPP/Include/Feature.h>
  27. namespace AVT {
  28. namespace VmbAPI {
  29. class FeatureContainer : public virtual BasicLockable
  30. {
  31. public:
  32. //
  33. // Method: FeatureContainer constructor
  34. //
  35. // Purpose: Creates an instance of class FeatureContainer
  36. //
  37. IMEXPORT FeatureContainer();
  38. //
  39. // Method: FeatureContainer destructor
  40. //
  41. // Purpose: Destroys an instance of class FeatureContainer
  42. //
  43. IMEXPORT ~FeatureContainer();
  44. //
  45. // Method: GetFeatureByName()
  46. //
  47. // Purpose: Gets one particular feature of a feature container (e.g. a camera)
  48. //
  49. // Parameters:
  50. //
  51. // [in ] const char* name The name of the feature to get
  52. // [out] FeaturePtr& pFeature The queried feature
  53. //
  54. // Returns:
  55. //
  56. // - VmbErrorSuccess: If no error
  57. // - VmbErrorDeviceNotOpen: Base feature class (e.g. Camera) was not opened.
  58. // - VmbErrorBadParameter: "name" is NULL.
  59. //
  60. IMEXPORT VmbErrorType GetFeatureByName( const char *pName, FeaturePtr &pFeature );
  61. //
  62. // Method: GetFeatures()
  63. //
  64. // Purpose: Gets all features of a feature container (e.g. a camera)
  65. //
  66. // Parameters:
  67. //
  68. // [out] FeaturePtrVector& features The container for all queried features
  69. //
  70. // Returns:
  71. //
  72. // - VmbErrorSuccess: If no error
  73. // - VmbErrorBadParameter: "features" is empty.
  74. //
  75. // Details: Once queried, this information remains static throughout the object's lifetime
  76. //
  77. VmbErrorType GetFeatures( FeaturePtrVector &features );
  78. VmbHandle_t GetHandle() const;
  79. protected:
  80. // Sets the C handle of a feature container
  81. void SetHandle( const VmbHandle_t handle );
  82. // Sets the C handle of a feature container to NULL
  83. void RevokeHandle();
  84. // Sets the back reference to feature container that each feature holds to NULL
  85. // and resets all known features
  86. void Reset();
  87. private:
  88. struct Impl;
  89. Impl *m_pImpl;
  90. IMEXPORT VmbErrorType GetFeatures( FeaturePtr *pFeatures, VmbUint32_t &size );
  91. // No copy ctor
  92. FeatureContainer( const FeatureContainer& );
  93. // No assignment operator
  94. FeatureContainer& operator=( const FeatureContainer& );
  95. };
  96. #include <VimbaCPP/Include/FeatureContainer.hpp>
  97. }} // namespace AVT::VmbAPI
  98. #endif