Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-format] Set language standard to C++17 #1822

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,6 @@ SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
Standard: c++17
TabWidth: 2
UseTab: Never
4 changes: 2 additions & 2 deletions dart/common/AspectWithVersion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ template <
class DerivedT,
typename StateDataT,
class CompositeT = Composite,
void (*updateState)(DerivedT*) = &detail::NoOp<DerivedT*> >
void (*updateState)(DerivedT*) = &detail::NoOp<DerivedT*>>
using AspectWithState = detail::AspectWithState<
CompositeTrackingAspect<CompositeT>,
DerivedT,
Expand All @@ -56,7 +56,7 @@ template <
class DerivedT,
typename PropertiesDataT,
class CompositeT = Composite,
void (*updateProperties)(DerivedT*) = &detail::NoOp<DerivedT*> >
void (*updateProperties)(DerivedT*) = &detail::NoOp<DerivedT*>>
using AspectWithVersionedProperties = detail::AspectWithVersionedProperties<
CompositeTrackingAspect<CompositeT>,
DerivedT,
Expand Down
2 changes: 1 addition & 1 deletion dart/common/Cloneable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class CloneableVector
CloneableVector& operator=(const CloneableVector& other);

/// Create a copy of this CloneableVector's contents
std::unique_ptr<CloneableVector<T> > clone() const;
std::unique_ptr<CloneableVector<T>> clone() const;

