Skip to content

Commit

Permalink
Update to use forward declarations (#449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong authored Apr 12, 2024
1 parent f22b04d commit 06fe280
Show file tree
Hide file tree
Showing 309 changed files with 3,255 additions and 1,668 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <Eigen/Core>
#include <Eigen/Geometry>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

Expand Down Expand Up @@ -102,6 +101,6 @@ class CartesianWaypoint

} // namespace tesseract_planning

TESSERACT_CARTESIAN_WAYPOINT_EXPORT_KEY(tesseract_planning, CartesianWaypoint);
TESSERACT_CARTESIAN_WAYPOINT_EXPORT_KEY(tesseract_planning, CartesianWaypoint)

#endif // TESSERACT_COMMAND_LANGUAGE_CARTESIAN_WAYPOINT_H
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,20 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <vector>
#include <string>
#include <variant>
#include <Eigen/Core>
#include <boost/uuid/uuid.hpp>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_command_language/poly/instruction_poly.h>
#include <tesseract_command_language/poly/move_instruction_poly.h>
#include <tesseract_command_language/constants.h>
#include <tesseract_command_language/profile_dictionary.h>
#include <tesseract_common/manipulator_info.h>
#include <tesseract_common/any_poly.h>

namespace tesseract_planning
{
class CompositeInstruction;
class ProfileDictionary;
struct MoveInstructionPoly;

/**
* @brief This is used for filtering only what you want in the vector
Expand Down Expand Up @@ -134,16 +136,16 @@ class CompositeInstruction
void setProfile(const std::string& profile);
const std::string& getProfile() const;

void setProfileOverrides(ProfileDictionary::ConstPtr profile_overrides);
ProfileDictionary::ConstPtr getProfileOverrides() const;
void setProfileOverrides(std::shared_ptr<const ProfileDictionary> profile_overrides);
std::shared_ptr<const ProfileDictionary> getProfileOverrides() const;

void setManipulatorInfo(tesseract_common::ManipulatorInfo info);
const tesseract_common::ManipulatorInfo& getManipulatorInfo() const;
tesseract_common::ManipulatorInfo& getManipulatorInfo();

void setInstructions(std::vector<tesseract_planning::InstructionPoly> instructions);
std::vector<tesseract_planning::InstructionPoly>& getInstructions();
const std::vector<tesseract_planning::InstructionPoly>& getInstructions() const;
void setInstructions(std::vector<InstructionPoly> instructions);
std::vector<InstructionPoly>& getInstructions();
const std::vector<InstructionPoly>& getInstructions() const;

void appendMoveInstruction(const MoveInstructionPoly& mi);
void appendMoveInstruction(const MoveInstructionPoly&& mi);
Expand Down Expand Up @@ -407,7 +409,7 @@ class CompositeInstruction
std::string profile_{ DEFAULT_PROFILE_KEY };

/** @brief Dictionary of profiles that will override named profiles for a specific task*/
ProfileDictionary::ConstPtr profile_overrides_;
std::shared_ptr<const ProfileDictionary> profile_overrides_;

/** @brief The order of the composite instruction */
CompositeInstructionOrder order_{ CompositeInstructionOrder::ORDERED };
Expand Down Expand Up @@ -464,7 +466,7 @@ class CompositeInstruction

} // namespace tesseract_planning

TESSERACT_INSTRUCTION_EXPORT_KEY(tesseract_planning, CompositeInstruction);
TESSERACT_ANY_EXPORT_KEY(tesseract_planning, CompositeInstruction);
TESSERACT_INSTRUCTION_EXPORT_KEY(tesseract_planning, CompositeInstruction)
TESSERACT_ANY_EXPORT_KEY(tesseract_planning, CompositeInstruction)

#endif // TESSERACT_COMMAND_LANGUAGE_COMPOSITE_INSTRUCTION_H
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#ifndef TESSERACT_COMMAND_LANGUAGE_FWD_H
#define TESSERACT_COMMAND_LANGUAGE_FWD_H

