Changeset 41 in flair-src for trunk/lib/FlairMeta/src/UavFactory.cpp
- Timestamp:
- 06/28/16 15:20:04 (8 years ago)
- File:
-
- 1 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 }
Note:
See TracChangeset
for help on using the changeset viewer.