Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 2, 2010, 3:16:08 AM (14 years ago)
Author:
landauf
Message:

added documentation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/doc/src/libraries/util/Scope.h

    r7266 r7323  
    2727 */
    2828
     29/**
     30@file
     31@ingroup Util SingletonScope
     32@brief Declaration of the classes that are needed to use Scopes:
     33orxonox::Scope, orxonox::ScopeListener, and orxonox::ScopeManager.
     34
     35@anchor Scope
     36
     37A virtual scope can be represented by an instance of class orxonox::Scope. orxonox::Scope<@a scope> is a template
     38an its template argument defines the name of the virtual scope. See orxonox::ScopeID for an enumeration of the
     39available values for @a scope. The orxonox::Scope object for a given @a scope can be activated or deactivated.
     40Instances of orxonox::ScopeListener can register for a given @a scope and will get a notification if the
     41corresponding orxonox::Scope object changes its state.
     42
     43To avoid multiple instances of orxonox::Scope<@a scope> in different libraries, each instance of orxonox::Scope
     44registers in orxonox::ScopeManager, where they are linked statically in the util library.
     45
     46Scopes are usually used to control the creation and destruction of Singletons.
     47
     48@see orxonox::ScopedSingletonManager
     49@see orxonox::Singleton
     50*/
     51
    2952#ifndef __Util_Scope_H__
    3053#define __Util_Scope_H__
     
    4265{
    4366    /**
    44         @brief The ScopeManager stores the variables of the scope templates in a statically linked context.
     67        @brief The ScopeManager stores the variables of the Scope templates in a statically linked context.
     68
     69        If all Scope objects are managed by this class, they are statically linked in the util library.
     70        Without this, a new instance of Scope<T> for each T would be created in every library of Orxonox,
     71        which is of course not the desired behavior.
     72
     73        @see See @ref Scope "this description" for details about the interrelationship of Scope, ScopeListener, and ScopeManager.
    4574    */
    4675    class _UtilExport ScopeManager
     
    5685
    5786    /**
    58         @brief ScopeListeners register themselves in the corresponding scope and wait for notifications.
     87        @brief ScopeListeners register themselves in the corresponding Scope and wait for notifications.
     88        Notifications are sent if a Scope is activated or deactivated.
     89
     90        @see See @ref Scope "this description" for details about the interrelationship of Scope, ScopeListener, and ScopeManager.
    5991    */
    6092    class _UtilExport ScopeListener
     
    86118        Objects inheriting from a ScopeListener are registered in a list (different for each scope).
    87119        If the scope gets activated or deactivated, all objects in this list are notified.
     120
     121        @see See @ref Scope "this description" for details about the interrelationship of Scope, ScopeListener, and ScopeManager.
    88122    */
    89123    template <ScopeID::Value scope>
     
    130164            }
    131165
     166            //! Deactivates the listeners of this scope in case the scope is destroyed or the construction fails.
    132167            void deactivateListeners()
    133168            {
Note: See TracChangeset for help on using the changeset viewer.