namespace tesseract_planning
{
// Waypoint Poly
struct WaypointPoly;
struct CartesianWaypointPoly;
struct JointWaypointPoly;
struct StateWaypointPoly;

// Waypoints
class CartesianWaypoint;
class JointWaypoint;
class StateWaypoint;

// Instruction Poly
struct InstructionPoly;
enum class MoveInstructionType : int;
struct MoveInstructionPoly;

// Instructions
enum class CompositeInstructionOrder;
class CompositeInstruction;
class MoveInstruction;
class SetAnalogInstruction;
class SetToolInstruction;
enum class TimerInstructionType : int;
class TimerInstruction;
enum class WaitInstructionType : int;
class WaitInstruction;

// Profile Dictionary
class ProfileDictionary;
} // namespace tesseract_planning
#endif // TESSERACT_COMMAND_LANGUAGE_FWD_H
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_command_language/poly/joint_waypoint_poly.h>
#include <tesseract_common/utils.h>

namespace tesseract_planning
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,17 @@
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <Eigen/Geometry>
#include <boost/uuid/uuid.hpp>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_command_language/poly/move_instruction_poly.h>
#include <tesseract_command_language/poly/waypoint_poly.h>
#include <tesseract_command_language/constants.h>
#include <tesseract_command_language/profile_dictionary.h>
#include <tesseract_common/manipulator_info.h>

