00001 /*============================================================================= 00002 Copyright (C) 2012 Allied Vision Technologies. All Rights Reserved. 00003 00004 Redistribution of this file, in original or modified form, without 00005 prior written consent of Allied Vision Technologies is prohibited. 00006 00007 ------------------------------------------------------------------------------- 00008 00009 File: IRegisterDevice.h 00010 00011 Description: Definition of interface AVT::VmbAPI::IRegisterDevice. 00012 00013 ------------------------------------------------------------------------------- 00014 00015 THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED 00016 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF TITLE, 00017 NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00018 DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 00019 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00020 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00021 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00022 AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 00023 TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00024 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 00026 =============================================================================*/ 00027 00028 #ifndef AVT_VMBAPI_IREGISTERDEVICE_H 00029 #define AVT_VMBAPI_IREGISTERDEVICE_H 00030 00031 #include <VimbaC/Include/VmbCommonTypes.h> 00032 #include <vector> 00033 00034 namespace AVT { 00035 namespace VmbAPI { 00036 00037 class IRegisterDevice 00038 { 00039 public: 00040 00041 virtual ~IRegisterDevice() {}; 00042 00043 // 00044 // Method: ReadRegisters() 00045 // 00046 // Purpose: Reads one or more registers consecutively. The number of registers to be read is determined by the number of provided addresses. 00047 // 00048 // Parameters: [in ] const Uint64Vector& addresses A list of register addresses 00049 // [out] Uint64Vector& buffer The returned data as vector 00050 // 00051 // Returns: 00052 // - VmbErrorSuccess: If all requested registers have been read 00053 // - VmbErrorBadParameter: Vectors "addresses" and/or "buffer" are empty. 00054 // - VmbErrorIncomplete: If at least one, but not all registers have been read. See overload ReadRegisters( const Uint64Vector&, Uint64Vector&, VmbUint32_t& ). 00055 // 00056 virtual VmbErrorType ReadRegisters( const Uint64Vector &addresses, Uint64Vector &buffer ) const = 0; 00057 00058 // 00059 // Method: ReadRegisters() 00060 // 00061 // Purpose: Same as ReadRegisters( const Uint64Vector&, Uint64Vector& ), but returns the number of successful read operations in case of an error. 00062 // 00063 // Parameters: [in ] const Uint64Vector& addresses A list of register addresses 00064 // [out] Uint64Vector& buffer The returned data as vector 00065 // [out] VmbUint32_t& completedReads The number of successfully read registers 00066 // 00067 // Returns: 00068 // - VmbErrorSuccess: If all requested registers have been read 00069 // - VmbErrorBadParameter: Vectors "addresses" and/or "buffer" are empty. 00070 // - VmbErrorIncomplete: If at least one, but not all registers have been read. 00071 // 00072 virtual VmbErrorType ReadRegisters( const Uint64Vector &addresses, Uint64Vector &buffer, VmbUint32_t &completedReads ) const = 0; 00073 00074 // 00075 // Method: WriteRegisters() 00076 // 00077 // Purpose: Writes one or more registers consecutively. The number of registers to be written is determined by the number of provided addresses. 00078 // 00079 // Parameters: [in ] const Uint64Vector& addresses A list of register addresses 00080 // [in ] const Uint64Vector& buffer The data to write as vector 00081 // 00082 // Returns: 00083 // - VmbErrorSuccess: If all requested registers have been written 00084 // - VmbErrorBadParameter: Vectors "addresses" and/or "buffer" are empty. 00085 // - VmbErrorIncomplete: If at least one, but not all registers have been written. See overload WriteRegisters( const Uint64Vector&, const Uint64Vector&, VmbUint32_t& ). 00086 // 00087 virtual VmbErrorType WriteRegisters( const Uint64Vector &addresses, const Uint64Vector &buffer ) = 0; 00088 00089 // 00090 // Method: WriteRegisters() 00091 // 00092 // Purpose: Same as WriteRegisters( const Uint64Vector&, const Uint64Vector& ), but returns the number of successful write operations in case of an error VmbErrorIncomplete. 00093 // 00094 // Parameters: [in ] const Uint64Vector& addresses A list of register addresses 00095 // [in ] const Uint64Vector& buffer The data to write as vector 00096 // [out] VmbUint32_t& completedWrites The number of successfully read registers 00097 // 00098 // Returns: 00099 // - VmbErrorSuccess: If all requested registers have been written 00100 // - VmbErrorBadParameter: Vectors "addresses" and/or "buffer" are empty. 00101 // - VmbErrorIncomplete: If at least one, but not all registers have been written. 00102 // 00103 virtual VmbErrorType WriteRegisters( const Uint64Vector &addresses, const Uint64Vector &buffer, VmbUint32_t &completedWrites ) = 0; 00104 00105 // 00106 // Method: ReadMemory() 00107 // 00108 // Purpose: Reads a block of memory. The number of bytes to read is determined by the size of the provided buffer. 00109 // 00110 // Parameters: [in ] const VmbUint64_t& address The address to read from 00111 // [out] UcharVector& buffer The returned data as vector 00112 // 00113 // Returns: 00114 // - VmbErrorSuccess: If all requested bytes have been read 00115 // - VmbErrorBadParameter: Vector "buffer" is empty. 00116 // - VmbErrorIncomplete: If at least one, but not all bytes have been read. See overload ReadMemory( const VmbUint64_t&, UcharVector&, VmbUint32_t& ). 00117 // 00118 virtual VmbErrorType ReadMemory( const VmbUint64_t &address, UcharVector &buffer ) const = 0; 00119 00120 // 00121 // Method: ReadMemory() 00122 // 00123 // Purpose: Same as ReadMemory( const Uint64Vector&, UcharVector& ), but returns the number of bytes successfully read in case of an error VmbErrorIncomplete. 00124 // 00125 // Parameters: [in ] const VmbUint64_t& address The address to read from 00126 // [out] UcharVector& buffer The returned data as vector 00127 // [out] VmbUint32_t& sizeComplete The number of successfully read bytes 00128 // 00129 // Returns: 00130 // - VmbErrorSuccess: If all requested bytes have been read 00131 // - VmbErrorBadParameter: Vector "buffer" is empty. 00132 // - VmbErrorIncomplete: If at least one, but not all bytes have been read. 00133 // 00134 virtual VmbErrorType ReadMemory( const VmbUint64_t &address, UcharVector &buffer, VmbUint32_t &sizeComplete ) const = 0; 00135 00136 // 00137 // Method: WriteMemory() 00138 // 00139 // Purpose: Writes a block of memory. The number of bytes to write is determined by the size of the provided buffer. 00140 // 00141 // Parameters: [in] const VmbUint64_t& address The address to write to 00142 // [in] const UcharVector& buffer The data to write as vector 00143 // 00144 // Returns: 00145 // - VmbErrorSuccess: If all requested bytes have been written 00146 // - VmbErrorBadParameter: Vector "buffer" is empty. 00147 // - VmbErrorIncomplete: If at least one, but not all bytes have been written. See overload WriteMemory( const VmbUint64_t&, const UcharVector&, VmbUint32_t& ). 00148 // 00149 virtual VmbErrorType WriteMemory( const VmbUint64_t &address, const UcharVector &buffer ) = 0; 00150 00151 // 00152 // Method: WriteMemory() 00153 // 00154 // Purpose: Same as WriteMemory( const Uint64Vector&, const UcharVector& ), but returns the number of bytes successfully written in case of an error VmbErrorIncomplete. 00155 // 00156 // Parameters: [in] const VmbUint64_t& address The address to write to 00157 // [in] const UcharVector& buffer The data to write as vector 00158 // [out] VmbUint32_t& sizeComplete The number of successfully written bytes 00159 // 00160 // Returns: 00161 // - VmbErrorSuccess: If all requested bytes have been written 00162 // - VmbErrorBadParameter: Vector "buffer" is empty. 00163 // - VmbErrorIncomplete: If at least one, but not all bytes have been written. 00164 // 00165 virtual VmbErrorType WriteMemory( const VmbUint64_t &address, const UcharVector &buffer, VmbUint32_t &sizeComplete ) = 0; 00166 }; 00167 00168 }} // namespace AVT::VmbAPI 00169 00170 #endif