Changeset 290 in pacpusframework for trunk/include/Pacpus/kernel/ComponentBase.h


Ignore:
Timestamp:
03/27/14 12:53:36 (10 years ago)
Author:
Marek Kurdej
Message:

Some clean-up.

File:
1 edited

Legend:

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

    r288 r290  
    141141   
    142142protected:
    143     typedef QMap<QString, InputInterfaceBase *> InputsMap;
    144     typedef QMap<QString, OutputInterfaceBase *> OutputsMap;
     143    typedef QMap<QString, InputSharedPointer> InputsMap;
     144    typedef QMap<QString, OutputSharedPointer> OutputsMap;
    145145
    146146    template <typename DataType, class ComponentType, typename Function>
     
    148148    {
    149149        typedef InputInterface<DataType, ComponentType> InputType;
    150         InputType * connection = new InputType(name, dynamic_cast<ComponentType *>(this), function);
     150        InputSharedPointer connection(new InputType(name, dynamic_cast<ComponentType *>(this), function));
    151151        inputs().insert(name, connection);
    152152    }
     
    156156    {
    157157        typedef OutputInterface<DataType, ComponentType> OutputType;
    158         OutputType * connection = new OutputType(name, dynamic_cast<ComponentType *>(this));
     158        OutputSharedPointer connection(new OutputType(name, dynamic_cast<ComponentType *>(this)));
    159159        outputs().insert(name, connection);
    160160    }
    161161   
    162162    /// @todo DOC
    163     InputInterfaceBase * getInput(QString name) const;
     163    InputInterfaceBase* getInput(QString name) const;
    164164
    165165    /// @todo DOC
    166     OutputInterfaceBase * getOutput(QString name) const;
     166    OutputInterfaceBase* getOutput(QString name) const;
    167167
    168168    template <typename DataType, class ComponentType>
    169     InputInterface<DataType, ComponentType> *
    170         getTypedInput(const char * name) const
    171     {
    172         return dynamic_cast<InputInterface<DataType, ComponentType> *>(getInput(name));
     169    InputInterface<DataType, ComponentType>* getTypedInput(const char * name) const
     170    {
     171        //using boost::dynamic_pointer_cast;
     172        //return dynamic_pointer_cast<InputInterface<DataType, ComponentType> >(getInput(name));
     173        return dynamic_cast<InputInterface<DataType, ComponentType>*>(getInput(name));
    173174    }
    174175
    175176    template <typename DataType, class ComponentType>
    176     OutputInterface<DataType, ComponentType> *
    177         getTypedOutput(const char * name) const
    178     {
    179         return dynamic_cast<OutputInterface<DataType, ComponentType> *>(getOutput(name));
     177    OutputInterface<DataType, ComponentType>* getTypedOutput(const char * name) const
     178    {
     179        //using boost::dynamic_pointer_cast;
     180        //return dynamic_pointer_cast<OutputInterface<DataType, ComponentType> >(getOutput(name));
     181        return dynamic_cast<OutputInterface<DataType, ComponentType>*>(getOutput(name));
    180182    }
    181183
Note: See TracChangeset for help on using the changeset viewer.