Accessible.h File Reference
`#include <boost/any.hpp>`
`#include <boost/preprocessor.hpp>`
`#include <functional>`
`#include <memory>`
`#include <string>`
`#include <unordered_map>`
`#include <yaml-cpp/yaml.h>`
`#include "SurgSim/Math/Matrix.h"`
`#include "SurgSim/Framework/Accessible-inl.h"`

Go to the source code of this file.

## Classes

class | SurgSim::Framework::Accessible
| Mixin class for enabling a property system on OSS classes, the instance still needs to initialize properties in the constructor by using either addSetter, addGetter, addAccessors or the macro for each member variable that should be made accessible. More...
struct | SurgSim::Framework::Accessible::Functors
| Private struct to keep the map under control. More...
struct | SurgSim::Framework::Property
| Public struct to pair an accessible with its appropriate property. More...

## Namespaces

| SurgSim
| SurgSim::Framework

## Macros

#define | SURGSIM_ADD_RW_PROPERTY(class, type, property, getter, setter)
| A macro to register getter and setter for a property that is readable and writeable, order of getter and setter agrees with 'RW'. More...
#define | SURGSIM_ADD_RO_PROPERTY(class, type, property, getter)
| A macro to register a getter for a property that is read only. More...
#define | SURGSIM_ADD_SERIALIZABLE_PROPERTY(class, type, property, getter, setter)
| A macro to register a serializable property, this needs to support reading, writing and all the conversions to and from YAML::Node. More...
#define | SURGSIM_ADD_SETTER(class, type, property, setter)
| A macro to register a setter that can be used from YAML, and as a writeable property use this to provide alternatives to more complicated values, e.g. More...
#define | SURGSIM_ENUM_TOSTRING(r, data, elem)
#define | SURGSIM_ENUM_FROMSTRING(r, data, elem)
#define | SURGSIM_ENUM_TYPE int8_t
| Required type of enums used by SURGSIM_SERIALIZABLE_ENUM. More...
#define | SURGSIM_SERIALIZABLE_ENUM(name, enumerators)
| A macro to create an enum that can be easily serialized During serialization, the enum will be converted to its string based named, back to an enum during deserialization. More...

## Functions

template<class T >
T | SurgSim::Framework::convert (boost::any val)
| Wrap boost::any_cast to use in std::bind, for some reason it does not work by itself. More...
template<>
SurgSim::Math::Matrix44f | SurgSim::Framework::convert (boost::any val)
| Specialization for convert<T>() to correctly cast Matrix44d to Matrix44f, will throw if the val is not casteable to Matrix44[fd]. More...
template<>
std::string | SurgSim::Framework::convert (boost::any val)
| Specialization for convert<T>() to correctly cast const char* to std::string. More...

## Macro Definition Documentation

## SURGSIM_ADD_RO_PROPERTY

#define SURGSIM_ADD_RO_PROPERTY | ( |  | class,
|  |  | type,
|  |  | property,
|  |  | getter
| ) |  |

A macro to register a getter for a property that is read only.

## SURGSIM_ADD_RW_PROPERTY

#define SURGSIM_ADD_RW_PROPERTY | ( |  | class,
|  |  | type,
|  |  | property,
|  |  | getter,
|  |  | setter
| ) |  |

A macro to register getter and setter for a property that is readable and writeable, order of getter and setter agrees with 'RW'.

Note that the property should not be quoted in the original macro call.

## SURGSIM_ADD_SERIALIZABLE_PROPERTY

#define SURGSIM_ADD_SERIALIZABLE_PROPERTY | ( |  | class,
|  |  | type,
|  |  | property,
|  |  | getter,
|  |  | setter
| ) |  |

A macro to register a serializable property, this needs to support reading, writing and all the conversions to and from YAML::Node.

## SURGSIM_ADD_SETTER

#define SURGSIM_ADD_SETTER | ( |  | class,
|  |  | type,
|  |  | property,
|  |  | setter
| ) |  |

A macro to register a setter that can be used from YAML, and as a writeable property use this to provide alternatives to more complicated values, e.g.

setModelFilename() vs generate and set Model Enables the alternative use of the model file instead of the actual mesh object

## SURGSIM_ENUM_FROMSTRING

#define SURGSIM_ENUM_FROMSTRING | ( |  | r,
|  |  | data,
|  |  | elem
| ) |  |

## SURGSIM_ENUM_TOSTRING

#define SURGSIM_ENUM_TOSTRING | ( |  | r,
|  |  | data,
|  |  | elem
| ) |  |

## SURGSIM_ENUM_TYPE

#define SURGSIM_ENUM_TYPE int8_t

Required type of enums used by SURGSIM_SERIALIZABLE_ENUM.

## SURGSIM_SERIALIZABLE_ENUM

#define SURGSIM_SERIALIZABLE_ENUM | ( |  | name,
|  |  | enumerators
| ) |  |

A macro to create an enum that can be easily serialized During serialization, the enum will be converted to its string based named, back to an enum during deserialization.

The enum must already be forward declared in its namespace before calling this macro in the global namespace.