Browse Source

Move friend declarations into private class sections.

And hide them from Doxygen so it's not complaining. Related bug:
https://bugzilla.gnome.org/show_bug.cgi?id=776986
pull/225/head
Vladimír Vondruš 8 years ago
parent
commit
a4d32e650a
  1. 6
      src/Magnum/AbstractResourceLoader.h
  2. 14
      src/Magnum/Context.h
  3. 10
      src/Magnum/Platform/Screen.h
  4. 10
      src/Magnum/Platform/ScreenedApplication.h
  5. 6
      src/Magnum/Resource.h
  6. 10
      src/Magnum/SceneGraph/AbstractFeature.h
  7. 10
      src/Magnum/SceneGraph/AbstractObject.h
  8. 8
      src/Magnum/SceneGraph/Object.h

6
src/Magnum/AbstractResourceLoader.h

@ -101,8 +101,6 @@ Resource<Mesh> myMesh = manager->get<Mesh>("my-mesh");
buffers), should that be allowed?
*/
template<class T> class AbstractResourceLoader {
friend Implementation::ResourceManagerData<T>;
public:
explicit AbstractResourceLoader(): manager(nullptr), _requestedCount(0), _loadedCount(0), _notFoundCount(0) {}
@ -213,6 +211,10 @@ template<class T> class AbstractResourceLoader {
virtual void doLoad(ResourceKey key) = 0;
private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Implementation::ResourceManagerData<T>;
#endif
Implementation::ResourceManagerData<T>* manager;
std::size_t _requestedCount,
_loadedCount,

14
src/Magnum/Context.h

@ -60,8 +60,6 @@ See also @ref Extensions namespace, which contain compile-time information
about OpenGL extensions.
*/
class MAGNUM_EXPORT Extension {
friend Context;
public:
/** @brief All extensions for given OpenGL version */
static const std::vector<Extension>& extensions(Version version);
@ -76,6 +74,10 @@ class MAGNUM_EXPORT Extension {
constexpr const char* string() const { return _string; }
private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Context;
#endif
std::size_t _index;
Version _requiredVersion;
Version _coreVersion;
@ -115,9 +117,6 @@ Arguments:
*/
class MAGNUM_EXPORT Context {
friend Implementation::ContextState;
friend Platform::Context;
public:
#ifndef MAGNUM_TARGET_WEBGL
/**
@ -572,6 +571,11 @@ class MAGNUM_EXPORT Context {
MAGNUM_LOCAL bool isCoreProfileInternal(Implementation::ContextState& state);
private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Implementation::ContextState;
friend Platform::Context;
#endif
explicit Context(NoCreateT, Int argc, const char** argv, void functionLoader());
bool tryCreate();

10
src/Magnum/Platform/Screen.h

@ -66,10 +66,6 @@ The following specialization are explicitly compiled into each particular
- @ref XEglApplication "BasicScreen<XEglApplication>"
*/
template<class Application> class BasicScreen: private Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>> {
friend Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend Containers::LinkedList<BasicScreen<Application>>;
friend BasicScreenedApplication<Application>;
public:
#ifdef DOXYGEN_GENERATING_OUTPUT
/**
@ -257,6 +253,12 @@ template<class Application> class BasicScreen: private Containers::LinkedListIte
virtual void mouseMoveEvent(MouseMoveEvent& event);
private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend Containers::LinkedList<BasicScreen<Application>>;
friend BasicScreenedApplication<Application>;
#endif
PropagatedEvents _propagatedEvents;
};

10
src/Magnum/Platform/ScreenedApplication.h

@ -97,10 +97,6 @@ The following specialization are explicitly compiled into each particular
- @ref XEglApplication "BasicScreenedApplication<XEglApplication>"
*/
template<class Application> class BasicScreenedApplication: public Application, private Containers::LinkedList<BasicScreen<Application>> {
friend Containers::LinkedList<BasicScreen<Application>>;
friend Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend BasicScreen<Application>;
public:
/**
* @brief Default constructor
@ -236,6 +232,12 @@ template<class Application> class BasicScreenedApplication: public Application,
virtual void globalDrawEvent() = 0;
private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Containers::LinkedList<BasicScreen<Application>>;
friend Containers::LinkedListItem<BasicScreen<Application>, BasicScreenedApplication<Application>>;
friend BasicScreen<Application>;
#endif
/* The user is supposed to override only globalViewportEvent() and
globalDrawEvent(), these implementations are dispatching the events
to attached screens. */

6
src/Magnum/Resource.h

@ -119,8 +119,6 @@ template<class T, class U = T>
template<class T, class U>
#endif
class Resource {
friend Implementation::ResourceManagerData<T>;
public:
/**
* @brief Default constructor
@ -215,6 +213,10 @@ class Resource {
}
private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Implementation::ResourceManagerData<T>;
#endif
Resource(Implementation::ResourceManagerData<T>* manager, ResourceKey key): manager(manager), _key(key), lastCheck(0), _state(ResourceState::NotLoaded), data(nullptr) {
manager->incrementReferenceCount(key);
}

10
src/Magnum/SceneGraph/AbstractFeature.h

@ -156,10 +156,6 @@ template<UnsignedInt dimensions, class T> class AbstractFeature
: private Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>
#endif
{
friend Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
template<class> friend class Object;
public:
/**
* @brief Constructor
@ -278,6 +274,12 @@ template<UnsignedInt dimensions, class T> class AbstractFeature
/*@}*/
private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
template<class> friend class Object;
#endif
CachedTransformations _cachedTransformations;
};

10
src/Magnum/SceneGraph/AbstractObject.h

@ -89,10 +89,6 @@ template<UnsignedInt dimensions, class T> class AbstractObject
: private Containers::LinkedList<AbstractFeature<dimensions, T>>
#endif
{
friend Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
friend AbstractFeature<dimensions, T>;
public:
/** @brief Matrix type */
typedef MatrixTypeFor<dimensions, T> MatrixType;
@ -272,6 +268,12 @@ template<UnsignedInt dimensions, class T> class AbstractObject
/*@}*/
private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Containers::LinkedList<AbstractFeature<dimensions, T>>;
friend Containers::LinkedListItem<AbstractFeature<dimensions, T>, AbstractObject<dimensions, T>>;
friend AbstractFeature<dimensions, T>;
#endif
virtual AbstractObject<dimensions, T>* doScene() = 0;
virtual const AbstractObject<dimensions, T>* doScene() const = 0;

8
src/Magnum/SceneGraph/Object.h

@ -111,9 +111,6 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
, private Containers::LinkedList<Object<Transformation>>, private Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>
#endif
{
friend Containers::LinkedList<Object<Transformation>>;
friend Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>;
public:
/** @brief Matrix type */
typedef MatrixTypeFor<Transformation::Dimensions, typename Transformation::Type> MatrixType;
@ -360,6 +357,11 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
#endif
private:
#ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */
friend Containers::LinkedList<Object<Transformation>>;
friend Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>;
#endif
Object<Transformation>* doScene() override final;
const Object<Transformation>* doScene() const override final;

Loading…
Cancel
Save