CCAFFEINE
0.8.8
|
00001 #ifndef ParameterPort_Impl_h_seen 00002 #define ParameterPort_Impl_h_seen 00003 00004 // private port implementation 00005 // it supports kernel, classic. 00006 00007 namespace ccafe { 00008 00009 class ParameterPort_Impl : 00010 #ifdef HAVE_CLASSIC 00011 public virtual classic::gov::cca::Port, 00012 #endif // HAVE_CLASSIC 00013 public virtual ccafeopq::ports::ParameterPort, 00014 #ifdef HAVE_CLASSIC 00015 public virtual ClassicOpaquePort, 00016 #endif // HAVE_CLASSIC 00017 public virtual StringableParameterPort, 00018 public virtual KernelPort 00019 { 00020 private: 00021 00022 std::vector< ::ccafeopq::ports::ParameterGetListener_shared > glv; 00023 std::vector< ::ccafeopq::ports::ParameterSetListener_shared > slv; 00024 ccafeopq::TypeMap_shared portData; 00025 bool published; 00026 bool basiconly; // transient wrapper. 00027 // true if key given is the name of a parameter 00028 bool hasKey( const std::string & key); 00029 00030 public: 00031 ParameterPort_Impl( ccafeopq::TypeMap_shared data, bool basic=false); 00032 virtual ~ParameterPort_Impl(); 00033 00034 #ifdef HAVE_CLASSIC 00035 virtual classic::gov::cca::Port * getClassicPort(); 00036 #endif 00037 00038 00039 // Stringable interface 00040 virtual std::string getConfigurationString( const std::string & prefix); 00041 virtual std::string getConfigurationString( const std::string & prefix, const std::string & key); 00042 virtual int setConfigurationString( const std::string & key, const std::string & value); 00043 00044 // used by factory only. 00045 void addSetListener( ::ccafeopq::ports::ParameterSetListener_shared sl); 00046 void addGetListener( ::ccafeopq::ports::ParameterGetListener_shared gl); 00047 void clearListeners(); 00048 bool getPublished(); 00049 void setPublished(bool tf); 00050 std::string toString( const std::string & prefix, ::ccafeopq::TypeMap_shared d, const std::string &key); 00051 std::string toStringArray( const std::string & prefix, ::ccafeopq::TypeMap_shared d, const std::string &key); 00052 00053 // opaque version of SIDL ParameterPort interface 00054 // adjusted for the fact of multiple bindings. 00055 virtual std::vector< std::string > readConfigurationKeys(); 00056 virtual ccafeopq::TypeMap_shared readConfigurationMap(); 00057 virtual void writeConfigurationMap( ccafeopq::TypeMap_shared tm); 00058 virtual std::string readTitle(); 00059 virtual std::vector< std::string > readGroupNames(); 00060 virtual std::string readGroupTitle( const std::string & groupName); 00061 virtual std::vector< std::string > readGroupKeys( const std::string & groupName ); 00062 virtual std::string readHelp( const std::string & key); 00063 virtual std::string readPrompt( const std::string & key); 00064 virtual bool hasBounds( const std::string & key); 00065 virtual bool hasChoices( const std::string & key); 00066 virtual bool readDefaultBoolean( const std::string & key); 00067 virtual std::string readDefaultString ( const std::string & key); 00068 virtual int32_t readDefaultInt( const std::string & key); 00069 virtual int64_t readDefaultLong( const std::string & key); 00070 virtual float readDefaultFloat ( const std::string & key); 00071 virtual double readDefaultDouble( const std::string & key); 00072 virtual std::complex<float> readDefaultFcomplex( const std::string & key); 00073 virtual std::complex<double> readDefaultDcomplex( const std::string & key); 00074 virtual std::vector< std::string > readDefaultStringArray( const std::string & key); 00075 virtual std::vector< bool > readDefaultBooleanArray( const std::string & key); 00076 virtual std::vector< int32_t > readDefaultIntArray( const std::string & 00077 key); 00078 virtual std::vector< int64_t > readDefaultLongArray( const std::string & key); 00079 virtual std::vector< float > readDefaultFloatArray( const std::string & 00080 key); 00081 virtual std::vector< double > readDefaultDoubleArray( const std::string 00082 & key); 00083 virtual std::vector< std::complex<float> > readDefaultFcomplexArray( const std::string & key); 00084 virtual std::vector< std::complex<double> > readDefaultDcomplexArray( const std::string & key); 00085 virtual void readBoundsInt(const std::string & key, int32_t & low, int32_t & high); 00086 virtual void readBoundsLong(const std::string & key, int64_t & low, int64_t & high); 00087 virtual void readBoundsFloat(const std::string & key, float & low, float & high); 00088 virtual void readBoundsDouble(const std::string & key, double & low, double & high); 00089 virtual std::vector< std::string > readChoicesString(const std::string & key); 00090 virtual std::vector< int32_t > readChoicesInt(const std::string & key); 00091 virtual std::vector< int64_t > readChoicesLong(const std::string & key); 00092 virtual std::vector< float > readChoicesFloat(const std::string & key); 00093 virtual std::vector< double > readChoicesDouble(const std::string & key); 00094 virtual std::vector< std::complex<float> > readChoicesFcomplex(const std::string & key); 00095 virtual std::vector< std::complex<double> > readChoicesDcomplex(const std::string & key); 00096 00097 static const std::string & k_PORTNAME() ; 00098 static const std::string & k_PUBPORTNAME(); 00099 static const std::string & k_TITLE(); 00100 static const std::string & k_ALLKEYS(); 00101 static const std::string & k_GROUPS() ; 00102 static const std::string & k_CURGROUP() ; 00103 static const std::string & k_GROUPKEYS() ; 00104 static const std::string & k_DEFAULT() ; 00105 static const std::string & k_BOUNDS() ; 00106 static const std::string & k_BOUNDED() ; 00107 static const std::string & k_CHOICES() ; 00108 static const std::string & k_HELP(); 00109 static const std::string & k_PROMPT(); 00110 static const std::string & k_HASKEY(); 00111 00112 }; // end implementation ParameterPort_Impl 00113 00114 } ENDSEMI // namespace ccafe 00115 00116 #endif // ParameterPort_Impl_h_seen 00117