Definition at line 174 of file CSettingsInterface.h.
Public Member Functions | |
CSettingsInterface (void) | |
virtual | ~CSettingsInterface (void) |
virtual bool | revertParameter (const char *szParamName) |
This helper method reverts a member variables value back to the initial value and should be used e.g. | |
STDMETHODIMP | GetParameter (const char *szParamName, int nBufferSize, char *szValue, int *pLength) |
Overridden from ISettingsInterface This method returns the value of the requested parameter. | |
STDMETHODIMP | SetParameter (const char *szParamName, const char *szValue) |
Overridden from ISettingsInterface This method sets the value of the requested parameter provided the parameter exists. | |
STDMETHODIMP | GetParameterSettings (char *szResult, int nSize) |
Overridden from ISettingsInterface This method iterates over all parameters and constructs a string containing all parameters current settings. | |
Protected Member Functions | |
virtual void | initParameters ()=0 |
This method needs to be overridden by child classes and called in the child class constructor It takes care of mapping the parameters to member variables Call the addParameter method from this method where szParamName: is the name of the parameter pAddr is a pointer to the member variable which will store the value bReadOnly will ensure that the param value cannot be changed vAllowedValues: If there are any items in this vector, only those will be deemed as valid values. | |
virtual void | addParameter (const char *szParamName, int *pAddr, int nDefaultValue, bool bReadOnly=false, std::vector< int > vAllowedValues=std::vector< int >()) |
The addParameter methods should be called from inside initParameters at start up. | |
virtual void | addParameter (const char *szParamName, std::string *pAddr, std::string szDefaultValue, bool bReadOnly=false, std::vector< std::string > vAllowedValues=std::vector< std::string >()) |
The addParameter methods should be called from inside initParameters at start up. | |
virtual void | addParameter (const char *szParamName, bool *pAddr, bool bDefaultValue, bool bReadOnly=false, std::vector< bool > vAllowedValues=std::vector< bool >()) |
The addParameter methods should be called from inside initParameters at start up. | |
virtual void | addParameter (const char *szParamName, double *pAddr, double dDefaultValue, bool bReadOnly=false, std::vector< double > vAllowedValues=std::vector< double >()) |
The addParameter methods should be called from inside initParameters at start up. |
bool CSettingsInterface::revertParameter | ( | const char * | szParamName | ) | [virtual] |
This helper method reverts a member variables value back to the initial value and should be used e.g.
if any of the postconditions of SetParameter are unfulfilled. This is usually the case if other conditions exist upon which the success of SetParameter depends. One way to use this method is to override SetParameter and call the base class method. Then check the postcondition and if that has not been met, Call revertParameter
[in] | The | name of the parameter that should be reverted to its previous value |
Definition at line 313 of file CSettingsInterface.cpp.
STDMETHODIMP CSettingsInterface::GetParameter | ( | const char * | szParamName, | |
int | nBufferSize, | |||
char * | szValue, | |||
int * | pLength | |||
) |
Overridden from ISettingsInterface This method returns the value of the requested parameter.
[in] | szParamName | The name of the parameter |
[in] | nBufferSize | The size of the passed in buffer szValue |
[out] | szValue | The buffer to store the result in |
[out] | pLength | The length of the result |
Definition at line 76 of file CSettingsInterface.cpp.
STDMETHODIMP CSettingsInterface::SetParameter | ( | const char * | szParamName, | |
const char * | szValue | |||
) |
Overridden from ISettingsInterface This method sets the value of the requested parameter provided the parameter exists.
[in] | szParamName | The name of the parameter |
[in] | szValue | The value the parameter should be set to |
Reimplemented in CCropFilter, CScaleFilter, and CCustomBaseFilter.
Definition at line 184 of file CSettingsInterface.cpp.
STDMETHODIMP CSettingsInterface::GetParameterSettings | ( | char * | szResult, | |
int | nSize | |||
) |
Overridden from ISettingsInterface This method iterates over all parameters and constructs a string containing all parameters current settings.
[out] | szResult | A buffer for the result of the method |
[in] | nSize | The size of the passed in buffer |
Definition at line 263 of file CSettingsInterface.cpp.
void CSettingsInterface::addParameter | ( | const char * | szParamName, | |
int * | pAddr, | |||
int | nDefaultValue, | |||
bool | bReadOnly = false , |
|||
std::vector< int > | vAllowedValues = std::vector<int>() | |||
) | [protected, virtual] |
The addParameter methods should be called from inside initParameters at start up.
[in] | szParamName | The name of the parameter that should be reverted to its previous value |
[in] | pAddr | A pointer to the member variable that will store the value |
[in] | nDefaultValue | An optional default value for the member variable |
[in] | bReadOnly | Readonly parameters cannot be set using the SetParameter method |
[in] | vAllowedValues | A vector of allowed values. If the size of this vector > 0 only the values in the vector are considered valid |
Definition at line 44 of file CSettingsInterface.cpp.
void CSettingsInterface::addParameter | ( | const char * | szParamName, | |
std::string * | pAddr, | |||
std::string | szDefaultValue, | |||
bool | bReadOnly = false , |
|||
std::vector< std::string > | vAllowedValues = std::vector<std::string>() | |||
) | [protected, virtual] |
The addParameter methods should be called from inside initParameters at start up.
[in] | szParamName | The name of the parameter that should be reverted to its previous value |
[in] | pAddr | A pointer to the member variable that will store the value |
[in] | nDefaultValue | An optional default value for the member variable |
[in] | bReadOnly | Readonly parameters cannot be set using the SetParameter method |
[in] | vAllowedValues | A vector of allowed values. If the size of this vector > 0 only the values in the vector are considered valid |
Definition at line 52 of file CSettingsInterface.cpp.
void CSettingsInterface::addParameter | ( | const char * | szParamName, | |
bool * | pAddr, | |||
bool | bDefaultValue, | |||
bool | bReadOnly = false , |
|||
std::vector< bool > | vAllowedValues = std::vector<bool>() | |||
) | [protected, virtual] |
The addParameter methods should be called from inside initParameters at start up.
[in] | szParamName | The name of the parameter that should be reverted to its previous value |
[in] | pAddr | A pointer to the member variable that will store the value |
[in] | nDefaultValue | An optional default value for the member variable |
[in] | bReadOnly | Readonly parameters cannot be set using the SetParameter method |
[in] | vAllowedValues | A vector of allowed values. If the size of this vector > 0 only the values in the vector are considered valid |
Definition at line 60 of file CSettingsInterface.cpp.
void CSettingsInterface::addParameter | ( | const char * | szParamName, | |
double * | pAddr, | |||
double | dDefaultValue, | |||
bool | bReadOnly = false , |
|||
std::vector< double > | vAllowedValues = std::vector<double>() | |||
) | [protected, virtual] |
The addParameter methods should be called from inside initParameters at start up.
[in] | szParamName | The name of the parameter that should be reverted to its previous value |
[in] | pAddr | A pointer to the member variable that will store the value |
[in] | nDefaultValue | An optional default value for the member variable |
[in] | bReadOnly | Readonly parameters cannot be set using the SetParameter method |
[in] | vAllowedValues | A vector of allowed values. If the size of this vector > 0 only the values in the vector are considered valid |
Definition at line 68 of file CSettingsInterface.cpp.