/// Copy the contents of another cloneable vector into this one.
void copy(const CloneableVector<T>& anotherVector);
Expand Down
10 changes: 4 additions & 6 deletions dart/common/Composite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ template <
typename ObjectType,
class DataType,
const DataType* (ObjectType::*getData)() const,
typename ObjectMap
= std::map<std::type_index, std::unique_ptr<ObjectType> >,
typename DataMap = std::map<std::type_index, std::unique_ptr<DataType> > >
typename ObjectMap = std::map<std::type_index, std::unique_ptr<ObjectType>>,
typename DataMap = std::map<std::type_index, std::unique_ptr<DataType>>>
static void extractDataFromObjectTypeMap(
DataMap& dataMap, const ObjectMap& objectMap)
{
Expand Down Expand Up @@ -113,9 +112,8 @@ template <
typename ObjectType,
class DataType,
void (ObjectType::*setData)(const DataType&),
typename ObjectMap
= std::map<std::type_index, std::unique_ptr<ObjectType> >,
typename DataMap = std::map<std::type_index, std::unique_ptr<DataType> > >
typename ObjectMap = std::map<std::type_index, std::unique_ptr<ObjectType>>,
typename DataMap = std::map<std::type_index, std::unique_ptr<DataType>>>
static void setObjectsFromDataTypeMap(
ObjectMap& objectMap, const DataMap& dataMap)
{
Expand Down
2 changes: 1 addition & 1 deletion dart/common/Composite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class Composite
using State = detail::CompositeState;
using Properties = detail::CompositeProperties;

using AspectMap = std::map<std::type_index, std::unique_ptr<Aspect> >;
using AspectMap = std::map<std::type_index, std::unique_ptr<Aspect>>;
using RequiredAspectSet = std::unordered_set<std::type_index>;

template <typename... Aspects>
Expand Down
2 changes: 1 addition & 1 deletion dart/common/CompositeJoiner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class CompositeJoiner<Base1, Base2> : public Base1, public Base2
/// you to include arbitrarily many base classes in the joining.
template <class Base1, class Base2, class... OtherBases>
class CompositeJoiner<Base1, Base2, OtherBases...>
: public CompositeJoiner<Base1, CompositeJoiner<Base2, OtherBases...> >
: public CompositeJoiner<Base1, CompositeJoiner<Base2, OtherBases...>>
{
public:
/// Default constructor
Expand Down
6 changes: 3 additions & 3 deletions dart/common/EmbeddedAspect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN

template <class DerivedT, typename StateDataT>
class EmbedState : public virtual common::RequiresAspect<
common::EmbeddedStateAspect<DerivedT, StateDataT> >
common::EmbeddedStateAspect<DerivedT, StateDataT>>
{
public:
using Derived = DerivedT;
Expand Down Expand Up @@ -200,7 +200,7 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
template <class DerivedT, typename PropertiesDataT>
class EmbedProperties
: public virtual common::RequiresAspect<
common::EmbeddedPropertiesAspect<DerivedT, PropertiesDataT> >
common::EmbeddedPropertiesAspect<DerivedT, PropertiesDataT>>
{
public:
using Derived = DerivedT;
Expand Down Expand Up @@ -377,7 +377,7 @@ class EmbedStateAndProperties : public virtual common::RequiresAspect<
common::EmbeddedStateAndPropertiesAspect<
DerivedT,
StateDataT,
PropertiesDataT> >
PropertiesDataT>>
{
public:
using Derived = DerivedT;
Expand Down
4 changes: 2 additions & 2 deletions dart/common/RequiresAspect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
template <class ReqAspect1, class... OtherReqAspects>
class RequiresAspect<ReqAspect1, OtherReqAspects...>
: public CompositeJoiner<
Virtual<RequiresAspect<ReqAspect1> >,
Virtual<RequiresAspect<OtherReqAspects...> > >
Virtual<RequiresAspect<ReqAspect1>>,
Virtual<RequiresAspect<OtherReqAspects...>>>
{
};

Expand Down
4 changes: 2 additions & 2 deletions dart/common/SpecializedForAspect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
template <class SpecAspect1, class... OtherSpecAspects>
class SpecializedForAspect<SpecAspect1, OtherSpecAspects...>
: public CompositeJoiner<
Virtual<SpecializedForAspect<SpecAspect1> >,
Virtual<SpecializedForAspect<OtherSpecAspects...> > >
Virtual<SpecializedForAspect<SpecAspect1>>,
Virtual<SpecializedForAspect<OtherSpecAspects...>>>
{
public:
virtual ~SpecializedForAspect() = default;
Expand Down
4 changes: 2 additions & 2 deletions dart/common/detail/AspectWithVersion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ template <
class DerivedT,
typename StateDataT,
class CompositeT = Composite,
void (*updateState)(DerivedT*) = &NoOp<DerivedT*> >
void (*updateState)(DerivedT*) = &NoOp<DerivedT*>>
class AspectWithState : public BaseT
{
public:
Expand Down Expand Up @@ -104,7 +104,7 @@ template <
class DerivedT,
typename PropertiesDataT,
class CompositeT = Composite,
void (*updateProperties)(DerivedT*) = &NoOp<DerivedT*> >
void (*updateProperties)(DerivedT*) = &NoOp<DerivedT*>>
class AspectWithVersionedProperties : public BaseT
{
public:
Expand Down
4 changes: 2 additions & 2 deletions dart/common/detail/EmbeddedAspect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ template <
void (*setEmbeddedState)(DerivedT*, const StateT&)
= &DefaultSetEmbeddedState<DerivedT, StateT>,
const StateT& (*getEmbeddedState)(const DerivedT*)
= &DefaultGetEmbeddedState<DerivedT, StateT> >
= &DefaultGetEmbeddedState<DerivedT, StateT>>
class EmbeddedStateAspect : public BaseT
{
public:
Expand Down Expand Up @@ -245,7 +245,7 @@ template <
void (*setEmbeddedProperties)(DerivedT*, const PropertiesT&)
= &DefaultSetEmbeddedProperties<DerivedT, PropertiesT>,
const PropertiesT& (*getEmbeddedProperties)(const DerivedT*)
= &DefaultGetEmbeddedProperties<DerivedT, PropertiesT> >
= &DefaultGetEmbeddedProperties<DerivedT, PropertiesT>>
class EmbeddedPropertiesAspect : public BaseT
{
protected:
Expand Down
10 changes: 5 additions & 5 deletions dart/dynamics/BodyNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ namespace dynamics {
template <
class DataType,
std::unique_ptr<DataType> (Node::*getData)() const,
typename VectorType = common::CloneableVector<std::unique_ptr<DataType> >,
typename DataMap = std::map<std::type_index, std::unique_ptr<VectorType> > >
typename VectorType = common::CloneableVector<std::unique_ptr<DataType>>,
typename DataMap = std::map<std::type_index, std::unique_ptr<VectorType>>>
static void extractDataFromNodeTypeMap(
DataMap& dataMap, const BodyNode::NodeMap& nodeMap)
{
Expand Down Expand Up @@ -84,8 +84,8 @@ static void extractDataFromNodeTypeMap(
template <
class DataType,
void (Node::*setData)(const DataType&),
typename VectorType = common::CloneableVector<std::unique_ptr<DataType> >,
typename DataMap = std::map<std::type_index, std::unique_ptr<VectorType> > >
typename VectorType = common::CloneableVector<std::unique_ptr<DataType>>,
typename DataMap = std::map<std::type_index, std::unique_ptr<VectorType>>>
static void setNodesFromDataTypeMap(
BodyNode::NodeMap& nodeMap, const DataMap& dataMap)
{
Expand All @@ -95,7 +95,7 @@ static void setNodesFromDataTypeMap(
while (nodeMap.end() != node_it && dataMap.end() != data_it) {
if (node_it->first == data_it->first) {
const std::vector<Node*>& node_vec = node_it->second;
const std::vector<std::unique_ptr<DataType> >& data_vec
const std::vector<std::unique_ptr<DataType>>& data_vec
= data_it->second->getVector();

// TODO(MXG): Should we report if the dimensions are mismatched?
Expand Down
9 changes: 3 additions & 6 deletions dart/dynamics/HierarchicalIK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@
mNullSpaceCache.resize(hierarchy.size());
bool zeroedNullSpace = false;
for (std::size_t i = 0; i < hierarchy.size(); ++i) {
const std::vector<std::shared_ptr<InverseKinematics> >& level
= hierarchy[i];
const std::vector<std::shared_ptr<InverseKinematics>>& level = hierarchy[i];

Check warning on line 275 in dart/dynamics/HierarchicalIK.cpp

View check run for this annotation

Codecov / codecov/patch

dart/dynamics/HierarchicalIK.cpp#L275

Added line #L275 was not covered by tests

Eigen::MatrixXd& NS = mNullSpaceCache[i];
if (i == 0) {
Expand Down Expand Up @@ -472,8 +471,7 @@

double cost = 0.0;
for (std::size_t i = 0; i < hierarchy.size(); ++i) {
const std::vector<std::shared_ptr<InverseKinematics> >& level
= hierarchy[i];
const std::vector<std::shared_ptr<InverseKinematics>>& level = hierarchy[i];

Check warning on line 474 in dart/dynamics/HierarchicalIK.cpp

View check run for this annotation

Codecov / codecov/patch

dart/dynamics/HierarchicalIK.cpp#L474

Added line #L474 was not covered by tests

for (std::size_t j = 0; j < level.size(); ++j) {
const std::shared_ptr<InverseKinematics>& ik = level[j];
Expand Down Expand Up @@ -509,8 +507,7 @@

_grad.setZero();
for (std::size_t i = 0; i < hierarchy.size(); ++i) {
const std::vector<std::shared_ptr<InverseKinematics> >& level
= hierarchy[i];
const std::vector<std::shared_ptr<InverseKinematics>>& level = hierarchy[i];

Check warning on line 510 in dart/dynamics/HierarchicalIK.cpp

View check run for this annotation

Codecov / codecov/patch

dart/dynamics/HierarchicalIK.cpp#L510

Added line #L510 was not covered by tests

mLevelGradCache.setZero(nDofs);
for (std::size_t j = 0; j < level.size(); ++j) {
Expand Down
8 changes: 4 additions & 4 deletions dart/dynamics/HierarchicalIK.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace dynamics {
/// their gradients added. Precedence of the modules decreases as the index of
/// the outer vector increases. Modules with lower precedence will be projected
/// through the null spaces of modules with higher precedence.
typedef std::vector<std::vector<std::shared_ptr<InverseKinematics> > >
typedef std::vector<std::vector<std::shared_ptr<InverseKinematics>>>
IKHierarchy;

/// The HierarchicalIK class provides a convenient way of setting up a
Expand Down Expand Up @@ -351,8 +351,8 @@ class HierarchicalIK : public common::Subject
class CompositeIK : public HierarchicalIK
{
public:
typedef std::unordered_set<std::shared_ptr<InverseKinematics> > ModuleSet;
typedef std::unordered_set<std::shared_ptr<const InverseKinematics> >
typedef std::unordered_set<std::shared_ptr<InverseKinematics>> ModuleSet;
typedef std::unordered_set<std::shared_ptr<const InverseKinematics>>
ConstModuleSet;

/// Create a CompositeIK module
Expand Down Expand Up @@ -385,7 +385,7 @@ class CompositeIK : public HierarchicalIK
CompositeIK(const SkeletonPtr& _skel);

/// The set of modules being used by this CompositeIK
std::unordered_set<std::shared_ptr<InverseKinematics> > mModuleSet;
std::unordered_set<std::shared_ptr<InverseKinematics>> mModuleSet;
};

/// The WholeBodyIK class provides an interface for simultaneously solving all
Expand Down
4 changes: 2 additions & 2 deletions dart/dynamics/NodeManagerJoiner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ template <class Base1, class Base2, class... OtherBases>
class NodeManagerJoinerForBodyNode<Base1, Base2, OtherBases...>
: public NodeManagerJoinerForBodyNode<
Base1,
NodeManagerJoinerForBodyNode<Base2, OtherBases...> >
NodeManagerJoinerForBodyNode<Base2, OtherBases...>>
{
public:
NodeManagerJoinerForBodyNode() = default;
Expand Down Expand Up @@ -173,7 +173,7 @@ template <class Base1, class Base2, class... OtherBases>
class NodeManagerJoinerForSkeleton<Base1, Base2, OtherBases...>
: public NodeManagerJoinerForSkeleton<
Base1,
NodeManagerJoinerForSkeleton<Base2, OtherBases...> >
NodeManagerJoinerForSkeleton<Base2, OtherBases...>>
{
public:
NodeManagerJoinerForSkeleton() = default;
Expand Down
4 changes: 2 additions & 2 deletions dart/dynamics/PointCloudShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ Eigen::Vector4d PointCloudShape::getOverallColor() const
void PointCloudShape::setColors(
const std::vector<
Eigen::Vector4d,
Eigen::aligned_allocator<Eigen::Vector4d> >& colors)
Eigen::aligned_allocator<Eigen::Vector4d>>& colors)
{
mColors = colors;
}

//==============================================================================
const std::vector<Eigen::Vector4d, Eigen::aligned_allocator<Eigen::Vector4d> >&
const std::vector<Eigen::Vector4d, Eigen::aligned_allocator<Eigen::Vector4d>>&
PointCloudShape::getColors() const
{
return mColors;
Expand Down
18 changes: 9 additions & 9 deletions dart/dynamics/SoftBodyNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1431,26 +1431,26 @@ SoftBodyNode::UniqueProperties SoftBodyNodeHelper::makeBoxProperties(

std::vector<PointPair> corners(nCorners);

std::vector<std::vector<PointPair> > edgeX(
std::vector<std::vector<PointPair>> edgeX(
4, std::vector<PointPair>(nVerticesAtEdgeX));
std::vector<std::vector<PointPair> > edgeY(
std::vector<std::vector<PointPair>> edgeY(
4, std::vector<PointPair>(nVerticesAtEdgeY));
std::vector<std::vector<PointPair> > edgeZ(
std::vector<std::vector<PointPair>> edgeZ(
4, std::vector<PointPair>(nVerticesAtEdgeZ));

std::vector<std::vector<PointPair> > sideXNeg(
std::vector<std::vector<PointPair>> sideXNeg(
nVerticesAtEdgeY, std::vector<PointPair>(nVerticesAtEdgeZ));
std::vector<std::vector<PointPair> > sideXPos(
std::vector<std::vector<PointPair>> sideXPos(
nVerticesAtEdgeY, std::vector<PointPair>(nVerticesAtEdgeZ));

std::vector<std::vector<PointPair> > sideYNeg(
std::vector<std::vector<PointPair>> sideYNeg(
nVerticesAtEdgeZ, std::vector<PointPair>(nVerticesAtEdgeX));
std::vector<std::vector<PointPair> > sideYPos(
std::vector<std::vector<PointPair>> sideYPos(
nVerticesAtEdgeZ, std::vector<PointPair>(nVerticesAtEdgeX));

std::vector<std::vector<PointPair> > sideZNeg(
std::vector<std::vector<PointPair>> sideZNeg(
nVerticesAtEdgeX, std::vector<PointPair>(nVerticesAtEdgeY));
std::vector<std::vector<PointPair> > sideZPos(
std::vector<std::vector<PointPair>> sideZPos(
nVerticesAtEdgeX, std::vector<PointPair>(nVerticesAtEdgeY));

Eigen::Vector3d x0y0z0
Expand Down
8 changes: 4 additions & 4 deletions dart/dynamics/SpecializedNodeManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
template <class SpecNode1, class... OtherSpecNodes>
class BodyNodeSpecializedFor<SpecNode1, OtherSpecNodes...>
: public NodeManagerJoinerForBodyNode<
common::Virtual<BodyNodeSpecializedFor<SpecNode1> >,
common::Virtual<BodyNodeSpecializedFor<OtherSpecNodes...> > >
common::Virtual<BodyNodeSpecializedFor<SpecNode1>>,
common::Virtual<BodyNodeSpecializedFor<OtherSpecNodes...>>>
{
};

Expand Down Expand Up @@ -217,8 +217,8 @@ DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
template <class SpecNode1, class... OtherSpecNodes>
class SkeletonSpecializedFor<SpecNode1, OtherSpecNodes...>
: public NodeManagerJoinerForSkeleton<
common::Virtual<SkeletonSpecializedFor<SpecNode1> >,
common::Virtual<SkeletonSpecializedFor<OtherSpecNodes...> > >
common::Virtual<SkeletonSpecializedFor<SpecNode1>>,
common::Virtual<SkeletonSpecializedFor<OtherSpecNodes...>>>
{
};

Expand Down
4 changes: 2 additions & 2 deletions dart/dynamics/detail/BasicNodeManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ namespace detail {
class BasicNodeManagerForBodyNode
{
public:
using NodeMap = std::map<std::type_index, std::vector<Node*> >;
using NodeMap = std::map<std::type_index, std::vector<Node*>>;
using NodeDestructorSet = std::unordered_set<NodeDestructorPtr>;
using NodeNameMgrMap = std::map<std::type_index, common::NameManager<Node*> >;
using NodeNameMgrMap = std::map<std::type_index, common::NameManager<Node*>>;
using SpecializedTreeNodes
= std::map<std::type_index, std::vector<NodeMap::iterator>*>;

Expand Down
10 changes: 5 additions & 5 deletions dart/dynamics/detail/BodyNodeAspect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,16 +116,16 @@ struct BodyNodeAspectProperties

//==============================================================================
using NodeTypeStateVector
= common::CloneableVector<std::unique_ptr<Node::State> >;
= common::CloneableVector<std::unique_ptr<Node::State>>;
using NodeStateMap
= std::map<std::type_index, std::unique_ptr<NodeTypeStateVector> >;
= std::map<std::type_index, std::unique_ptr<NodeTypeStateVector>>;
using AllNodeStates = common::CloneableMap<NodeStateMap>;

//==============================================================================
using NodeTypePropertiesVector
= common::CloneableVector<std::unique_ptr<Node::Properties> >;
= common::CloneableVector<std::unique_ptr<Node::Properties>>;
using NodePropertiesMap
= std::map<std::type_index, std::unique_ptr<NodeTypePropertiesVector> >;
= std::map<std::type_index, std::unique_ptr<NodeTypePropertiesVector>>;
using AllNodeProperties = common::CloneableMap<NodePropertiesMap>;

//==============================================================================
Expand Down Expand Up @@ -168,7 +168,7 @@ using BodyNodeCompositeBase = common::EmbedStateAndPropertiesOnTopOf<
BodyNode,
BodyNodeState,
BodyNodeAspectProperties,
common::RequiresAspect<NodeVectorProxyAspect> >;
common::RequiresAspect<NodeVectorProxyAspect>>;

} // namespace detail
} // namespace dynamics
Expand Down
2 changes: 1 addition & 1 deletion dart/dynamics/detail/EndEffectorAspect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void SupportUpdate(Support* support);

using EndEffectorCompositeBase = CompositeNode<common::CompositeJoiner<
FixedJacobianNode,
common::SpecializedForAspect<Support> > >;
common::SpecializedForAspect<Support>>>;

} // namespace detail
} // namespace dynamics
Expand Down
Loading
Loading