Drake
default_scalars.h File Reference
Include dependency graph for default_scalars.h:

Macros

#define DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS(SomeType)
 A macro that defines explicit class template instantiations for Drake's default set of supported scalar types. More...
 
#define DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS(SomeType)
 A macro that defines explicit class template instantiations for Drake's default set of supported scalar types, excluding all symbolic types. More...
 
#define DRAKE_DECLARE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS( SomeType)
 A macro that declares that an explicit class instantiation exists in the same library for Drake's default set of supported scalar types (having been defined by DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS in a .cc file) . More...
 
#define DRAKE_DECLARE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS(SomeType)
 A macro that declares that an explicit class instantiation exists in the same library for Drake's default set of supported scalar types, excluding all symbolic types (having been defined by DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS in a .cc file) . More...
 

Macro Definition Documentation

◆ DRAKE_DECLARE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS

#define DRAKE_DECLARE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS (   SomeType)
Value:
extern template SomeType<double>; \
extern template SomeType<::drake::AutoDiffXd>;

A macro that declares that an explicit class instantiation exists in the same library for Drake's default set of supported scalar types, excluding all symbolic types (having been defined by DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS in a .cc file) .

This macro should only be used in .h files, never in .cc files.

◆ DRAKE_DECLARE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS

#define DRAKE_DECLARE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS (   SomeType)
Value:
SomeType) \
extern template SomeType<::drake::symbolic::Expression>;
#define DRAKE_DECLARE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS(SomeType)
A macro that declares that an explicit class instantiation exists in the same library for Drake's def...
Definition: default_scalars.h:82

A macro that declares that an explicit class instantiation exists in the same library for Drake's default set of supported scalar types (having been defined by DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS in a .cc file) .

This macro should only be used in .h files, never in .cc files.

◆ DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS

#define DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS (   SomeType)
Value:
template SomeType<double>; \
template SomeType<::drake::AutoDiffXd>;

A macro that defines explicit class template instantiations for Drake's default set of supported scalar types, excluding all symbolic types.

This macro should only be used in .cc files, never in .h files. This is identical to DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS except that it does not define support for any drake::symbolic types.

◆ DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS

#define DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_SCALARS (   SomeType)
Value:
SomeType) \
template SomeType<::drake::symbolic::Expression>;
#define DRAKE_DEFINE_CLASS_TEMPLATE_INSTANTIATIONS_ON_DEFAULT_NONSYMBOLIC_SCALARS(SomeType)
A macro that defines explicit class template instantiations for Drake's default set of supported scal...
Definition: default_scalars.h:59

A macro that defines explicit class template instantiations for Drake's default set of supported scalar types.

This macro should only be used in .cc files, never in .h files.

Parameters
SomeTypethe template typename to instantiate, including the leading class or struct keyword.

Currently the supported types are:

Example my_system.h:

namespace sample {
template <typename T>
class MySystem final : public LeafSystem<T> {
...
};
} // namespace sample
class ::sample::MySystem)

Example my_system.cc:

#include "my_system.h"
class ::sample::MySystem)

See also System Scalar Conversion.