A template modifier class for adding type checking on the routes to any Field class.
More...
#include <H3D/TypedField.h>
template<class BaseField, class RequiredArgTypes, class OptionalArgTypes = void>
class H3D::TypedField< BaseField, RequiredArgTypes, OptionalArgTypes >
A template modifier class for adding type checking on the routes to any Field class.
- Parameters
-
BaseField | The Field type base class.
|
RequiredArgTypes | The types of the routes that are required to be there. If these routes are not present when the update() function is called then an exception is thrown. The types can be specified with the Types and Any templates. The Types template specifies a list of types and the Any template defines the type to be any of the types given in it. void can be used to specify that there are no required routes. |
OptionalArgTypes | Types of optional routes. These do not have to be there in order for the field to be able to update. In addition to the templates Any and Types used for RequiredArgTypes the template AnyNumber can be used to specify that any number of the route types specified in the template are valid. void can be used to specify that there are no required routes. |
- Examples:
- TypedField< SFInt32, SFInt32 > defines an SFInt32 field that requires one and only one SFInt32 field routed to it.
- TypedField< MFFloat, void, AnyNumber<SFFloat> > defines an MFFloat that can have any number of SFFloat fields routed to it.
- TypedField< SFInt32, Types< SFFloat, SFFloat >, Types< Any< SFInt32, MFInt32 > > > defines a SFInt32 field that requires two SFFloat routes and can optionally have an extra SFInt32 or MFInt32 route.
<>
◆ checkFieldType()
template<class BaseField , class RequiredArgTypes , class OptionalArgTypes = void>
void H3D::TypedField< BaseField, RequiredArgTypes, OptionalArgTypes >::checkFieldType |
( |
Field * |
f, |
|
|
int |
index |
|
) |
| |
|
inlineprotected |
◆ checkTemplateArguments()
template<class BaseField , class RequiredArgTypes , class OptionalArgTypes = void>
void H3D::TypedField< BaseField, RequiredArgTypes, OptionalArgTypes >::checkTemplateArguments |
( |
| ) |
|
|
inlineprotected |
Function for checking that a field given TypedField type specification is valid.
- Exceptions
-
TypedFieldCheck::InvalidTemplateArguments | |
The documentation for this class was generated from the following file: