Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
Public Member Functions | Protected Attributes | List of all members
kome::objects::Parameters Class Reference

parameters of plug-in function management class More...

#include <Parameters.h>

Public Member Functions

 Parameters ()
 constructor
 
virtual ~Parameters ()
 destructor
 
unsigned int getNumberOfParameters ()
 gets the number of parameters More...
 
const char * getName (unsigned int index)
 gets parameter name More...
 
VariantgetValue (const char *name)
 gets parameter value More...
 
bool hasParameter (const char *name)
 gets wheter there is parameter with the specified name. More...
 

Protected Attributes

std::vector< std::string > m_parameters
 
std::map< std::string, Variantm_parameterMap
 

Detailed Description

parameters of plug-in function management class

Definition at line 28 of file Parameters.h.

Member Function Documentation

const char * kome::objects::Parameters::getName ( unsigned int  index)

gets parameter name

Parameters
[in]indexparameter index
Returns
parameter name (If index is illegal, this method returns NULL.)

Definition at line 38 of file Parameters.cpp.

38  {
39  // check index
40  if( index >= m_parameters.size() ) {
41  return NULL;
42  }
43 
44  return m_parameters[index].c_str();
45 }
std::vector< std::string > m_parameters
Definition: Parameters.h:74
#define NULL
Definition: CoreMacros.h:18
unsigned int kome::objects::Parameters::getNumberOfParameters ( )

gets the number of parameters

Returns
the number of parameters

Definition at line 33 of file Parameters.cpp.

33  {
34  return m_parameters.size();
35 }
std::vector< std::string > m_parameters
Definition: Parameters.h:74
Variant * kome::objects::Parameters::getValue ( const char *  name)

gets parameter value

Parameters
[in]nameparameter name
Returns
parameter value.

Definition at line 48 of file Parameters.cpp.

48  {
49  // creating string object
50  std::string s( NVL( name, "" ) );
51 
52  // check the map
53  if( m_parameterMap.find( s ) == m_parameterMap.end() ) { // new parameter
54  m_parameters.push_back( s );
55  }
56 
57  // return value
58  return m_parameterMap[ s ];
59 }
std::vector< std::string > m_parameters
Definition: Parameters.h:74
std::map< std::string, Variant > m_parameterMap
Definition: Parameters.h:77
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99
bool kome::objects::Parameters::hasParameter ( const char *  name)

gets wheter there is parameter with the specified name.

Returns
If there is the parameter with the specified name, this method returns true.

Definition at line 62 of file Parameters.cpp.

62  {
63  // creating string object
64  std::string s( NVL( name, "" ) );
65 
66  // check the map
67  return ( m_parameterMap.find( s ) != m_parameterMap.end() );
68 }
std::map< std::string, Variant > m_parameterMap
Definition: Parameters.h:77
#define NVL(checkVal, replaceVal)
Definition: CoreMacros.h:99

Member Data Documentation

std::map< std::string, Variant > kome::objects::Parameters::m_parameterMap
protected

the map of parameter value (parameter name -> parameter value)

Definition at line 77 of file Parameters.h.

std::vector< std::string > kome::objects::Parameters::m_parameters
protected

the array of parameter name

Definition at line 74 of file Parameters.h.


The documentation for this class was generated from the following files: