g2o
Loading...
Searching...
No Matches
g2o::Cache Class Referenceabstract

#include <cache.h>

Inheritance diagram for g2o::Cache:
Collaboration diagram for g2o::Cache:

Classes

class  CacheKey

Public Member Functions

 Cache (CacheContainer *container_=0, const ParameterVector &parameters_=ParameterVector())
CacheKey key () const
OptimizableGraph::Vertex * vertex ()
OptimizableGraph * graph ()
CacheContainer * container ()
ParameterVector & parameters ()
void update ()
virtual HyperGraph::HyperGraphElementType elementType () const
Public Member Functions inherited from g2o::HyperGraph::HyperGraphElement
virtual ~HyperGraphElement ()

Protected Member Functions

virtual void updateImpl ()=0
 redefine this to do the update
Cache * installDependency (const std::string &type_, const std::vector< int > &parameterIndices)
virtual bool resolveDependencies ()

Protected Attributes

bool _updateNeeded
ParameterVector _parameters
std::vector< Cache * > _parentCaches
CacheContainer * _container

Friends

class CacheContainer

Detailed Description

Definition at line 39 of file cache.h.

Constructor & Destructor Documentation

◆ Cache()

g2o::Cache::Cache ( CacheContainer * container_ = 0,
const ParameterVector & parameters_ = ParameterVector() )

Member Function Documentation

◆ container()

CacheContainer * g2o::Cache::container ( )

Definition at line 67 of file cache.cpp.

References _container, and CacheContainer.

Referenced by graph(), installDependency(), and vertex().

◆ elementType()

virtual HyperGraph::HyperGraphElementType g2o::Cache::elementType ( ) const
inlinevirtual

returns the type of the graph element, see HyperGraphElementType

Implements g2o::HyperGraph::HyperGraphElement.

Definition at line 70 of file cache.h.

◆ graph()

OptimizableGraph * g2o::Cache::graph ( )

Definition at line 62 of file cache.cpp.

References container(), and g2o::CacheContainer::graph().

◆ installDependency()

Cache * g2o::Cache::installDependency ( const std::string & type_,
const std::vector< int > & parameterIndices )
protected

this function installs and satisfies a cache

Parameters
type_the typename of the dependency
parameterIndicesa vector containing the indices if the parameters in _parameters that will be used to assemble the Key of the cache being created For example if I have a cache of type C2, having parameters "A, B, and C", and it depends on a cache of type C1 that depends on the parameters A and C, the parameterIndices should contain "0, 2", since they are the positions in the parameter vector of C2 of the parameters needed to construct C1.
Returns
the newly created cache

Definition at line 86 of file cache.cpp.

References _parameters, _parentCaches, Cache(), container(), g2o::CacheContainer::createCache(), and g2o::CacheContainer::findCache().

Referenced by updateImpl().

◆ key()

Cache::CacheKey g2o::Cache::key ( ) const

Definition at line 71 of file cache.cpp.

References _parameters, g2o::Factory::instance(), and g2o::Factory::tag().

◆ parameters()

ParameterVector & g2o::Cache::parameters ( )

Definition at line 69 of file cache.cpp.

References _parameters.

◆ resolveDependencies()

bool g2o::Cache::resolveDependencies ( )
protectedvirtual

Function to be called from a cache that has dependencies. It just invokes a sequence of installDependency(). Although the caches returned are stored in the _parentCache vector, it is better that you redefine your own cache member variables, for better readability

Reimplemented in g2o::CacheCamera, g2o::CacheSE2Offset, g2o::CacheSE3Offset, and g2o::tutorial::CacheSE2Offset.

Definition at line 105 of file cache.cpp.

Referenced by g2o::CacheContainer::createCache(), and updateImpl().

◆ update()

void g2o::Cache::update ( )

Definition at line 76 of file cache.cpp.

References _parentCaches, _updateNeeded, and updateImpl().

Referenced by g2o::CacheContainer::createCache().

◆ updateImpl()

virtual void g2o::Cache::updateImpl ( )
protectedpure virtual

redefine this to do the update

Implemented in g2o::CacheCamera, g2o::CacheSE2Offset, g2o::CacheSE3Offset, and g2o::tutorial::CacheSE2Offset.

References Cache(), installDependency(), and resolveDependencies().

Referenced by update().

◆ vertex()

◆ CacheContainer

friend class CacheContainer
friend

Definition at line 41 of file cache.h.

References CacheContainer.

Referenced by Cache(), CacheContainer, and container().

Member Data Documentation

◆ _container

CacheContainer* g2o::Cache::_container
protected

Definition at line 105 of file cache.h.

Referenced by Cache(), container(), and g2o::CacheContainer::createCache().

◆ _parameters

◆ _parentCaches

std::vector<Cache*> g2o::Cache::_parentCaches
protected

Definition at line 104 of file cache.h.

Referenced by installDependency(), and update().

◆ _updateNeeded

bool g2o::Cache::_updateNeeded
protected

Definition at line 102 of file cache.h.

Referenced by Cache(), and update().


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