日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > c/c++ >内容正文

c/c++

halcon11用于C++的HTuple.h头文件,纯手添中文翻译!

發布時間:2024/6/30 c/c++ 43 豆豆
生活随笔 收集整理的這篇文章主要介紹了 halcon11用于C++的HTuple.h头文件,纯手添中文翻译! 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
halcon11用于C++的HTuple.h頭文件,純手添中文翻譯!樂于分享,請勿在非同意下轉載!


/****************************************************************************** HTuple.h --- 帶中文翻譯版***************************************************************************** ** Project: HALCON/C++* Description: Tuple data used for control parameters of HALCON operators** (c) 2010-2011 by MVTec Software GmbH* www.mvtec.com* ******************************************************************************* $Revision: 1.4 $* $Date: 2012/05/14 17:14:29 $******************************************************************************** 翻譯:DMM* 時間:2017年11月1日******************************************************************************/#ifndef HCPP_TUPLE_H #define HCPP_TUPLE_H#include <new>namespace HalconCpp {enum HTupleType {// The empty tuple does not yet have a defined data type//空元組還沒有定義的數據類型eTupleTypeEmpty = UNDEF_PAR,// The tuple is a pure array of integers//元組是一個純整數數組eTupleTypeLong = LONG_PAR,// The tuple is a pure array of floating point values//元組是浮點值的純數組eTupleTypeDouble = DOUBLE_PAR,// The tuple is a pure array of strings//元組是字符串的純數組eTupleTypeString = STRING_PAR,// The tuple is an array of Hcpar. Each element can have a different type//元組是Hcpar數組。每個元素都可以有不同的類型eTupleTypeMixed = MIXED_PAR };}#include "HTupleElement.h"namespace HalconCpp {// Smart pointer to internal data representation //智能指針到內部數據表示template<class T> class HSmartPtr;typedef HSmartPtr<HTupleData> HTupleDataPtr;// Tuple data used for control parameters of HALCON operators //用于控制HALCON運算符控制參數的元組數據 class LIntExport HTuple {friend class HalconAPI;friend class HTupleElement;public:/***************************************************************************//* Constructors / Destructor *//***************************************************************************/// Empty tuple//空元組HTuple();// Integer (machine pointer size)HTuple(Hlong l);// Integer array (machine pointer size)HTuple(Hlong* l, Hlong num);#if defined(HCPP_INT_OVERLOADS)// Integer (possibly smaller size than pointer)HTuple(INT i);// Integer array (possibly smaller size than pointer)HTuple(INT* i, Hlong num); #endif// Single precision floating point valueHTuple(float f);// Single precision floating point arrayHTuple(float* f, Hlong num);// Double precision floating point valueHTuple(double d);// Double precision floating point arrayHTuple(double* d, Hlong num);// String (C style)HTuple(const char *s);// String (object)HTuple(const HString& s);// MixedHTuple(Hcpar* p, Hlong num);// Constant tupleHTuple(const HTuple& length, const HTuple& value);// Element of another tupleHTuple(const HTupleElement& element);// HTupleHTuple(const HTuple& tuple);// Destructorvirtual ~HTuple();/***************************************************************************//* General members 一般成員函數 *//***************************************************************************/// Clear all data inside this tuple//清除此元組內的所有數據void Clear();// The number of elements of this tuple//這個元組的元素個數Hlong Length() const;// The data type of this tuple (pure data types or mixed tuple)//此元組的數據類型(純數據類型或混合元組)HTupleType Type() const;// Create a detached copy duplicating the underlying tuple data//創建一個分離的副本復制底層的元組數據HTuple Clone() const;// Append data to existing tuple//將數據追加到現有的元組HTuple &Append(const HTuple& tuple);// Returns a simple string representation of the tuple contents,// mainly intended for debugging purposes//返回元組內容的簡單字符串表示形式,主要用于調試目的HString ToString() const;/***************************************************************************//* Data access 數據訪問 *//***************************************************************************/// Direct array access will raise an exception if tuple type does not match!// Modifications to array will affect data in tuples as well.//如果tuple類型不匹配,直接數組訪問將引發異常!對數組的修改也會影響元組中的數據Hlong* LArr();double* DArr();char** SArr();Hcpar* PArr();// Safer but less efficient access is provided by copying the data.// Mismatched elements will be initialized with default values. Caller// is responsible for using HTuple::FreeArr() to free the array (do// not use "delete []" directly as transferring memory ownership // across DLL boundaries may cause problems with the C++ runtime)//更安全但更低效的訪問是通過復制數據提供的。不匹配的元素將使用默認值初始化。//調用者負責使用HTuple::FreeArr()來釋放數組(不要直接使用“delete[]”,因為//在DLL邊界上傳輸內存所有權可能會導致c++運行時出現問題)// Returns the tuple data as an array of Hlong. Release using DeleteArr()!//將tuple數據作為Hlong數組返回。使用DeleteArr()釋放!Hlong* ToLArr() const;// Returns the tuple data as an array of double. Release using DeleteArr()!//將tuple數據作為double數組返回。使用DeleteArr()釋放!double* ToDArr() const;// Returns the tuple data as an array of HString. Release using DeleteArr()!//將tuple數據作為HString數組返回。使用DeleteArr()釋放!HString* ToSArr() const;static void DeleteArr(Hlong* arr);static void DeleteArr(double* arr);static void DeleteArr(HString* arr);// Intentionally no ToPArr() as correctly releasing memory// for a Hcpar* array is problematic for the library user.// Assignment operatorHTuple& operator = (const HTuple& obj);// Element accessHTupleElement operator [] (Hlong index);const HTupleElement operator [] (Hlong index) const;HTupleElement operator [] (const HTuple& index);const HTupleElement operator [] (const HTuple& index) const;// Convenience access for first element//第一個元素的方便訪問#if defined(HCPP_INT_OVERLOADS)// Access integer value in first tuple element//在第一個元組元素中訪問整數值int I() const { return (*this)[0].I(); } #endif// Access integer value in first tuple element//在第一個元組元素中訪問整數值Hlong L() const { return (*this)[0].L(); }// Access floating-point value in first tuple element//在第一個元組元素中訪問浮點值double D() const { return (*this)[0].D(); }// Access string value in first tuple element//在第一個元組元素中訪問字符串值HString S() const { return (*this)[0].S(); }/**************************************************************************** Operators 操作函數 ****************************************************************************/// Test whether the types of the elements of a tuple are of type string.//測試元組的元素類型是否為字符串類型HTuple TupleIsStringElem() const;// Test whether the types of the elements of a tuple are of type real.//測試元組元素的類型是否為實數類型HTuple TupleIsRealElem() const;// Test whether the types of the elements of a tuple are of type integer.//測試元組元素的類型是否為整數類型HTuple TupleIsIntElem() const;// Return the types of the elements of a tuple.//返回元組元素的類型HTuple TupleTypeElem() const;// Test whether a tuple is of type mixed.//測試一個元組是否是混合類型HTuple TupleIsMixed() const;// Test whether a tuple is of type string.//測試一個元組是否為字符串類型HTuple TupleIsString() const;// Test whether the types of the elements of a tuple are of type real.//測試元組元素的類型是否為實數類型HTuple TupleIsReal() const;// Test whether a tuple is of type integer.//測試一個元組是否為整數HTuple TupleIsInt() const;// Return the type of a tuple.//返回元組的類型HTuple TupleType() const;// Calculate the value distribution of a tuple within a certain value range.//計算一個元組在一定值范圍內的值分布HTuple TupleHistoRange(const HTuple& Min, const HTuple& Max, const HTuple& NumBins, HTuple* BinSize) const;// Select tuple elements matching a regular expression.// 選擇與正則表達式匹配的元組元素HTuple TupleRegexpSelect(const HTuple& Expression) const;// Test if a string matches a regular expression.//測試字符串是否匹配正則表達式HTuple TupleRegexpTest(const HTuple& Expression) const;// Replace a substring using regular expressions.//使用正則表達式替換子字符串HTuple TupleRegexpReplace(const HTuple& Expression, const HTuple& Replace) const;// Extract substrings using regular expressions.//使用正則表達式提取子字符串HTuple TupleRegexpMatch(const HTuple& Expression) const;// Return a tuple of random numbers between 0 and 1.//返回0到1之間的隨機數字的一個元組static HTuple TupleRand(const HTuple& Length);// Return the number of elements of a tuple.//返回元組的元素個數HTuple TupleLength() const;// Calculate the sign of a tuple.//計算一個元組的符號HTuple TupleSgn() const;// Calculate the elementwise maximum of two tuples.//計算兩個元組的最大元素HTuple TupleMax2(const HTuple& T2) const;// Calculate the elementwise minimum of two tuples.//計算兩個元組的最小最小值?HTuple TupleMin2(const HTuple& T2) const;// Return the maximal element of a tuple.//返回元組的最大元素HTuple TupleMax() const;// Return the minimal element of a tuple.//返回元組的最小元素HTuple TupleMin() const;// Calculate the cumulative sums of a tuple.//計算元組的累計和HTuple TupleCumul() const;// Select the element of rank n of a tuple.//選擇一個元組的排序n的元素HTuple TupleSelectRank(const HTuple& RankIndex) const;// Return the median of the elements of a tuple.//返回元組元素的中位數HTuple TupleMedian() const;// Return the sum of all elements of a tuple.//返回元組所有元素的和HTuple TupleSum() const;// Return the mean value of a tuple of numbers.//返回一組數字的平均值HTuple TupleMean() const;// Return the standard deviation of the elements of a tuple.//返回元組元素的標準偏差HTuple TupleDeviation() const;// Discard all but one of successive identical elements of a tuple.//將一個元組的連續相同元素丟棄HTuple TupleUniq() const;// Return the indices of all occurrences of a tuple within another tuple.//返回另一個元組中所有出現的元組的索引HTuple TupleFind(const HTuple& ToFind) const;// Sort the elements of a tuple and return the indices of the sorted tuple.//對元組的元素進行排序,并返回已排序的元組的索引HTuple TupleSortIndex() const;// Sort the elements of a tuple in ascending order.//按升序對元組的元素進行排序HTuple TupleSort() const;// Invert a tuple.//反轉一個元組HTuple TupleInverse() const;// Concatenate two tuples to a new one.//將兩個元組連接到一個新的元組HTuple TupleConcat(const HTuple& T2) const;// Select several elements of a tuple.//選擇一個元組的幾個元素HTuple TupleSelectRange(const HTuple& Leftindex, const HTuple& Rightindex) const;// Select all elements from index "n" to the end of a tuple.//從索引“n”中選擇所有元素到一個元組的末尾HTuple TupleLastN(const HTuple& Index) const;// Select the first elements of a tuple.//選擇元組的第一個元素HTuple TupleFirstN(const HTuple& Index) const;// Inserts one or more elements into a tuple at index.//將一個或多個元素插入到一個tuple中HTuple TupleInsert(const HTuple& Index, const HTuple& InsertTuple) const;// Replaces one or more elements of a tuple.//替換元組中的一個或多個元素HTuple TupleReplace(const HTuple& Index, const HTuple& ReplaceTuple) const;// Remove elements from a tuple.//從元組中刪除元素HTuple TupleRemove(const HTuple& Index) const;// Select in mask specified elements of a tuple.//選擇一個元組的指定元素HTuple TupleSelectMask(const HTuple& Mask) const;// Select single elements of a tuple.//選擇一個元組的單個元素HTuple TupleSelect(const HTuple& Index) const;// Select single character or bit from a tuple.//從元組中選擇單個字符或位HTuple TupleStrBitSelect(const HTuple& Index) const;// Generate a tuple with a sequence of equidistant values.//生成一個帶有等距值序列的元組static HTuple TupleGenSequence(const HTuple& Start, const HTuple& End, const HTuple& Step);// Generate a tuple of a specific length and initialize its elements.//生成一個特定長度的元組并初始化其元素static HTuple TupleGenConst(const HTuple& Length, const HTuple& Const);// Read one or more environment variables.//讀取一個或多個環境變量HTuple TupleEnvironment() const;// Split strings into substrings between predefined separator symbol(s).//將字符串拆分為預定義分隔符符號(s)之間的子字符串HTuple TupleSplit(const HTuple& Separator) const;// Cut characters from position "n1" through "n2" out of a string tuple.//從字符串元組的“n2”中從位置“n1”中剪切字符HTuple TupleSubstr(const HTuple& Position1, const HTuple& Position2) const;// Cut all characters starting at position "n" out of a string tuple.//從字符串元組中從位置“n”處開始切割所有字符HTuple TupleStrLastN(const HTuple& Position) const;// Cut the first characters up to position "n" out of a string tuple.//將第一個字符剪成字符串tuple中的“n”HTuple TupleStrFirstN(const HTuple& Position) const;// Backward search for characters within a string tuple.//向后搜索字符串元組中的字符HTuple TupleStrrchr(const HTuple& ToFind) const;// Forward search for characters within a string tuple.//向前搜索字符串元組中的字符HTuple TupleStrchr(const HTuple& ToFind) const;// Backward search for strings within a string tuple.//向后搜索字符串元組中的字符串HTuple TupleStrrstr(const HTuple& ToFind) const;// Forward search for strings within a string tuple. // //向前搜索字符串元組中的字符串HTuple TupleStrstr(const HTuple& ToFind) const;// Determine the length of every string within a tuple of strings.//確定字符串中每個字符串的長度HTuple TupleStrlen() const;// Test, whether a tuple is elementwise less or equal to another tuple.//測試,一個元組是否小于或等于另一個元組HTuple TupleLessEqualElem(const HTuple& T2) const;// Test, whether a tuple is elementwise less than another tuple.//測試,一個元組是否比另一個元組更小HTuple TupleLessElem(const HTuple& T2) const;// Test, whether a tuple is elementwise greater or equal to another tuple.//測試,一個元組是否大于或等于另一個元組HTuple TupleGreaterEqualElem(const HTuple& T2) const;// Test, whether a tuple is elementwise greater than another tuple.//測試,一個元組是否大于另一個元組HTuple TupleGreaterElem(const HTuple& T2) const;// Test, whether two tuples are elementwise not equal.//測試,是否兩個元組不相等HTuple TupleNotEqualElem(const HTuple& T2) const;// Test, whether two tuples are elementwise equal.//測試,兩個元組是否相等HTuple TupleEqualElem(const HTuple& T2) const;// Test whether a tuple is less or equal to another tuple.//測試,一個元組是否小于或等于另一個元組HTuple TupleLessEqual(const HTuple& T2) const;// Test whether a tuple is less than another tuple.//測試一個元組是否小于另一個元組HTuple TupleLess(const HTuple& T2) const;// Test whether a tuple is greater or equal to another tuple.//測試一個元組是否大于或等于另一個元組HTuple TupleGreaterEqual(const HTuple& T2) const;// Test whether a tuple is greater than another tuple.//測試一個元組是否大于另一個元組HTuple TupleGreater(const HTuple& T2) const;// Test whether two tuples are not equal.//測試兩個元組是否 - 不相等HTuple TupleNotEqual(const HTuple& T2) const;// Test whether two tuples are equal.//測試兩個元組是否 - 相等HTuple TupleEqual(const HTuple& T2) const;// Compute the logical not of a tuple.//計算一個元組的邏輯"非"HTuple TupleNot() const;// Compute the logical exclusive or of two tuples.//計算一個元組的邏輯"異或"HTuple TupleXor(const HTuple& T2) const;// Compute the logical or of two tuples.//計算一個元組的邏輯"或"HTuple TupleOr(const HTuple& T2) const;// Compute the logical and of two tuples.//計算一個元組的邏輯"與"HTuple TupleAnd(const HTuple& T2) const;// Compute the bitwise not of a tuple.//按位計算一個元組的邏輯"非"HTuple TupleBnot() const;// Compute the bitwise exclusive or of two tuples.//按位計算一個元組的邏輯"異或"HTuple TupleBxor(const HTuple& T2) const;// Compute the bitwise or of two tuples.//按位計算一個元組的邏輯"或"HTuple TupleBor(const HTuple& T2) const;// Compute the bitwise and of two tuples.//按位計算一個元組的邏輯"與"HTuple TupleBand(const HTuple& T2) const;// Shift a tuple bitwise to the right.//向右移一位HTuple TupleRsh(const HTuple& Shift) const;// Shift a tuple bitwise to the left.//向左移一位HTuple TupleLsh(const HTuple& Shift) const;// Convert a tuple of integers into strings with the corresponding ASCII codes.//用相應的ASCII碼將一個整數元轉換成字符串HTuple TupleChrt() const;// Convert a tuple of strings into a tuple of their ASCII codes.//將一組字符串轉換成它們的ASCII碼元組HTuple TupleOrds() const;// Convert a tuple of integers into strings with the corresponding ASCII codes.//用相應的ASCII碼將一個整數元轉換成字符串HTuple TupleChr() const;// Convert a tuple of strings of length 1 into a tuple of their ASCII codes.//將長度為1的一組字符串轉換成它們的ASCII碼元組HTuple TupleOrd() const;// Convert a tuple into a tuple of strings.//將一個元組轉換成一個字符串元組HTuple TupleString(const HTuple& Format) const;// Check a tuple (of strings) whether it represents numbers.//檢查一個元組(字符串)是否表示數字HTuple TupleIsNumber() const;// Convert a tuple (of strings) into a tuple of numbers.//將一個元組(字符串)轉換成數字的元組HTuple TupleNumber() const;// Convert a tuple into a tuple of integer numbers.//將一個元組轉換成整數的元組HTuple TupleRound() const;// Convert a tuple into a tuple of integer numbers.//將一個元組轉換成整數的元組HTuple TupleInt() const;// Convert a tuple into a tuple of floating point numbers.//將一個元組轉換成浮點數的元組HTuple TupleReal() const;// Calculate the ldexp function of two tuples.//計算兩個元組的ldexp函數(ldexp:計算value乘以2的exp次冪)HTuple TupleLdexp(const HTuple& T2) const;// Calculate the remainder of the floating point division of two tuples.//計算兩個元組浮點除法的 - 余數HTuple TupleFmod(const HTuple& T2) const;// Calculate the remainder of the integer division of two tuples.//計算兩個元組的整數除數的 - 余數HTuple TupleMod(const HTuple& T2) const;// Compute the ceiling function of a tuple.//向上取整:取大于等于數值n的最小整數HTuple TupleCeil() const;// Compute the floor function of a tuple.//向下取整:取小于等于數值n的最小整數HTuple TupleFloor() const;// Calculate the power function of two tuples.//計算兩個元組的冪函數HTuple TuplePow(const HTuple& T2) const;// Compute the base 10 logarithm of a tuple.//計算一個元組的10對數HTuple TupleLog10() const;// Compute the natural logarithm of a tuple.//計算一個元組的對數LogHTuple TupleLog() const;// Compute the exponential of a tuple.//計算一個元組的指數HTuple TupleExp() const;// Compute the hyperbolic tangent of a tuple.//計算一個元組的雙曲正切HTuple TupleTanh() const;// Compute the hyperbolic cosine of a tuple.//計算一個元組的雙曲余弦HTuple TupleCosh() const;// Compute the hyperbolic sine of a tuple.//計算一個元組的雙曲正弦HTuple TupleSinh() const;// Convert a tuple from degrees to radians.//將一個元組從角度轉換成弧度HTuple TupleRad() const;// Convert a tuple from radians to degrees.//將一個元組從弧度轉換成角度HTuple TupleDeg() const;// Compute the arctangent of a tuple for all four quadrants.//計算所有四個象限的一個元組的arctanHTuple TupleAtan2(const HTuple& X) const;// Compute the arctangent of a tuple.//計算一個元組的arctan()HTuple TupleAtan() const;// Compute the arccosine of a tuple.//計算一個元組的反余弦HTuple TupleAcos() const;// Compute the arcsine of a tuple.//計算一個元組的反正弦HTuple TupleAsin() const;// Compute the tangent of a tuple.//計算一個元組的正切HTuple TupleTan() const;// Compute the cosine of a tuple.//計算一個元組的cos()HTuple TupleCos() const;// Compute the sine of a tuple.//計算一個元組的sin()HTuple TupleSin() const;// Compute the absolute value of a tuple (as floating point numbers).//計算元組的絕對值(浮點數)HTuple TupleFabs() const;// Compute the square root of a tuple.//計算元組的平方根HTuple TupleSqrt() const;// Compute the absolute value of a tuple.//計算元組的絕對值HTuple TupleAbs() const;// Negate a tuple.//一個元組的非?HTuple TupleNeg() const;// Divide two tuples.//兩個元組相除HTuple TupleDiv(const HTuple& Q2) const;// Multiply two tuples.//兩個元組相乘HTuple TupleMult(const HTuple& P2) const;// Subtract two tuples.//兩個元組相減HTuple TupleSub(const HTuple& D2) const;// Add two tuples.//兩個元組相加HTuple TupleAdd(const HTuple& S2) const;// Deserialize a serialized tuple.//反序列化一個序列化元組static HTuple DeserializeTuple(const HSerializedItem& SerializedItemHandle);// Serialize a tuple.//序列化一個元組HSerializedItem SerializeTuple() const;// Write a tuple to a file.//將一個元組寫入文件void WriteTuple(const HTuple& FileName) const;// Read a tuple from a file.//從文件讀取一個元組static HTuple ReadTuple(const HTuple& FileName);/***************************************************************************//* Compatibility Layer 兼容性層 *//***************************************************************************/#if defined(HCPP_LEGACY_API)#include "HTupleLegacy.h"#endif#if (!defined(HCPP_LEGACY_API) || defined(_LIntDLL))// Casts from a HTuple to element data types are disabled in legacy mode,// as they may lead to ambiguous operator calls in existing user code// 從HTuple到元素數據類型的強制轉換在遺留模式下是禁用的,因為它們可能會導致現有用戶代碼中的不明確的操作調用#if defined(HCPP_INT_OVERLOADS)// Access integer value in first tuple element//在第一個元組元素中訪問整數值operator int() const { return I(); } #endif// Access integer value in first tuple element//在第一個元組元素中訪問整數值operator Hlong() const { return L(); }// Access floating-point value in first tuple element//在第一個元組元素中訪問浮點值operator float() const { return (float) D(); }// Access floating-point value in first tuple element//在第一個元組元素中訪問浮點值operator double() const { return D(); }// Access string value in first tuple element//在第一個元組元素中訪問字符串值operator HString() const { return S(); }#endif/***************************************************************************//* Operator overloads 運算符重載 *//***************************************************************************//* Unary operators 一元操作符 */bool operator ! (void) const;HTuple operator ~ (void) const;HTuple operator - (void) const;HTuple &operator ++ (void);/* Binary operators are declared below outside class HTuple 二元運算符被聲明在類的外部*//* Selected compound operators 選擇復合算子*/HTuple& operator += (const HTuple &val);H_COMPOUND_OP_OVERLOAD_DECLARATION(HTuple,+=)HTuple& operator -= (const HTuple &val);H_COMPOUND_OP_OVERLOAD_DECLARATION(HTuple,-=)HTuple& operator *= (const HTuple &val);H_COMPOUND_OP_OVERLOAD_DECLARATION(HTuple,*=)/***************************************************************************//* Helpers for code export or extension packages, do not call in used code用于代碼導出或擴展包的助手,不要調用使用過的代碼*//***************************************************************************/bool Continue(const HTuple &final_value, const HTuple &increment);// Internal use, exposed for extension packages and hdevengine only//內部使用,只用于擴展包和hdevengineHTuple(const Hctuple& tuple, bool copy=true);// Internal use, exposed for extension packages and hdevengine only//內部使用,只用于擴展包和hdevengineHctuple GetHctuple(bool copy) const;const Hctuple &GetHctupleRef() const;//被保護的! protected:// Create tuple wrapping internal representation//創建元組包裝內部表示HTuple(HTupleData* data);// Initialize during construction or from cleared tuple state//在構造或清除元組狀態期間初始化void InitFromTupleData(HTupleData* data);void InitFromTuple(const HTuple& tuple);// Internal use, exposed for extension packages and hdevengine only //內部使用,只用于擴展包和hdevenginevoid SetFromHctuple(const Hctuple& tuple, bool copy/*=true*/);// Revert internal representation to mixed tuple//將內部表示還原為混合元組void ConvertToMixed();// Resolve lazy copying on write access//解決寫訪問時的延遲復制bool AssertOwnership();protected:// Smart pointer to typed data container//智能指針到類型化數據容器HTupleDataPtr* mData;// Direct pointer for small tuple optimizations//用于小型元組優化的直接指針HTupleData* mDataPtr; };/***************************************************************************/ /* Operator overloads 運算符重載 */ /***************************************************************************/ #if defined(HCPP_OVERLOAD_TUPLE_OPERATORS)#define H_BIN_OP_OVERLOAD_DECLARATION(RET,OP) \LIntExport RET operator OP (const HTuple& op1, int op2 ); \LIntExport RET operator OP (const HTuple& op1, Hlong op2 ); \LIntExport RET operator OP (const HTuple& op1, float op2 ); \LIntExport RET operator OP (const HTuple& op1, double op2 ); \LIntExport RET operator OP (const HTuple& op1, const HString& op2); \LIntExport RET operator OP (const HTuple& op1, const char* op2 ); \LIntExport RET operator OP (const HTuple& op1, const HTupleElement& op2); \\LIntExport RET operator OP (const HTupleElement& op1, int op2 ); \LIntExport RET operator OP (const HTupleElement& op1, Hlong op2 ); \LIntExport RET operator OP (const HTupleElement& op1, float op2 ); \LIntExport RET operator OP (const HTupleElement& op1, double op2 ); \LIntExport RET operator OP (const HTupleElement& op1, const HString& op2 ); \LIntExport RET operator OP (const HTupleElement& op1, const char* op2 ); \LIntExport RET operator OP (const HTupleElement& op1, const HTupleElement &op2); \LIntExport RET operator OP (const HTupleElement& op1, const HTuple& op2 ); \\LIntExport RET operator OP (int op1 ,const HTuple& op2); \LIntExport RET operator OP (Hlong op1 ,const HTuple& op2); \LIntExport RET operator OP (float op1 ,const HTuple& op2); \LIntExport RET operator OP (double op1 ,const HTuple& op2); \LIntExport RET operator OP (const HString& op1 ,const HTuple& op2); \LIntExport RET operator OP (const char* op1 ,const HTuple& op2); \\LIntExport RET operator OP (int op1 ,const HTupleElement& op2); \LIntExport RET operator OP (Hlong op1 ,const HTupleElement& op2); \LIntExport RET operator OP (float op1 ,const HTupleElement& op2); \LIntExport RET operator OP (double op1 ,const HTupleElement& op2); \LIntExport RET operator OP (const HString& op1 ,const HTupleElement& op2); \LIntExport RET operator OP (const char* op1 ,const HTupleElement& op2); #else#define H_BIN_OP_OVERLOAD_DECLARATION(RET,OP) #endif/* Arithmetic operators */ LIntExport HTuple operator +(const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(HTuple,+) LIntExport HTuple operator - (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(HTuple,-) LIntExport HTuple operator * (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(HTuple,*) LIntExport HTuple operator / (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(HTuple,/) LIntExport HTuple operator % (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(HTuple,%)/* Boolean operators */LIntExport bool operator == (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(bool,==) LIntExport bool operator != (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(bool,!=) LIntExport bool operator >= (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(bool,>=) LIntExport bool operator <= (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(bool,<=) LIntExport bool operator > (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(bool,>) LIntExport bool operator < (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(bool,<) LIntExport bool operator && (const HTuple& val1, const HTuple &val2); // it is regarded as bad practice to overload logical operators as this leeds // to the unexpected behaviour that both operands must be evaluated // H_BIN_OP_OVERLOAD_DECLARATION(bool,&&) LIntExport bool operator || (const HTuple& val1, const HTuple &val2); // H_BIN_OP_OVERLOAD_DECLARATION(bool,||)/* Bitwise operators */LIntExport HTuple operator | (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(HTuple,|) LIntExport HTuple operator & (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(HTuple,&) LIntExport HTuple operator ^ (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(HTuple,^) LIntExport HTuple operator << (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(HTuple,<<) LIntExport HTuple operator >> (const HTuple& val1, const HTuple &val2); H_BIN_OP_OVERLOAD_DECLARATION(HTuple,>>)}#endif

  

轉載于:https://www.cnblogs.com/MoyuDing/p/7765054.html

總結

以上是生活随笔為你收集整理的halcon11用于C++的HTuple.h头文件,纯手添中文翻译!的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。