Changeset 290 in pacpusframework for trunk/include/Pacpus/kernel/ComponentBase.h
- Timestamp:
- 03/27/14 12:53:36 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/Pacpus/kernel/ComponentBase.h
r288 r290 141 141 142 142 protected: 143 typedef QMap<QString, Input InterfaceBase *> InputsMap;144 typedef QMap<QString, Output InterfaceBase *> OutputsMap;143 typedef QMap<QString, InputSharedPointer> InputsMap; 144 typedef QMap<QString, OutputSharedPointer> OutputsMap; 145 145 146 146 template <typename DataType, class ComponentType, typename Function> … … 148 148 { 149 149 typedef InputInterface<DataType, ComponentType> InputType; 150 Input Type * connection = new InputType(name, dynamic_cast<ComponentType *>(this), function);150 InputSharedPointer connection(new InputType(name, dynamic_cast<ComponentType *>(this), function)); 151 151 inputs().insert(name, connection); 152 152 } … … 156 156 { 157 157 typedef OutputInterface<DataType, ComponentType> OutputType; 158 Output Type * connection = new OutputType(name, dynamic_cast<ComponentType *>(this));158 OutputSharedPointer connection(new OutputType(name, dynamic_cast<ComponentType *>(this))); 159 159 outputs().insert(name, connection); 160 160 } 161 161 162 162 /// @todo DOC 163 InputInterfaceBase 163 InputInterfaceBase* getInput(QString name) const; 164 164 165 165 /// @todo DOC 166 OutputInterfaceBase 166 OutputInterfaceBase* getOutput(QString name) const; 167 167 168 168 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)); 173 174 } 174 175 175 176 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)); 180 182 } 181 183
Note:
See TracChangeset
for help on using the changeset viewer.