Changeset 41 in flair-src for trunk/lib/FlairMeta/src
- Timestamp:
- Jun 28, 2016, 3:20:04 PM (8 years ago)
- Location:
- trunk/lib/FlairMeta/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairMeta/src/UavFactory.cpp
r15 r41 29 29 using namespace flair::meta; 30 30 31 namespace { // anonymous 32 vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)> vectoroffunctions; 33 } 34 31 35 Uav *CreateUav(FrameworkManager *parent, string uav_name, string uav_type, 32 36 UavMultiplex *multiplex) { 33 /*if(uav_type=="ardrone2") { 34 return new ArDrone2(parent,uav_name,multiplex); 35 } else */ if (uav_type == "hds_x4") { 37 38 Uav *uav; 39 for(int i=0;i<vectoroffunctions.size();i++) { 40 uav=vectoroffunctions.at(i)(parent, uav_name, uav_type,multiplex); 41 if(uav!=NULL) return uav; 42 } 43 44 if (uav_type == "hds_x4") { 36 45 parent->Err("UAV type %s not yet implemented\n", uav_type.c_str()); 37 46 return NULL; … … 60 69 } 61 70 } 71 72 void RegisterUavCreator(flair::meta::Uav*(*func)(FrameworkManager *parent, string uav_name, string uav_type, 73 UavMultiplex *multiplex)) { 74 vectoroffunctions.push_back(func); 75 76 } -
trunk/lib/FlairMeta/src/UavFactory.h
r15 r41 25 25 flair::filter::UavMultiplex *multiplex = NULL); 26 26 27 void RegisterUavCreator(flair::meta::Uav*(*func)(flair::core::FrameworkManager *parent, 28 std::string uav_name, std::string uav_type, 29 flair::filter::UavMultiplex *multiplex)); 27 30 #endif // UAVFACTORY
Note:
See TracChangeset
for help on using the changeset viewer.