Changeset 16 in pacpusframework for trunk/include/Pacpus/kernel


Ignore:
Timestamp:
Jan 8, 2013, 1:51:02 AM (12 years ago)
Author:
sgosseli
Message:

Passage by const-reference instead of value.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/Pacpus/kernel/ComponentManager.h

    r14 r16  
    6666     * @return Number of components loaded by the manager.
    6767     */
    68     PACPUSLIB_API std::size_t loadComponents(QString file);
     68    PACPUSLIB_API std::size_t loadComponents(const QString& file);
    6969
    7070    /** Start all the components
     
    7777     * @return True if the component exists and has been started, otherwise false.
    7878     */
    79     PACPUSLIB_API int start(QString component);
     79    PACPUSLIB_API int start(const QString& component);
    8080
    8181    /** Stop all the components
     
    8888     * @return True if the component has been stopped, otherwise false.
    8989     */
    90     PACPUSLIB_API int stop(QString component);
     90    PACPUSLIB_API int stop(const QString& component);
    9191
    9292    /** Get a pointer to the component referred by @em name.
     
    9494     * @return Pointer to the component if it exists, otherwise @em NULL.
    9595     */
    96     PACPUSLIB_API ComponentBase* getComponent(QString name);
     96    PACPUSLIB_API ComponentBase* getComponent(const QString& name);
    9797
    9898    /** Get the list of all the names of the component known by the manager.
     
    105105     * @return True if the plugin has been loaded, otherwise false.
    106106     */
    107     PACPUSLIB_API bool loadPlugin(QString filename);
     107    PACPUSLIB_API bool loadPlugin(const QString& filename);
    108108
    109109private:
    110110    /// Create a new component of type 'type' and with the name 'name'
    111     bool createComponent(QString type, QString name);
     111    bool createComponent(const QString& type, const QString& name);
    112112
    113     bool registerComponent(ComponentBase * addr, QString name);
    114     bool registerComponentFactory(ComponentFactoryBase * addr, QString type);
     113    bool registerComponent(ComponentBase* addr, const QString& name);
     114    bool registerComponentFactory(ComponentFactoryBase* addr, const QString& type);
    115115
    116     bool unRegisterComponent(QString name);
    117     bool unRegisterComponentFactory(QString type);
     116    bool unRegisterComponent(const QString& name);
     117    bool unRegisterComponentFactory(const QString& type);
    118118
    119119    // Allow 2 functions to access to private members of ComponentManager
    120     friend void ComponentFactoryBase::addFactory(ComponentFactoryBase * addr, const QString & type);
     120    friend void ComponentFactoryBase::addFactory(ComponentFactoryBase* addr, const QString & type);
    121121    friend void ComponentFactoryBase::addComponent(const QString & name);
    122122
Note: See TracChangeset for help on using the changeset viewer.