Skip to content

Commit

Permalink
Rename LeafSystem::DoMakeContext() to DoMakeLeafContext().
Browse files Browse the repository at this point in the history
  • Loading branch information
sherm1 committed Feb 7, 2018
1 parent dcd4342 commit 91b1ae8
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/multibody/acrobot/acrobot_plant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void AcrobotPlant<T>::RegisterGeometry(

template<typename T>
std::unique_ptr<systems::LeafContext<T>>
AcrobotPlant<T>::DoMakeContext() const {
AcrobotPlant<T>::DoMakeLeafContext() const {
return std::make_unique<MultibodyTreeContext<T>>(model_->get_topology());
}

Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/acrobot/acrobot_plant.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class AcrobotPlant final : public systems::LeafSystem<T> {

// This override gives System::AllocateContext() the chance to create a more
// specialized context type, in this case, a MultibodyTreeContext.
std::unique_ptr<systems::LeafContext<T>> DoMakeContext() const override;
std::unique_ptr<systems::LeafContext<T>> DoMakeLeafContext() const override;

void DoCalcTimeDerivatives(
const systems::Context<T>& context,
Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/pendulum/pendulum_plant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ void PendulumPlant<T>::RegisterGeometry(

template<typename T>
std::unique_ptr<systems::LeafContext<T>>
PendulumPlant<T>::DoMakeContext() const {
PendulumPlant<T>::DoMakeLeafContext() const {
return model_->CreateDefaultContext();
}

Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/pendulum/pendulum_plant.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class PendulumPlant final : public systems::LeafSystem<T> {

// Override of context construction so that we can delegate it to
// MultibodyTree.
std::unique_ptr<systems::LeafContext<T>> DoMakeContext() const override;
std::unique_ptr<systems::LeafContext<T>> DoMakeLeafContext() const override;

void DoCalcTimeDerivatives(
const systems::Context<T>& context,
Expand Down
2 changes: 1 addition & 1 deletion geometry/geometry_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ void GeometrySystem<T>::FullPoseUpdate(
}

template <typename T>
std::unique_ptr<LeafContext<T>> GeometrySystem<T>::DoMakeContext() const {
std::unique_ptr<LeafContext<T>> GeometrySystem<T>::DoMakeLeafContext() const {
// Disallow further geometry source additions.
initial_state_ = nullptr;
DRAKE_ASSERT(geometry_state_index_ >= 0);
Expand Down
2 changes: 1 addition & 1 deletion geometry/geometry_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ class GeometrySystem final : public systems::LeafSystem<T> {
// - instantiating a GeometryContext instance (as opposed to LeafContext),
// - to detect allocation in support of the topology semantics described
// above.
std::unique_ptr<systems::LeafContext<T>> DoMakeContext() const override;
std::unique_ptr<systems::LeafContext<T>> DoMakeLeafContext() const override;

// Helper method for throwing an exception if a context has *ever* been
// allocated by this system. The invoking method should pass it's name so
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ void MultibodyPlant<T>::Finalize() {

template<typename T>
std::unique_ptr<systems::LeafContext<T>>
MultibodyPlant<T>::DoMakeContext() const {
MultibodyPlant<T>::DoMakeLeafContext() const {
DRAKE_THROW_UNLESS(is_finalized());
return std::make_unique<MultibodyTreeContext<T>>(model_->get_topology());
}
Expand Down
2 changes: 1 addition & 1 deletion multibody/multibody_tree/multibody_plant/multibody_plant.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class MultibodyPlant final : public systems::LeafSystem<T> {

// This override gives System::AllocateContext() the chance to create a more
// specialized context type, in this case, a MultibodyTreeContext.
std::unique_ptr<systems::LeafContext<T>> DoMakeContext() const override;
std::unique_ptr<systems::LeafContext<T>> DoMakeLeafContext() const override;

// Implements the system dynamics according to this class's documentation.
void DoCalcTimeDerivatives(
Expand Down
2 changes: 1 addition & 1 deletion multibody/multibody_tree/test/free_rotating_body_plant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ FreeRotatingBodyPlant<T>::get_default_initial_angular_velocity() const {

template<typename T>
std::unique_ptr<systems::LeafContext<T>>
FreeRotatingBodyPlant<T>::DoMakeContext() const {
FreeRotatingBodyPlant<T>::DoMakeLeafContext() const {
return model_.CreateDefaultContext();
}

Expand Down
2 changes: 1 addition & 1 deletion multibody/multibody_tree/test/free_rotating_body_plant.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class FreeRotatingBodyPlant final : public systems::LeafSystem<T> {
private:
// Override of context construction so that we can delegate it to
// MultibodyTree.
std::unique_ptr<systems::LeafContext<T>> DoMakeContext() const override;
std::unique_ptr<systems::LeafContext<T>> DoMakeLeafContext() const override;

void DoCalcTimeDerivatives(
const systems::Context<T> &context,
Expand Down
4 changes: 2 additions & 2 deletions systems/framework/leaf_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class LeafSystem : public System<T> {
/// @endcond

std::unique_ptr<Context<T>> AllocateContext() const override {
std::unique_ptr<LeafContext<T>> context = DoMakeContext();
std::unique_ptr<LeafContext<T>> context = DoMakeLeafContext();
// Reserve inputs that have already been declared.
context->SetNumInputPorts(this->get_num_input_ports());
// Reserve continuous state via delegation to subclass.
Expand Down Expand Up @@ -303,7 +303,7 @@ class LeafSystem : public System<T> {
// classes do *not* add new data members. If that changes, e.g., with the
// advent of the cache, this documentation should be changed to include the
// initialization of the sub-class's *unique* data members.
virtual std::unique_ptr<LeafContext<T>> DoMakeContext() const {
virtual std::unique_ptr<LeafContext<T>> DoMakeLeafContext() const {
return std::make_unique<LeafContext<T>>();
}

Expand Down
2 changes: 1 addition & 1 deletion systems/framework/test/leaf_system_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1354,7 +1354,7 @@ class CustomContext : public LeafContext<T> {};
template <typename T>
class CustomContextSystem : public LeafSystem<T> {
protected:
std::unique_ptr<LeafContext<T>> DoMakeContext() const override {
std::unique_ptr<LeafContext<T>> DoMakeLeafContext() const override {
return std::make_unique<CustomContext<T>>();
}
};
Expand Down

0 comments on commit 91b1ae8

Please sign in to comment.