namespace tesseract_planning
{
class ProfileDictionary;
/**
* @brief The move instruction is used when defining the results of a motion planning request
* @details
Expand Down Expand Up @@ -143,11 +144,11 @@ class MoveInstruction
void setPathProfile(const std::string& profile);
const std::string& getPathProfile() const;

void setProfileOverrides(ProfileDictionary::ConstPtr profile_overrides);
ProfileDictionary::ConstPtr getProfileOverrides() const;
void setProfileOverrides(std::shared_ptr<const ProfileDictionary> profile_overrides);
std::shared_ptr<const ProfileDictionary> getProfileOverrides() const;

void setPathProfileOverrides(ProfileDictionary::ConstPtr profile_overrides);
ProfileDictionary::ConstPtr getPathProfileOverrides() const;
void setPathProfileOverrides(std::shared_ptr<const ProfileDictionary> profile_overrides);
std::shared_ptr<const ProfileDictionary> getPathProfileOverrides() const;

const std::string& getDescription() const;

Expand Down Expand Up @@ -182,10 +183,10 @@ class MoveInstruction
std::string path_profile_;

/** @brief Dictionary of profiles that will override named profiles for a specific task*/
ProfileDictionary::ConstPtr profile_overrides_;
std::shared_ptr<const ProfileDictionary> profile_overrides_;

/** @brief Dictionary of path profiles that will override named profiles for a specific task*/
ProfileDictionary::ConstPtr path_profile_overrides_;
std::shared_ptr<const ProfileDictionary> path_profile_overrides_;

/** @brief The assigned waypoint (Cartesian, Joint or State) */
WaypointPoly waypoint_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,17 @@
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <string>
#include <boost/serialization/base_object.hpp>
#include <Eigen/Geometry>
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/concept_check.hpp>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_command_language/poly/waypoint_poly.h>
#include <tesseract_common/joint_state.h>
#include <tesseract_common/serialization.h>
#include <tesseract_common/type_erasure.h>
#include <tesseract_common/joint_state.h>
#include <tesseract_common/fwd.h>

/** @brief If shared library, this must go in the header after the class definition */
#define TESSERACT_CARTESIAN_WAYPOINT_EXPORT_KEY(N, C) \
Expand Down Expand Up @@ -265,8 +267,8 @@ BOOST_CLASS_EXPORT_KEY(tesseract_planning::CartesianWaypointPolyBase)
BOOST_CLASS_TRACKING(tesseract_planning::CartesianWaypointPolyBase, boost::serialization::track_never)

BOOST_CLASS_EXPORT_KEY(tesseract_planning::CartesianWaypointPoly)
BOOST_CLASS_TRACKING(tesseract_planning::CartesianWaypointPoly, boost::serialization::track_never);
BOOST_CLASS_TRACKING(tesseract_planning::CartesianWaypointPoly, boost::serialization::track_never)

TESSERACT_WAYPOINT_EXPORT_KEY(tesseract_planning, CartesianWaypointPoly);
TESSERACT_WAYPOINT_EXPORT_KEY(tesseract_planning, CartesianWaypointPoly)

#endif // TESSERACT_COMMAND_LANGUAGE_CARTESIAN_WAYPOINT_POLY_H
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,21 @@
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <string>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/nvp.hpp>
#include <boost/concept_check.hpp>
#include <boost/uuid/uuid.hpp>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_command_language/poly/waypoint_poly.h>
#include <tesseract_common/serialization.h>
#include <tesseract_common/fwd.h>
#include <tesseract_common/type_erasure.h>

namespace boost::uuids
{
struct uuid;
}

/** @brief If shared library, this must go in the header after the class definition */
#define TESSERACT_INSTRUCTION_EXPORT_KEY(N, C) \
namespace N \
Expand Down Expand Up @@ -207,6 +212,6 @@ BOOST_CLASS_EXPORT_KEY(tesseract_planning::InstructionPolyBase)
BOOST_CLASS_TRACKING(tesseract_planning::InstructionPolyBase, boost::serialization::track_never)

BOOST_CLASS_EXPORT_KEY(tesseract_planning::InstructionPoly)
BOOST_CLASS_TRACKING(tesseract_planning::InstructionPoly, boost::serialization::track_never);
BOOST_CLASS_TRACKING(tesseract_planning::InstructionPoly, boost::serialization::track_never)

#endif // TESSERACT_COMMAND_LANGUAGE_INSTRUCTION_H
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <string>
#include <boost/serialization/base_object.hpp>
#include <Eigen/Core>
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/concept_check.hpp>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_command_language/poly/waypoint_poly.h>
#include <tesseract_common/serialization.h>
#include <tesseract_common/type_erasure.h>
#include <tesseract_common/fwd.h>

/** @brief If shared library, this must go in the header after the class definition */
#define TESSERACT_JOINT_WAYPOINT_EXPORT_KEY(N, C) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,20 @@
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <string>
#include <boost/serialization/base_object.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/concept_check.hpp>
#include <boost/uuid/uuid.hpp>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_command_language/poly/instruction_poly.h>
#include <tesseract_command_language/poly/cartesian_waypoint_poly.h>
#include <tesseract_command_language/poly/joint_waypoint_poly.h>
#include <tesseract_command_language/poly/state_waypoint_poly.h>
#include <tesseract_command_language/poly/waypoint_poly.h>
#include <tesseract_command_language/profile_dictionary.h>
#include <tesseract_common/manipulator_info.h>
#include <tesseract_common/serialization.h>
#include <tesseract_common/type_erasure.h>
#include <tesseract_common/fwd.h>

/** @brief If shared library, this must go in the header after the class definition */
#define TESSERACT_MOVE_INSTRUCTION_EXPORT_KEY(N, C) \
Expand Down Expand Up @@ -78,6 +77,7 @@ TESSERACT_COMMON_IGNORE_WARNINGS_POP
namespace tesseract_planning
{
struct MoveInstructionPoly;
class ProfileDictionary;

enum class MoveInstructionType : int
{
Expand Down Expand Up @@ -189,11 +189,11 @@ struct MoveInstructionInterface : tesseract_common::TypeErasureInterface
virtual void setPathProfile(const std::string& profile) = 0;
virtual const std::string& getPathProfile() const = 0;

virtual void setProfileOverrides(ProfileDictionary::ConstPtr profile_overrides) = 0;
virtual ProfileDictionary::ConstPtr getProfileOverrides() const = 0;
virtual void setProfileOverrides(std::shared_ptr<const ProfileDictionary> profile_overrides) = 0;
virtual std::shared_ptr<const ProfileDictionary> getProfileOverrides() const = 0;

virtual void setPathProfileOverrides(ProfileDictionary::ConstPtr profile_overrides) = 0;
virtual ProfileDictionary::ConstPtr getPathProfileOverrides() const = 0;
virtual void setPathProfileOverrides(std::shared_ptr<const ProfileDictionary> profile_overrides) = 0;
virtual std::shared_ptr<const ProfileDictionary> getPathProfileOverrides() const = 0;

virtual void setMoveType(MoveInstructionType move_type) = 0;
virtual MoveInstructionType getMoveType() const = 0;
Expand Down Expand Up @@ -253,17 +253,23 @@ struct MoveInstructionInstance : tesseract_common::TypeErasureInstance<T, MoveIn
void setPathProfile(const std::string& profile) final { this->get().setPathProfile(profile); }
const std::string& getPathProfile() const final { return this->get().getPathProfile(); }

void setProfileOverrides(ProfileDictionary::ConstPtr profile_overrides) final
void setProfileOverrides(std::shared_ptr<const ProfileDictionary> profile_overrides) final
{
this->get().setProfileOverrides(profile_overrides);
}
ProfileDictionary::ConstPtr getProfileOverrides() const final { return this->get().getProfileOverrides(); }
std::shared_ptr<const ProfileDictionary> getProfileOverrides() const final
{
return this->get().getProfileOverrides();
}

void setPathProfileOverrides(ProfileDictionary::ConstPtr profile_overrides) final
void setPathProfileOverrides(std::shared_ptr<const ProfileDictionary> profile_overrides) final
{
this->get().setPathProfileOverrides(profile_overrides);
}
ProfileDictionary::ConstPtr getPathProfileOverrides() const final { return this->get().getPathProfileOverrides(); }
std::shared_ptr<const ProfileDictionary> getPathProfileOverrides() const final
{
return this->get().getPathProfileOverrides();
}

void setMoveType(MoveInstructionType move_type) final { this->get().setMoveType(move_type); }
MoveInstructionType getMoveType() const final { return this->get().getMoveType(); }
Expand Down Expand Up @@ -319,11 +325,11 @@ struct MoveInstructionPoly : MoveInstructionPolyBase
void setPathProfile(const std::string& profile);
const std::string& getPathProfile() const;

void setProfileOverrides(ProfileDictionary::ConstPtr profile_overrides);
ProfileDictionary::ConstPtr getProfileOverrides() const;
void setProfileOverrides(std::shared_ptr<const ProfileDictionary> profile_overrides);
std::shared_ptr<const ProfileDictionary> getProfileOverrides() const;

void setPathProfileOverrides(ProfileDictionary::ConstPtr profile_overrides);
ProfileDictionary::ConstPtr getPathProfileOverrides() const;
void setPathProfileOverrides(std::shared_ptr<const ProfileDictionary> profile_overrides);
std::shared_ptr<const ProfileDictionary> getPathProfileOverrides() const;

void setMoveType(MoveInstructionType move_type);
MoveInstructionType getMoveType() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@
#include <tesseract_common/macros.h>
TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
#include <string>
#include <boost/serialization/base_object.hpp>
#include <Eigen/Core>
#include <boost/serialization/access.hpp>
#include <boost/serialization/export.hpp>
#include <boost/serialization/base_object.hpp>
#include <boost/concept_check.hpp>
TESSERACT_COMMON_IGNORE_WARNINGS_POP

#include <tesseract_command_language/poly/waypoint_poly.h>
#include <tesseract_common/serialization.h>
#include <tesseract_common/type_erasure.h>
#include <tesseract_common/fwd.h>

/** @brief If shared library, this must go in the header after the class definition */
#define TESSERACT_STATE_WAYPOINT_EXPORT_KEY(N, C) \
Expand Down Expand Up @@ -284,8 +286,8 @@ BOOST_CLASS_EXPORT_KEY(tesseract_planning::StateWaypointPolyBase)
BOOST_CLASS_TRACKING(tesseract_planning::StateWaypointPolyBase, boost::serialization::track_never)

BOOST_CLASS_EXPORT_KEY(tesseract_planning::StateWaypointPoly)
BOOST_CLASS_TRACKING(tesseract_planning::StateWaypointPoly, boost::serialization::track_never);
BOOST_CLASS_TRACKING(tesseract_planning::StateWaypointPoly, boost::serialization::track_never)

TESSERACT_WAYPOINT_EXPORT_KEY(tesseract_planning, StateWaypointPoly);
TESSERACT_WAYPOINT_EXPORT_KEY(tesseract_planning, StateWaypointPoly)

#endif // TESSERACT_COMMAND_LANGUAGE_STATE_WAYPOINT_POLY_H
Loading

0 comments on commit 06fe280

Please sign in to comment.