Gorgon Game Engine
MappedValueType< T_, ToString_, Parse_ > Class Template Reference

This class allows embedded types to become scripting types that are passed around as values. More...

Public Member Functions

 MappedValueType (const std::string &name, const std::string &help)
 
 MappedValueType (const std::string &name, const std::string &help, const T_ &def)
 
virtual void Assign (Data &l, const Data &r) const override
 
template<class ... P_>
void MapConstructor (ParameterList params)
 
virtual Data Parse (const std::string &str) const override
 Parses a string into this data. This function is allowed to throw. More...
 
virtual std::string ToString (const Data &data) const override
 Converts a data of this type to string. More...
 

Protected Member Functions

template<class O_ >
std::enable_if< std::is_copy_constructible< O_ >::value, void >::type addcopyconst ()
 
template<class O_ >
std::enable_if<!std::is_copy_constructible< O_ >::value, void >::type addcopyconst ()
 
bool compare (const Data &l, const Data &r) const override
 
virtual void deleteobject (const Data &obj) const override
 

Detailed Description

template<class T_, StringFromFn< T_ > ToString_, ParseFn< T_ > Parse_>
class Gorgon::Scripting::MappedValueType< T_, ToString_, Parse_ >

This class allows embedded types to become scripting types that are passed around as values.

This class requires T_ to be copy constructable.

Constructor & Destructor Documentation

◆ MappedValueType() [1/2]

MappedValueType ( const std::string &  name,
const std::string &  help,
const T_ &  def 
)

◆ MappedValueType() [2/2]

MappedValueType ( const std::string &  name,
const std::string &  help 
)

Member Function Documentation

◆ addcopyconst() [1/2]

std::enable_if<std::is_copy_constructible<O_>::value, void>::type addcopyconst ( )
protected

◆ addcopyconst() [2/2]

std::enable_if<!std::is_copy_constructible<O_>::value, void>::type addcopyconst ( )
protected

◆ Assign()

virtual void Assign ( Data l,
const Data r 
) const
overridevirtual

◆ compare()

bool compare ( const Data l,
const Data r 
) const
overrideprotected

References Data::GetValue().

◆ deleteobject()

virtual void deleteobject ( const Data obj) const
overrideprotectedvirtual

◆ MapConstructor()

void MapConstructor ( ParameterList  params)

◆ Parse()

virtual Data Parse ( const std::string &  str) const
overridevirtual

Parses a string into this data. This function is allowed to throw.

References Gorgon::Resource::GID::Data.

◆ ToString()

virtual std::string ToString ( const Data data) const
overridevirtual

Converts a data of this type to string.

This function should never throw, if there is no data to display, recommended this play is either [ EMPTY ], or Typename #id

References Data::GetValue().


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