Interface.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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: Interface.h
  7. Description: Definition of class AVT::VmbAPI::Interface.
  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_INTERFACE_H
  21. #define AVT_VMBAPI_INTERFACE_H
  22. #include <VimbaC/Include/VimbaC.h>
  23. #include <VimbaCPP/Include/VimbaCPPCommon.h>
  24. #include <VimbaCPP/Include/FeatureContainer.h>
  25. #include <vector>
  26. namespace AVT {
  27. namespace VmbAPI {
  28. class Interface : public FeatureContainer
  29. {
  30. public:
  31. Interface( const VmbInterfaceInfo_t *pInterfaceInfo );
  32. virtual ~Interface();
  33. //
  34. // Method: Open()
  35. //
  36. // Purpose: Open an interface handle for feature access.
  37. //
  38. // Parameters: none
  39. //
  40. // Returns:
  41. // - VmbErrorSuccess: If no error
  42. // - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
  43. // - VmbErrorNotFound: The designated interface cannot be found
  44. //
  45. // Details: An interface can be opened if interface-specific control is required, such as I/O pins
  46. // on a frame grabber card. Control is then possible via feature access methods.
  47. //
  48. IMEXPORT virtual VmbErrorType Open();
  49. //
  50. // Method: Close()
  51. //
  52. // Purpose: Close an interface.
  53. //
  54. // Parameters: none
  55. //
  56. // Returns:
  57. // - VmbErrorSuccess: If no error
  58. // - VmbErrorApiNotStarted: VmbStartup() was not called before the current command
  59. // - VmbErrorBadHandle: The handle is not valid
  60. //
  61. IMEXPORT virtual VmbErrorType Close();
  62. //
  63. // Method: GetID()
  64. //
  65. // Purpose: Gets the ID of an interface.
  66. //
  67. // Parameters: [out] std::string& interfaceID The ID of the interface
  68. //
  69. // Returns:
  70. // - VmbErrorSuccess: If no error
  71. //
  72. // Details: This information remains static throughout the object's lifetime
  73. //
  74. VmbErrorType GetID( std::string &interfaceID ) const;
  75. //
  76. // Method: GetType()
  77. //
  78. // Purpose: Gets the type, e.g. FireWire, GigE or USB of an interface.
  79. //
  80. // Parameters: [out] VmbInterfaceType& type The type of the interface
  81. //
  82. // Returns:
  83. // - VmbErrorSuccess: If no error
  84. //
  85. // Details: This information remains static throughout the object's lifetime
  86. //
  87. IMEXPORT VmbErrorType GetType( VmbInterfaceType &type ) const;
  88. //
  89. // Method: GetName()
  90. //
  91. // Purpose: Gets the name of an interface.
  92. //
  93. // Parameters: [out] std::string& name The name of the interface
  94. //
  95. // Returns:
  96. // - VmbErrorSuccess: If no error
  97. //
  98. // This information remains static throughout the object's lifetime
  99. //
  100. VmbErrorType GetName( std::string &name ) const;
  101. //
  102. // Method: GetSerialNumber()
  103. //
  104. // Purpose: Gets the serial number of an interface.
  105. //
  106. // Parameters: [out] std::string& serialNumber The serial number of the interface
  107. //
  108. // Returns:
  109. // - VmbErrorSuccess: If no error
  110. //
  111. // This information remains static throughout the object's lifetime
  112. //
  113. VmbErrorType GetSerialNumber( std::string &serialNumber ) const;
  114. //
  115. // Method: GetPermittedAccess()
  116. //
  117. // Purpose: Gets the access mode of an interface.
  118. //
  119. // Parameters: [out] VmbAccessModeType& accessMode The possible access mode of the interface
  120. //
  121. // Returns:
  122. // - VmbErrorSuccess: If no error
  123. //
  124. IMEXPORT VmbErrorType GetPermittedAccess( VmbAccessModeType &accessMode ) const;
  125. private:
  126. // Default ctor
  127. Interface();
  128. // Copy ctor
  129. Interface( const Interface& );
  130. // Assignment operator
  131. Interface& operator=( const Interface& );
  132. struct Impl;
  133. Impl *m_pImpl;
  134. // Array functions to pass data across DLL boundaries
  135. IMEXPORT VmbErrorType GetID( char * const pID, VmbUint32_t &length ) const;
  136. IMEXPORT VmbErrorType GetName( char * const pName, VmbUint32_t &length ) const;
  137. IMEXPORT VmbErrorType GetSerialNumber( char * const pSerial, VmbUint32_t &length ) const;
  138. };
  139. #include <VimbaCPP/Include/Interface.hpp>
  140. }} // namespace AVT::VmbAPI
  141. #endif