strus  0.17
Public Types | Public Member Functions | Static Public Member Functions | List of all members
strus::FunctionDescription::Parameter Struct Reference

Structure that describes a parameter. More...

#include <functionDescription.hpp>

Public Types

enum  Type {
  Feature, Attribute, Metadata, Numeric,
  String
}
 

Public Member Functions

 Parameter (const Type &type_, const std::string &name_, const std::string &text_, const std::string &domain_)
 Constructor. More...
 
 Parameter (const Parameter &o)
 Copy constructor. More...
 
Type type () const
 Get the type of the parameter. More...
 
const char * typeName () const
 Get the type of the parameter as string. More...
 
const std::string & name () const
 Get the name of the parameter. More...
 
const std::string & text () const
 Get the description text of the parameter. More...
 
const std::string & domain () const
 Get the description of the parameter domain. More...
 

Static Public Member Functions

static const char * typeName (Type i)
 

Detailed Description

Structure that describes a parameter.

Member Enumeration Documentation

Enumerator
Feature 

parameter specifies a feature value passed as posting iterator to the function context

Attribute 

parameter specifies a document attribute identifier

Metadata 

parameter specifies a document metadata identifier

Numeric 

parameter specifies a numeric constant (NumericVariant type)

String 

parameter specifies a string constant or enumeration item as string

Constructor & Destructor Documentation

strus::FunctionDescription::Parameter::Parameter ( const Type type_,
const std::string &  name_,
const std::string &  text_,
const std::string &  domain_ 
)
inline

Constructor.

strus::FunctionDescription::Parameter::Parameter ( const Parameter o)
inline

Copy constructor.

Member Function Documentation

const std::string& strus::FunctionDescription::Parameter::domain ( ) const
inline

Get the description of the parameter domain.

Returns
List of values as string. Alternative values for the same element separated by '|' Different values allowed separated by ',' Start and end of a value range separated by ':' Operator precedence '|' > ',' > ':' (as expected) Example 1: boolean with different alternatives: "true|t|y|1,false|f|n|0" Example 2: positive numbers smaller than 100: "1:99" Example 3: english weekdays: "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday" Example 4: non negative number: "0:" Example 5: anything: "" (empty string)
Remarks
Its considered to be good practice to be case insensitive for enumeration values
const std::string& strus::FunctionDescription::Parameter::name ( ) const
inline

Get the name of the parameter.

const std::string& strus::FunctionDescription::Parameter::text ( ) const
inline

Get the description text of the parameter.

Type strus::FunctionDescription::Parameter::type ( ) const
inline

Get the type of the parameter.

static const char* strus::FunctionDescription::Parameter::typeName ( Type  i)
inlinestatic
const char* strus::FunctionDescription::Parameter::typeName ( ) const
inline

Get the type of the parameter as string.


The documentation for this struct was generated from the following file: