g2o
|
map id to parameters More...
#include <parameter_container.h>
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 More... | |
Parameter * | getParameter (int id) |
return a parameter based on its ID More... | |
const Parameter * | getParameter (int id) const |
return a parameter based on its ID More... | |
Parameter * | detachParameter (int id) |
remove a parameter from the container, i.e., the user now owns the pointer More... | |
virtual bool | read (std::istream &is, const std::map< std::string, std::string > *renamedMap=0) |
read parameters from a stream More... | |
virtual bool | write (std::ostream &os) const |
write the data to a stream More... | |
bool | isMainStorage () const |
void | clear () |
Protected Attributes | |
bool | _isMainStorage |
map id to parameters
Definition at line 41 of file parameter_container.h.
typedef std::map<int, Parameter*> g2o::ParameterContainer::BaseClass |
Definition at line 44 of file parameter_container.h.
g2o::ParameterContainer::ParameterContainer | ( | bool | isMainStorage_ = true | ) |
create a container for the parameters.
isMainStorage_ | pointers to the parameters are owned by this container, i.e., freed in its constructor |
Definition at line 42 of file parameter_container.cpp.
|
virtual |
bool g2o::ParameterContainer::addParameter | ( | Parameter * | p | ) |
add parameter to the container
Definition at line 60 of file parameter_container.cpp.
References g2o::Parameter::id().
Referenced by read().
void g2o::ParameterContainer::clear | ( | ) |
Definition at line 47 of file parameter_container.cpp.
References _isMainStorage.
Referenced by isMainStorage(), and ~ParameterContainer().
Parameter * g2o::ParameterContainer::detachParameter | ( | int | id | ) |
remove a parameter from the container, i.e., the user now owns the pointer
Definition at line 84 of file parameter_container.cpp.
Parameter * g2o::ParameterContainer::getParameter | ( | int | id | ) |
return a parameter based on its ID
Definition at line 70 of file parameter_container.cpp.
const Parameter * g2o::ParameterContainer::getParameter | ( | int | id | ) | const |
return a parameter based on its ID
Definition at line 77 of file parameter_container.cpp.
|
inline |
|
virtual |
read parameters from a stream
Definition at line 104 of file parameter_container.cpp.
References __PRETTY_FUNCTION__, addParameter(), g2o::Factory::construct(), g2o::HyperGraph::HyperGraphElement::elementType(), HGET_PARAMETER, g2o::Factory::instance(), g2o::readLine(), and g2o::Parameter::setId().
|
virtual |
write the data to a stream
Definition at line 93 of file parameter_container.cpp.
References g2o::Factory::instance(), and g2o::Factory::tag().
|
protected |
Definition at line 71 of file parameter_container.h.
Referenced by clear(), and isMainStorage().