g2o
Loading...
Searching...
No Matches
g2o::ParameterContainer Class Reference

map id to parameters More...

#include <parameter_container.h>

Inheritance diagram for g2o::ParameterContainer:
Collaboration diagram for g2o::ParameterContainer:

Public Types

typedef std::map< int, Parameter * > BaseClass

Public Member Functions

 ParameterContainer (bool isMainStorage_=true)
virtual ~ParameterContainer ()
bool addParameter (Parameter *p)
 add parameter to the container
Parameter * getParameter (int id)
 return a parameter based on its ID
const Parameter * getParameter (int id) const
 return a parameter based on its ID
Parameter * detachParameter (int id)
 remove a parameter from the container, i.e., the user now owns the pointer
virtual bool read (std::istream &is, const std::map< std::string, std::string > *renamedMap=0)
 read parameters from a stream
virtual bool write (std::ostream &os) const
 write the data to a stream
bool isMainStorage () const
void clear ()

Protected Attributes

bool _isMainStorage

Detailed Description

map id to parameters

Definition at line 41 of file parameter_container.h.

Member Typedef Documentation

◆ BaseClass

Definition at line 43 of file parameter_container.h.

Constructor & Destructor Documentation

◆ ParameterContainer()

g2o::ParameterContainer::ParameterContainer ( bool isMainStorage_ = true)

create a container for the parameters.

Parameters
isMainStorage_pointers to the parameters are owned by this container, i.e., freed in its constructor

Definition at line 43 of file parameter_container.cpp.

References _isMainStorage.

◆ ~ParameterContainer()

g2o::ParameterContainer::~ParameterContainer ( )
virtual

Definition at line 54 of file parameter_container.cpp.

References clear().

Member Function Documentation

◆ addParameter()

bool g2o::ParameterContainer::addParameter ( Parameter * p)

add parameter to the container

Definition at line 56 of file parameter_container.cpp.

References g2o::Parameter::id().

Referenced by read().

◆ clear()

void g2o::ParameterContainer::clear ( )

Definition at line 46 of file parameter_container.cpp.

References _isMainStorage.

Referenced by ~ParameterContainer().

◆ detachParameter()

Parameter * g2o::ParameterContainer::detachParameter ( int id)

remove a parameter from the container, i.e., the user now owns the pointer

Definition at line 76 of file parameter_container.cpp.

◆ getParameter() [1/2]

Parameter * g2o::ParameterContainer::getParameter ( int id)

return a parameter based on its ID

Definition at line 64 of file parameter_container.cpp.

◆ getParameter() [2/2]

const Parameter * g2o::ParameterContainer::getParameter ( int id) const

return a parameter based on its ID

Definition at line 70 of file parameter_container.cpp.

◆ isMainStorage()

bool g2o::ParameterContainer::isMainStorage ( ) const
inline

Definition at line 65 of file parameter_container.h.

References _isMainStorage.

◆ read()

bool g2o::ParameterContainer::read ( std::istream & is,
const std::map< std::string, std::string > * renamedMap = 0 )
virtual

◆ write()

bool g2o::ParameterContainer::write ( std::ostream & os) const
virtual

write the data to a stream

Definition at line 84 of file parameter_container.cpp.

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

Member Data Documentation

◆ _isMainStorage

bool g2o::ParameterContainer::_isMainStorage
protected

Definition at line 72 of file parameter_container.h.

Referenced by clear(), isMainStorage(), and ParameterContainer().


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