#include "rtabmap/core/RtabmapExp.h"
#include "rtabmap/core/Version.h"
#include <rtabmap/utilite/UConversion.h>
#include <string>
#include <map>
Go to the source code of this file.
|
#define | RTABMAP_PARAM(PREFIX, NAME, TYPE, DEFAULT_VALUE, DESCRIPTION) |
|
#define | RTABMAP_PARAM_COND(PREFIX, NAME, TYPE, COND, DEFAULT_VALUE1, DEFAULT_VALUE2, DESCRIPTION) |
|
#define | RTABMAP_PARAM_STR(PREFIX, NAME, DEFAULT_VALUE, DESCRIPTION) |
|
#define RTABMAP_PARAM |
( |
|
PREFIX, |
|
|
|
NAME, |
|
|
|
TYPE, |
|
|
|
DEFAULT_VALUE, |
|
|
|
DESCRIPTION |
|
) |
| |
Value:public: \
static std::string k##PREFIX##
NAME() {
return std::string(#PREFIX
"/" #NAME);} \
static TYPE
default##PREFIX##
NAME() {
return DEFAULT_VALUE;} \
static std::string type##PREFIX##
NAME() {
return std::string(#TYPE);} \
private: \
class Dummy##PREFIX##
NAME { \
public: \
Dummy##PREFIX##
NAME() {parameters_.insert(
ParametersPair(#PREFIX
"/" #NAME, #DEFAULT_VALUE)); \
descriptions_.insert(
ParametersPair(#PREFIX
"/" #NAME, DESCRIPTION));} \
}; \
Dummy##PREFIX##NAME dummy##PREFIX##NAME;
std::pair< std::string, std::string > ParametersPair
Macro used to create parameter's key and default value. This macro must be used only in the Parameters class definition (in this file). They are automatically added to the default parameters map of the class Parameters. Example:
1 //for PARAM(Video, ImageWidth, int, 640), the output will be :
3 static std::string kVideoImageWidth() {return std::string("Video/ImageWidth");}
4 static int defaultVideoImageWidth() {return 640;}
6 class DummyVideoImageWidth {
8 DummyVideoImageWidth() {parameters_.insert(ParametersPair("Video/ImageWidth", "640"));}
10 DummyVideoImageWidth dummyVideoImageWidth;
Definition at line 62 of file Parameters.h.
#define RTABMAP_PARAM_COND |
( |
|
PREFIX, |
|
|
|
NAME, |
|
|
|
TYPE, |
|
|
|
COND, |
|
|
|
DEFAULT_VALUE1, |
|
|
|
DEFAULT_VALUE2, |
|
|
|
DESCRIPTION |
|
) |
| |
Value:public: \
static std::string k##PREFIX##
NAME() {
return std::string(#PREFIX
"/" #NAME);} \
static TYPE
default##PREFIX##
NAME() {
return COND?DEFAULT_VALUE1:DEFAULT_VALUE2;} \
static std::string type##PREFIX##
NAME() {
return std::string(#TYPE);} \
private: \
class Dummy##PREFIX##
NAME { \
public: \
Dummy##PREFIX##
NAME() {parameters_.insert(
ParametersPair(#PREFIX
"/" #NAME, COND?#DEFAULT_VALUE1:#DEFAULT_VALUE2)); \
descriptions_.insert(
ParametersPair(#PREFIX
"/" #NAME, DESCRIPTION));} \
}; \
Dummy##PREFIX##NAME dummy##PREFIX##NAME;
std::pair< std::string, std::string > ParametersPair
Macro used to create parameter's key and default value. This macro must be used only in the Parameters class definition (in this file). They are automatically added to the default parameters map of the class Parameters. Example:
1 //for PARAM(Video, ImageWidth, int, 640), the output will be :
3 static std::string kVideoImageWidth() {return std::string("Video/ImageWidth");}
4 static int defaultVideoImageWidth() {return 640;}
6 class DummyVideoImageWidth {
8 DummyVideoImageWidth() {parameters_.insert(ParametersPair("Video/ImageWidth", "640"));}
10 DummyVideoImageWidth dummyVideoImageWidth;
Definition at line 129 of file Parameters.h.
#define RTABMAP_PARAM_STR |
( |
|
PREFIX, |
|
|
|
NAME, |
|
|
|
DEFAULT_VALUE, |
|
|
|
DESCRIPTION |
|
) |
| |
Value:public: \
static std::string k##PREFIX##
NAME() {
return std::string(#PREFIX
"/" #NAME);} \
static std::string
default##PREFIX##
NAME() {
return DEFAULT_VALUE;} \
static std::string type##PREFIX##
NAME() {
return std::string(
"string");} \
private: \
class Dummy##PREFIX##
NAME { \
public: \
Dummy##PREFIX##
NAME() {parameters_.insert(
ParametersPair(#PREFIX
"/" #NAME, DEFAULT_VALUE)); \
parametersType_.insert(
ParametersPair(#PREFIX
"/" #NAME,
"string")); \
descriptions_.insert(
ParametersPair(#PREFIX
"/" #NAME, DESCRIPTION));} \
}; \
Dummy##PREFIX##NAME dummy##PREFIX##NAME;
std::pair< std::string, std::string > ParametersPair
It's the same as the macro PARAM but it should be used for string parameters. Macro used to create parameter's key and default value. This macro must be used only in the Parameters class definition (in this file). They are automatically added to the default parameters map of the class Parameters. Example:
1 //for PARAM_STR(Video, TextFileName, "Hello_world"), the output will be :
3 static std::string kVideoFileName() {return std::string("Video/FileName");}
4 static std::string defaultVideoFileName() {return "Hello_world";}
6 class DummyVideoFileName {
8 DummyVideoFileName() {parameters_.insert(ParametersPair("Video/FileName", "Hello_world"));}
10 DummyVideoFileName dummyVideoFileName;
Definition at line 96 of file Parameters.h.