Skip to content

Commit

Permalink
Expose environment init revision
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Aug 20, 2024
1 parent 2bf0df3 commit dc26b4a
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ class Environment
*/
int getRevision() const;

/**
* @brief Get the initialization revision number
* @return Initialization revision number
*/
int getInitRevision() const;

/**
* @brief Get Environment command history post initialization
* @return List of commands
Expand Down
8 changes: 7 additions & 1 deletion tesseract_environment/src/environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ std::unique_ptr<Environment::Implementation> Environment::Implementation::clone(
return cloned_env;

cloned_env->initialized = initialized;
cloned_env->init_revision = revision;
cloned_env->init_revision = init_revision;
cloned_env->revision = revision;
cloned_env->commands = commands;
cloned_env->scene_graph = scene_graph->clone();
Expand Down Expand Up @@ -2278,6 +2278,12 @@ int Environment::getRevision() const
return std::as_const<Implementation>(*impl_).revision;
}

int Environment::getInitRevision() const
{
std::shared_lock<std::shared_mutex> lock(mutex_);
return std::as_const<Implementation>(*impl_).init_revision;
}

std::vector<std::shared_ptr<const Command>> Environment::getCommandHistory() const
{
std::shared_lock<std::shared_mutex> lock(mutex_);
Expand Down
Loading

0 comments on commit dc26b4a

Please sign in to comment.