fbxpair.h 1.8 KB

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