26#ifndef TESSERACT_ENVIRONMENT_ENVIRONMENT_CACHE_H
27#define TESSERACT_ENVIRONMENT_ENVIRONMENT_CACHE_H
34#include <shared_mutex>
43 using Ptr = std::shared_ptr<EnvironmentCache>;
44 using ConstPtr = std::shared_ptr<const EnvironmentCache>;
45 using UPtr = std::unique_ptr<EnvironmentCache>;
46 using ConstUPtr = std::unique_ptr<const EnvironmentCache>;
80 using Ptr = std::shared_ptr<DefaultEnvironmentCache>;
81 using ConstPtr = std::shared_ptr<const DefaultEnvironmentCache>;
117 mutable std::deque<Environment::UPtr>
cache_;
Definition: environment_cache.h:78
void refreshCache() const override final
If the environment has changed it will rebuild the cache of tesseract objects.
Definition: environment_cache.cpp:45
Environment::UPtr getCachedEnvironment() const override final
This will pop an Environment object from the queue.
Definition: environment_cache.cpp:51
std::shared_mutex cache_mutex_
The mutex used when reading and writing to cache_.
Definition: environment_cache.h:120
long getCacheSize() const override final
Get the cache size used to hold tesseract objects for motion planning.
Definition: environment_cache.cpp:43
std::shared_ptr< const DefaultEnvironmentCache > ConstPtr
Definition: environment_cache.h:81
std::size_t cache_size_
The assigned cache size.
Definition: environment_cache.h:111
std::shared_ptr< DefaultEnvironmentCache > Ptr
Definition: environment_cache.h:80
int cache_env_revision_
The environment revision number at the time the cache was populated.
Definition: environment_cache.h:114
void setCacheSize(long size) override final
Set the cache size used to hold tesseract objects for motion planning.
Definition: environment_cache.cpp:37
std::deque< Environment::UPtr > cache_
A vector of cached Tesseract objects.
Definition: environment_cache.h:117
void refreshCacheHelper() const
This does not take a lock.
Definition: environment_cache.cpp:67
Environment::ConstPtr env_
The tesseract_object used to create the cache.
Definition: environment_cache.h:108
Definition: environment_cache.h:41
virtual void refreshCache() const =0
If the environment has changed it will rebuild the cache of tesseract objects.
EnvironmentCache(EnvironmentCache &&)=delete
EnvironmentCache & operator=(EnvironmentCache &&)=delete
virtual ~EnvironmentCache()=default
std::shared_ptr< const EnvironmentCache > ConstPtr
Definition: environment_cache.h:44
std::unique_ptr< const EnvironmentCache > ConstUPtr
Definition: environment_cache.h:46
EnvironmentCache(const EnvironmentCache &)=delete
std::unique_ptr< EnvironmentCache > UPtr
Definition: environment_cache.h:45
std::shared_ptr< EnvironmentCache > Ptr
Definition: environment_cache.h:43
EnvironmentCache()=default
virtual long getCacheSize() const =0
Get the cache size used to hold tesseract objects for motion planning.
virtual void setCacheSize(long size)=0
Set the cache size used to hold tesseract objects for motion planning.
virtual Environment::UPtr getCachedEnvironment() const =0
This will pop an Environment object from the queue.
EnvironmentCache & operator=(const EnvironmentCache &)=delete
Definition: environment.h:65
std::unique_ptr< Environment > UPtr
Definition: environment.h:73
std::shared_ptr< const Environment > ConstPtr
Definition: environment.h:72
#define TESSERACT_COMMON_IGNORE_WARNINGS_PUSH
Definition: macros.h:71
Definition: create_convex_hull.cpp:36
auto env
Definition: tesseract_environment_cache_unit.cpp:67