ParameterType Class Reference

#include <parametertype.h>

Public Types

enum class  FLAGS {
  NONE ,
  INPUT ,
  OUTPUT ,
  EXPLICIT_INPUT_OUTPUT
}
 

Public Member Functions

enum maxon::reflection::ParameterType::FLAGS MAXON_ENUM_FLAGS_CLASS (FLAGS)
 
 ParameterType (const DataType &t=DataType::NullValue(), FLAGS f=FLAGS::NONE)
 
const DataTypeGetType () const
 
const DataTypeGetTypeForData () const
 
FLAGS GetFlags () const
 
String ToString (const FormatStatement *fmt=nullptr) const
 
Result< DataToData (const Generic &value) const
 
Result< void > MoveFromData (Generic &value, Data &data, BaseArray< Data > &storage) const
 

Static Public Member Functions

template<typename T >
static ParameterType Get ()
 

Private Attributes

DataType _type
 
DataType _typeForData
 
FLAGS _flags
 

Member Enumeration Documentation

◆ FLAGS

enum FLAGS
strong
Enumerator
NONE 
INPUT 
OUTPUT 
EXPLICIT_INPUT_OUTPUT 

Constructor & Destructor Documentation

◆ ParameterType()

ParameterType ( const DataType t = DataType::NullValue(),
FLAGS  f = FLAGS::NONE 
)
explicit

Member Function Documentation

◆ MAXON_ENUM_FLAGS_CLASS()

enum maxon::reflection::ParameterType::FLAGS MAXON_ENUM_FLAGS_CLASS ( FLAGS  )

◆ GetType()

const DataType& GetType ( ) const

◆ GetTypeForData()

const DataType& GetTypeForData ( ) const

Returns the DataType which is suitable to store a value for the parameter in a Data object. The exact parameter type is not always directly usable for a Data object. For example, the parameter type could be StringInterface* or BaseArray<Int>, but Data only works with String and Array<Int>. Therefore, a suitable DataType is derived from the parameter type as follows:

  • At first, pointer or reference classes are removed from the type as often as possible.
  • Then, if the resulting type is a BaseArray or Block type, replace it by the corresponding ArrayInterface type.
  • ConstDataPtr, DataPtr or an ArrayInterface thereof is replaced by Data or ArrayInterface<Data>, respectively.
  • Finally, if the resulting type is an interface type, use the reference class of that interface.

So StringInterface, StringInterface*, StringInterface**, String or String* are all mapped to String, and BaseArray<Int>, BaseArray<Int>* or Block<Int> are mapped to Array<Int>.

Returns
A DataType which can be used for a Data object to store values for the parameter.

◆ GetFlags()

FLAGS GetFlags ( ) const

◆ ToString()

String ToString ( const FormatStatement fmt = nullptr) const

◆ Get()

static ParameterType Get ( )
static

◆ ToData()

Result<Data> ToData ( const Generic &  value) const

◆ MoveFromData()

Result<void> MoveFromData ( Generic &  value,
Data data,
BaseArray< Data > &  storage 
) const

Member Data Documentation

◆ _type

DataType _type
private

◆ _typeForData

DataType _typeForData
private

◆ _flags

FLAGS _flags
private