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
class MatrixModule
: public QObject{
Q_OBJECT
public:
/*!
\enum AddressingMode
\brief Type of addressing mode available
*/
enum AddressingMode
{
Short = 0, //!< Short Addressing
Long //!< Long Addressing
};
/*!
\struct Address
\brief Structure that stores the address
This structure stores the Address (Short or Long) and also the Adressing Mode
*/
typedef struct
{
AddressingMode type; //!< Addressing Mode: Short or Long
quint64 Long; //!< Transceiver Long Address
quint16 Short; //!< Transceiver Short Address
bool valid; //!< Flag: valid address
} Address;
[...]
Address queryTransceiverAddress();
[...]
};
class MatrixModule : public QObject
{
Q_OBJECT
public:
/*!
\enum AddressingMode
\brief Type of addressing mode available
*/
enum AddressingMode
{
Short = 0, //!< Short Addressing
Long //!< Long Addressing
};
/*!
\struct Address
\brief Structure that stores the address
This structure stores the Address (Short or Long) and also the Adressing Mode
*/
typedef struct
{
AddressingMode type; //!< Addressing Mode: Short or Long
quint64 Long; //!< Transceiver Long Address
quint16 Short; //!< Transceiver Short Address
bool valid; //!< Flag: valid address
} Address;
[...]
Address queryTransceiverAddress();
[...]
};
To copy to clipboard, switch view to plain text mode
code.cpp
/*!
\brief Query Transceiver Address
Query Transceiver Address (Host -> RF Transceiver)
\return A structure with the address
*/
MatrixModule::Address MatrixModule::queryTransceiverAddress()
{
[...]
}
/*!
\brief Query Transceiver Address
Query Transceiver Address (Host -> RF Transceiver)
\return A structure with the address
*/
MatrixModule::Address MatrixModule::queryTransceiverAddress()
{
[...]
}
To copy to clipboard, switch view to plain text mode
Bookmarks