| 1 | /**************************************************************************************** |
| 2 | |
| 3 | Copyright (C) 2015 Autodesk, Inc. |
| 4 | All rights reserved. |
| 5 | |
| 6 | Use of this software is subject to the terms of the Autodesk license agreement |
| 7 | provided at the time of installation or download, or which otherwise accompanies |
| 8 | this software in either electronic or hard copy form. |
| 9 | |
| 10 | ****************************************************************************************/ |
| 11 | |
| 12 | //! \file fbxpair.h |
| 13 | #ifndef _FBXSDK_CORE_BASE_PAIR_H_ |
| 14 | #define _FBXSDK_CORE_BASE_PAIR_H_ |
| 15 | |
| 16 | #include <fbxsdk/fbxsdk_def.h> |
| 17 | |
| 18 | #include <fbxsdk/fbxsdk_nsbegin.h> |
| 19 | |
| 20 | /** This class template holds a pair of objects. |
| 21 | * \nosubgrouping */ |
| 22 | template <typename First, typename Second> class FbxPair |
| 23 | { |
| 24 | public: |
| 25 | //! Constructor. |
| 26 | inline FbxPair() : mFirst(), mSecond() {} |
| 27 | |
| 28 | /** Constructor. |
| 29 | * \param pFirst The first object. |
| 30 | * \param pSecond The second object. */ |
| 31 | inline FbxPair(const First& pFirst, const Second& pSecond) : mFirst(pFirst), mSecond(pSecond) {} |
| 32 | |
| 33 | /** Assignment operator. |
| 34 | * \param pOther The pair to be copied. */ |
| 35 | inline FbxPair<First, Second>& operator=(const FbxPair<First, Second>& pOther) |
| 36 | { |
| 37 | mFirst = pOther.mFirst; |
| 38 | mSecond = pOther.mSecond; |
| 39 | return *this; |
| 40 | } |
| 41 | |
| 42 | /** Comparison operator. |
| 43 | * \param pOther The pair to be compared. */ |
| 44 | inline bool operator==(const FbxPair<First, Second>& pOther) |
| 45 | { |
| 46 | return mFirst == pOther.mFirst && mSecond == pOther.mSecond; |
| 47 | } |
| 48 | |
| 49 | /** Inverse comparison operator. |
| 50 | * \param pOther The pair to be compared. */ |
| 51 | inline bool operator!=(const FbxPair<First, Second>& pOther) |
| 52 | { |
| 53 | return !operator==(pOther); |
| 54 | } |
| 55 | |
| 56 | First mFirst; //!< The first object in the pair. |
| 57 | Second mSecond; //!< The second object in the pair. |
| 58 | }; |
| 59 | |
| 60 | #include <fbxsdk/fbxsdk_nsend.h> |
| 61 | |
| 62 | #endif /* _FBXSDK_CORE_BASE_PAIR_H_ */ |
| 63 | |