Changeset 290 in pacpusframework for trunk/include/Pacpus/kernel
- Timestamp:
- Mar 27, 2014, 12:53:36 PM (11 years ago)
- Location:
- trunk/include/Pacpus/kernel
- Files:
-
- 4 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 -
trunk/include/Pacpus/kernel/ComponentFactoryBase.h
r288 r290 18 18 #include <Pacpus/kernel/PacpusLibConfig.h> 19 19 20 #include <boost/s hared_ptr.hpp>21 //#include <boost/ weak_ptr.hpp>20 #include <boost/smart_ptr/shared_ptr.hpp> 21 //#include <boost/smart_ptr/weak_ptr.hpp> 22 22 23 23 class QString; -
trunk/include/Pacpus/kernel/InputOutputBase.h
r206 r290 7 7 #include <Pacpus/kernel/PacpusLibConfig.h> 8 8 9 #include <boost/smart_ptr/shared_ptr.hpp> 10 //#include <boost/smart_ptr/weak_ptr.hpp> 9 11 #include <QList> 10 12 #include <QString> … … 14 16 class QByteArray; 15 17 16 namespace pacpus { 18 namespace pacpus 19 { 17 20 18 21 class ComponentBase; … … 104 107 }; 105 108 109 typedef boost::shared_ptr<InputInterfaceBase> InputSharedPointer; 110 typedef boost::shared_ptr<OutputInterfaceBase> OutputSharedPointer; 111 106 112 } // namespace pacpus 107 113 -
trunk/include/Pacpus/kernel/InputOutputInterface.h
r287 r290 263 263 it->getPriority() 264 264 ); 265 LOG_TRACE("Send er: " <<getSignature());265 LOG_TRACE("Sending from " << getSignature() << " to " << it->getInterface()->getSignature()); 266 266 } 267 267 } … … 280 280 } 281 281 282 //template <typename T1, typename T2, class C> 283 //bool checkedSend(boost::shared_ptr< OutputInterface<T1, C> > sender, T2 const& data, road_time_t t = road_time(), road_timerange_t tr = 0); 284 // 285 //template <typename T1, typename T2, class C> 286 //bool checkedSend(boost::shared_ptr< OutputInterface<T1, C> > sender, T2 const& data, road_time_t t, road_timerange_t tr) 287 //{ 288 // return checkedSend(sender.get(), data, t, tr); 289 //} 290 282 291 } // namespace pacpus 283 292
Note:
See TracChangeset
for help on using the changeset viewer.