Browse Source

Doc: using @overload for const overloads of member functions.

pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
5a42ee4e91
  1. 22
      src/Math/Matrix.h
  2. 23
      src/Math/Vector.h
  3. 8
      src/Trade/MeshData.h

22
src/Math/Matrix.h

@ -60,12 +60,7 @@ template<size_t size, class T> class Matrix {
inline constexpr static Matrix<size, T>& from(T* data) { inline constexpr static Matrix<size, T>& from(T* data) {
return *reinterpret_cast<Matrix<size, T>*>(data); return *reinterpret_cast<Matrix<size, T>*>(data);
} }
/** @overload */
/**
* @copybrief from(T*)
* @copydetails from(T*)
* @todoc Remove workaround when Doxygen supports \@copydoc again
*/
inline constexpr static const Matrix<size, T>& from(const T* data) { inline constexpr static const Matrix<size, T>& from(const T* data) {
return *reinterpret_cast<const Matrix<size, T>*>(data); return *reinterpret_cast<const Matrix<size, T>*>(data);
} }
@ -133,24 +128,13 @@ template<size_t size, class T> class Matrix {
* order. * order.
*/ */
inline T* data() { return _data; } inline T* data() { return _data; }
inline constexpr const T* data() const { return _data; } /**< @overload */
/**
* @copybrief data()
* @copydetails data()
* @todoc Remove workaround when Doxygen supports \@copydoc again
*/
inline constexpr const T* data() const { return _data; }
/** @brief %Matrix column */ /** @brief %Matrix column */
inline Vector<size, T>& operator[](size_t col) { inline Vector<size, T>& operator[](size_t col) {
return Vector<size, T>::from(_data+col*size); return Vector<size, T>::from(_data+col*size);
} }
/** @overload */
/**
* @copybrief operator[]()
* @copydetails operator[]()
* @todoc Remove workaround when Doxygen supports \@copydoc again
*/
inline constexpr const Vector<size, T>& operator[](size_t col) const { inline constexpr const Vector<size, T>& operator[](size_t col) const {
return Vector<size, T>::from(_data+col*size); return Vector<size, T>::from(_data+col*size);
} }

23
src/Math/Vector.h

@ -47,12 +47,7 @@ template<size_t size, class T> class Vector {
inline constexpr static Vector<size, T>& from(T* data) { inline constexpr static Vector<size, T>& from(T* data) {
return *reinterpret_cast<Vector<size, T>*>(data); return *reinterpret_cast<Vector<size, T>*>(data);
} }
/** @overload */
/**
* @copybrief from(T*)
* @copydetails from(T*)
* @todoc Remove workaround when Doxygen supports \@copydoc again
*/
inline constexpr static const Vector<size, T>& from(const T* data) { inline constexpr static const Vector<size, T>& from(const T* data) {
return *reinterpret_cast<const Vector<size, T>*>(data); return *reinterpret_cast<const Vector<size, T>*>(data);
} }
@ -124,23 +119,11 @@ template<size_t size, class T> class Vector {
* @return Array with the same size as the vector * @return Array with the same size as the vector
*/ */
inline T* data() { return _data; } inline T* data() { return _data; }
inline constexpr const T* data() const { return _data; } /**< @overload */
/**
* @copybrief data()
* @copydetails data()
* @todoc Remove workaround when Doxygen supports \@copydoc again
*/
inline constexpr const T* data() const { return _data; }
/** @brief Value at given position */ /** @brief Value at given position */
inline T& operator[](size_t pos) { return _data[pos]; } inline T& operator[](size_t pos) { return _data[pos]; }
inline constexpr T operator[](size_t pos) const { return _data[pos]; } /**< @overload */
/**
* @copybrief operator[]()
* @copydetails operator[]()
* @todoc Remove workaround when Doxygen supports \@copydoc again
*/
inline constexpr T operator[](size_t pos) const { return _data[pos]; }
/** @brief Equality operator */ /** @brief Equality operator */
inline bool operator==(const Vector<size, T>& other) const { inline bool operator==(const Vector<size, T>& other) const {

8
src/Trade/MeshData.h

@ -60,7 +60,7 @@ class MAGNUM_EXPORT MeshData {
* @return Indices or nullptr if the mesh is not indexed. * @return Indices or nullptr if the mesh is not indexed.
*/ */
inline std::vector<unsigned int>* indices() { return _indices; } inline std::vector<unsigned int>* indices() { return _indices; }
inline const std::vector<unsigned int>* indices() const { return _indices; } /**< @copydoc indices() */ inline const std::vector<unsigned int>* indices() const { return _indices; } /**< @overload */
/** @brief Count of vertex arrays */ /** @brief Count of vertex arrays */
inline size_t vertexArrayCount() const { return _vertices.size(); }; inline size_t vertexArrayCount() const { return _vertices.size(); };
@ -72,7 +72,7 @@ class MAGNUM_EXPORT MeshData {
* ID. * ID.
*/ */
inline std::vector<Vector4>* vertices(size_t id) { return _vertices[id]; } inline std::vector<Vector4>* vertices(size_t id) { return _vertices[id]; }
inline const std::vector<Vector4>* vertices(size_t id) const { return _vertices[id]; } /**< @copydoc vertices() */ inline const std::vector<Vector4>* vertices(size_t id) const { return _vertices[id]; } /**< @overload */
/** @brief Count of normal arrays */ /** @brief Count of normal arrays */
inline size_t normalArrayCount() const { return _normals.size(); }; inline size_t normalArrayCount() const { return _normals.size(); };
@ -84,7 +84,7 @@ class MAGNUM_EXPORT MeshData {
* ID. * ID.
*/ */
inline std::vector<Vector3>* normals(size_t id) { return _normals[id]; } inline std::vector<Vector3>* normals(size_t id) { return _normals[id]; }
inline const std::vector<Vector3>* normals(size_t id) const { return _normals[id]; } /**< @copydoc normals() */ inline const std::vector<Vector3>* normals(size_t id) const { return _normals[id]; } /**< @overload */
/** @brief Count of 2D texture coordinate arrays */ /** @brief Count of 2D texture coordinate arrays */
inline size_t textureCoords2DArrayCount() const { return _textureCoords2D.size(); }; inline size_t textureCoords2DArrayCount() const { return _textureCoords2D.size(); };
@ -96,7 +96,7 @@ class MAGNUM_EXPORT MeshData {
* coordinates array with given ID. * coordinates array with given ID.
*/ */
inline std::vector<Vector2>* textureCoords2D(size_t id) { return _textureCoords2D[id]; } inline std::vector<Vector2>* textureCoords2D(size_t id) { return _textureCoords2D[id]; }
inline const std::vector<Vector2>* textureCoords2D(size_t id) const { return _textureCoords2D[id]; } /**< @copydoc textureCoords2D() */ inline const std::vector<Vector2>* textureCoords2D(size_t id) const { return _textureCoords2D[id]; } /**< @overload */
private: private:
Mesh::Primitive _primitive; Mesh::Primitive _primitive;

Loading…
Cancel
Save