Tesseract
Motion Planning Environment
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tesseract_environment::DefaultEnvironmentCache Class Reference

#include <environment_cache.h>

Inheritance diagram for tesseract_environment::DefaultEnvironmentCache:
Inheritance graph
[legend]
Collaboration diagram for tesseract_environment::DefaultEnvironmentCache:
Collaboration graph
[legend]

Public Types

using Ptr = std::shared_ptr< DefaultEnvironmentCache >
 
using ConstPtr = std::shared_ptr< const DefaultEnvironmentCache >
 
- Public Types inherited from tesseract_environment::EnvironmentCache
using Ptr = std::shared_ptr< EnvironmentCache >
 
using ConstPtr = std::shared_ptr< const EnvironmentCache >
 
using UPtr = std::unique_ptr< EnvironmentCache >
 
using ConstUPtr = std::unique_ptr< const EnvironmentCache >
 

Public Member Functions

 DefaultEnvironmentCache (Environment::ConstPtr env, std::size_t cache_size=5)
 
void setCacheSize (long size) override final
 Set the cache size used to hold tesseract objects for motion planning. More...
 
long getCacheSize () const override final
 Get the cache size used to hold tesseract objects for motion planning. More...
 
void refreshCache () const override final
 If the environment has changed it will rebuild the cache of tesseract objects. More...
 
Environment::UPtr getCachedEnvironment () const override final
 This will pop an Environment object from the queue. More...
 
- Public Member Functions inherited from tesseract_environment::EnvironmentCache
 EnvironmentCache ()=default
 
virtual ~EnvironmentCache ()=default
 
 EnvironmentCache (const EnvironmentCache &)=delete
 
EnvironmentCacheoperator= (const EnvironmentCache &)=delete
 
 EnvironmentCache (EnvironmentCache &&)=delete
 
EnvironmentCacheoperator= (EnvironmentCache &&)=delete
 
virtual void setCacheSize (long size)=0
 Set the cache size used to hold tesseract objects for motion planning. More...
 
virtual long getCacheSize () const =0
 Get the cache size used to hold tesseract objects for motion planning. More...
 
virtual void refreshCache () const =0
 If the environment has changed it will rebuild the cache of tesseract objects. More...
 
virtual Environment::UPtr getCachedEnvironment () const =0
 This will pop an Environment object from the queue. More...
 

Protected Member Functions

void refreshCacheHelper () const
 This does not take a lock. More...
 

Protected Attributes

Environment::ConstPtr env_
 The tesseract_object used to create the cache. More...
 
std::size_t cache_size_ { 5 }
 The assigned cache size. More...
 
int cache_env_revision_ { 0 }
 The environment revision number at the time the cache was populated. More...
 
std::deque< Environment::UPtrcache_
 A vector of cached Tesseract objects. More...
 
std::shared_mutex cache_mutex_
 The mutex used when reading and writing to cache_. More...
 

Member Typedef Documentation

◆ ConstPtr

◆ Ptr

Constructor & Destructor Documentation

◆ DefaultEnvironmentCache()

tesseract_environment::DefaultEnvironmentCache::DefaultEnvironmentCache ( Environment::ConstPtr  env,
std::size_t  cache_size = 5 
)

Member Function Documentation

◆ getCachedEnvironment()

tesseract_environment::Environment::UPtr tesseract_environment::DefaultEnvironmentCache::getCachedEnvironment ( ) const
finaloverridevirtual

This will pop an Environment object from the queue.

This will first call refreshCache to ensure it has an updated tesseract then proceed

Implements tesseract_environment::EnvironmentCache.

◆ getCacheSize()

long tesseract_environment::DefaultEnvironmentCache::getCacheSize ( ) const
finaloverridevirtual

Get the cache size used to hold tesseract objects for motion planning.

Returns
The size of the cache.

Implements tesseract_environment::EnvironmentCache.

◆ refreshCache()

void tesseract_environment::DefaultEnvironmentCache::refreshCache ( ) const
finaloverridevirtual

If the environment has changed it will rebuild the cache of tesseract objects.

Implements tesseract_environment::EnvironmentCache.

◆ refreshCacheHelper()

void tesseract_environment::DefaultEnvironmentCache::refreshCacheHelper ( ) const
protected

This does not take a lock.

◆ setCacheSize()

void tesseract_environment::DefaultEnvironmentCache::setCacheSize ( long  size)
finaloverridevirtual

Set the cache size used to hold tesseract objects for motion planning.

Parameters
sizeThe size of the cache.

Implements tesseract_environment::EnvironmentCache.

Member Data Documentation

◆ cache_

std::deque<Environment::UPtr> tesseract_environment::DefaultEnvironmentCache::cache_
mutableprotected

A vector of cached Tesseract objects.

◆ cache_env_revision_

int tesseract_environment::DefaultEnvironmentCache::cache_env_revision_ { 0 }
mutableprotected

The environment revision number at the time the cache was populated.

◆ cache_mutex_

std::shared_mutex tesseract_environment::DefaultEnvironmentCache::cache_mutex_
mutableprotected

The mutex used when reading and writing to cache_.

◆ cache_size_

std::size_t tesseract_environment::DefaultEnvironmentCache::cache_size_ { 5 }
protected

The assigned cache size.

◆ env_

Environment::ConstPtr tesseract_environment::DefaultEnvironmentCache::env_
protected

The tesseract_object used to create the cache.


The documentation for this class was generated from the following files: