Hi,

I've got a class MatrixModule and a method of this class that has to return 3 values.
Where is the best place to put the definition of the structure that stores the 3 values? Inside the class definition like enum definition?
Or is it a better idea use a class to store that values?

Also I use Doxygen for documenting my class. I've got some problem to documents a enum type that is a record of the structure.

Can anyone suggests me the right code?

header.h
Qt Code:
  1. class MatrixModule : public QObject
  2. {
  3. Q_OBJECT
  4.  
  5. public:
  6.  
  7. /*!
  8.   \enum AddressingMode
  9.   \brief Type of addressing mode available
  10.   */
  11. enum AddressingMode
  12. {
  13. Short = 0, //!< Short Addressing
  14. Long //!< Long Addressing
  15. };
  16.  
  17. /*!
  18.   \struct Address
  19.   \brief Structure that stores the address
  20.  
  21.   This structure stores the Address (Short or Long) and also the Adressing Mode
  22.   */
  23. typedef struct
  24. {
  25. AddressingMode type; //!< Addressing Mode: Short or Long
  26.  
  27. quint64 Long; //!< Transceiver Long Address
  28. quint16 Short; //!< Transceiver Short Address
  29.  
  30. bool valid; //!< Flag: valid address
  31. } Address;
  32.  
  33. [...]
  34.  
  35. Address queryTransceiverAddress();
  36.  
  37. [...]
  38. };
To copy to clipboard, switch view to plain text mode 

code.cpp
Qt Code:
  1. /*!
  2.   \brief Query Transceiver Address
  3.  
  4.   Query Transceiver Address (Host -> RF Transceiver)
  5.  
  6.   \return A structure with the address
  7. */
  8. MatrixModule::Address MatrixModule::queryTransceiverAddress()
  9. {
  10. [...]
  11. }
To copy to clipboard, switch view to plain text mode