CCAFFEINE
0.8.8
|
00001 #ifndef OpqParameterPortFactory_h_seen 00002 #define OpqParameterPortFactory_h_seen 00003 00004 /* 00005 * This port/component implementation could be exposed 00006 * as a component (one per using client component). 00007 * Once the factory situation is settled down, this 00008 * can be ported easily to be a new service component 00009 * that lives alone and gets dynamically loaded. 00010 * ---- 00011 * This class supercedes the old ccaffeine ConfigurableParameterPortFactory 00012 * the parameters library, and all the associated cruft that 00013 * gunked up a component. The component writer now just needs to 00014 * use this port and one or more typemaps. 00015 * 00016 * Each dialog is defined on a typemap the component owns. 00017 * A component writer can define more than one dialog for a component, 00018 * and each dialog will show up as a configuration port in the 00019 * usual ccaffeine parameter port sense. 00020 * The component writer can choose to be notified of 00021 * changes to the published parameters and requests for 00022 * the typemap. 00023 * ------ 00024 * 00025 */ 00026 class OpqParameterPortFactory : 00027 public virtual ::ccafeopq::ports::ParameterPortFactory, 00028 #ifdef HAVE_CLASSIC 00029 public virtual ClassicOpaquePort, 00030 #endif // HAVE_CLASSIC 00031 public virtual KernelPort 00032 #ifdef HAVE_CLASSIC 00033 , 00034 public virtual classic::gov::cca::Port 00035 #endif // HAVE_CLASSIC 00036 { 00037 00038 private: 00043 std::map< std::string, void * > delegates; 00044 00045 public: 00046 OpqParameterPortFactory(); 00047 00048 // never use this constructor. testing only. 00049 OpqParameterPortFactory(int bogon); 00050 00051 virtual ~OpqParameterPortFactory(); 00052 00053 #ifdef HAVE_CLASSIC 00054 virtual classic::gov::cca::Port * getClassicPort(); 00055 #endif 00056 00073 virtual void createParameterPort( ::ccafeopq::TypeMap_shared portData, const ::std::string & portName); 00074 00077 virtual void setBatchTitle( ::ccafeopq::TypeMap_shared portData, const ::std::string & title); 00078 00083 virtual void setGroupName( ::ccafeopq::TypeMap_shared portData, const std::string & newGroupName); 00084 00089 virtual void addRequestBoolean( ::ccafeopq::TypeMap_shared portData, 00090 const std::string & name, 00091 const std::string & help, 00092 const std::string & prompt, 00093 bool deflt); 00094 00100 virtual void addRequestInt( ::ccafeopq::TypeMap_shared portData, 00101 const std::string & name, 00102 const std::string & help, 00103 const std::string & prompt, 00104 int deflt, 00105 int low, 00106 int high); 00107 00113 virtual void addRequestLong( ::ccafeopq::TypeMap_shared portData, 00114 const std::string & name, 00115 const std::string & help, 00116 const std::string & prompt, 00117 int64_t deflt, 00118 int64_t low, 00119 int64_t high); 00120 00126 virtual void addRequestFloat( ::ccafeopq::TypeMap_shared portData, 00127 const std::string & name, 00128 const std::string & help, 00129 const std::string & prompt, 00130 float deflt, 00131 float low, 00132 float high); 00133 00139 virtual void addRequestDouble( ::ccafeopq::TypeMap_shared portData, 00140 const std::string & name, 00141 const std::string & help, 00142 const std::string & prompt, 00143 double deflt, 00144 double low, 00145 double high); 00146 00156 virtual void addRequestString( ::ccafeopq::TypeMap_shared portData, 00157 const std::string & name, 00158 const std::string & help, 00159 const std::string & prompt, 00160 const std::string & deflt); 00162 virtual void addRequestStringChoice( ::ccafeopq::TypeMap_shared portData, 00163 const std::string & name, const std::string &choice); 00164 00174 virtual void clearRequests( ::ccafeopq::TypeMap_shared portData); 00175 00184 virtual void setUpdater( ::ccafeopq::TypeMap_shared portData, 00185 ::ccafeopq::ports::ParameterGetListener_shared powner); 00186 00191 virtual void setUpdatedListener( ::ccafeopq::TypeMap_shared portData, 00192 ::ccafeopq::ports::ParameterSetListener_shared powner); 00193 00198 virtual void publishParameterPort( ::ccafeopq::TypeMap_shared portData, 00199 ::ccafeopq::Services * svc); 00200 00202 virtual void unpublishParameterPort( ::ccafeopq::TypeMap_shared portData, 00203 ::ccafeopq::Services * svc); 00204 00205 virtual void setGroupNameAndTitle(ccafeopq::TypeMap_shared, 00206 const std::string& groupName, const std::string& title); 00207 00208 virtual void registerUpdater(ccafeopq::TypeMap_shared tm, ccafeopq::ports::ParameterGetListener_shared pgl); 00209 virtual void registerUpdatedListener(ccafeopq::TypeMap_shared tm, ccafeopq::ports::ParameterSetListener_shared psl); 00210 virtual void addParameterPort(ccafeopq::TypeMap_shared tm, ccafeopq::Services* svc); 00211 virtual void removeParameterPort(ccafeopq::TypeMap_shared tm, ccafeopq::Services* svc); 00212 00214 virtual void addStringChoices(ccafeopq::TypeMap_shared portData, 00215 const std::string & key, 00216 std::vector< std::string > choices); 00217 00219 virtual void addIntChoices(ccafeopq::TypeMap_shared portData, 00220 const std::string & key, 00221 std::vector< int32_t > choices); 00222 00225 virtual void addIntChoices(ccafeopq::TypeMap_shared portData, 00226 const std::string & key, 00227 int32_t choices[], size_t nChoices); 00228 00230 virtual void addLongChoices(ccafeopq::TypeMap_shared portData, 00231 const std::string & key, 00232 std::vector< int64_t > choices); 00233 00236 virtual void addLongChoices(ccafeopq::TypeMap_shared portData, 00237 const std::string & key, 00238 int64_t choices[], size_t nChoices); 00239 00241 virtual void addFloatChoices(ccafeopq::TypeMap_shared portData, 00242 const std::string & key, 00243 std::vector< float > choices); 00244 00247 virtual void addFloatChoices(ccafeopq::TypeMap_shared portData, 00248 const std::string & key, 00249 float choices[], size_t nChoices); 00250 00252 virtual void addDoubleChoices(ccafeopq::TypeMap_shared portData, 00253 const std::string & key, 00254 std::vector< double > choices); 00255 00258 virtual void addDoubleChoices(ccafeopq::TypeMap_shared portData, 00259 const std::string & key, 00260 double choices[], size_t nChoices); 00261 00263 virtual void addFcomplexChoices(ccafeopq::TypeMap_shared portData, 00264 const std::string & key, 00265 std::vector< std::complex< float > > choices); 00266 00269 virtual void addFcomplexChoices(ccafeopq::TypeMap_shared portData, 00270 const std::string & key, 00271 std::complex< float > choices[], size_t nChoices); 00272 00274 virtual void addDcomplexChoices(ccafeopq::TypeMap_shared portData, 00275 const std::string & key, 00276 std::vector< std::complex< double > > choices); 00277 00280 virtual void addDcomplexChoices(ccafeopq::TypeMap_shared portData, 00281 const std::string & key, 00282 std::complex< double > choices[], size_t nChoices); 00283 00284 00285 }; // end interface OpqParameterPortFactory 00286 00287 extern OpqParameterPortFactory OpqParameterPortFactory_test; 00288 00289 #endif // OpqParameterPortFactory_h_seen