Apollo
6.0
Open source self driving car software
|
A Parameter
holds an apollo::cyber::proto::Param, It's more human-readable, you can use basic-value type and Protobuf values to construct a paramter. Parameter is identified by their name
, and you can get Parameter content by call value()
More...
#include <parameter.h>
Public Member Functions | |
Parameter () | |
Empty constructor. More... | |
Parameter (const Parameter ¶meter) | |
copy constructor More... | |
Parameter (const std::string &name) | |
construct with paramter's name More... | |
Parameter (const std::string &name, const bool bool_value) | |
construct with paramter's name and bool value type More... | |
Parameter (const std::string &name, const int int_value) | |
construct with paramter's name and int value type More... | |
Parameter (const std::string &name, const int64_t int_value) | |
construct with paramter's name and int value type More... | |
Parameter (const std::string &name, const float float_value) | |
construct with paramter's name and float value type More... | |
Parameter (const std::string &name, const double double_value) | |
construct with paramter's name and double value type More... | |
Parameter (const std::string &name, const std::string &string_value) | |
construct with paramter's name and string value type More... | |
Parameter (const std::string &name, const char *string_value) | |
construct with paramter's name and char* value type More... | |
Parameter (const std::string &name, const std::string &msg_str, const std::string &full_name, const std::string &proto_desc) | |
use a protobuf type value to construct the parameter More... | |
Parameter (const std::string &name, const google::protobuf::Message &msg) | |
use a google::protobuf::Message type value to construct the parameter More... | |
void | FromProtoParam (const Param ¶m) |
Parse a cyber::proto::Param object to cyber::parameter::Parameter object. More... | |
Param | ToProtoParam () const |
Parse a cyber::parameter::Parameter object to cyber::proto::Param object. More... | |
ParamType | Type () const |
Get the cyber:parameter::ParamType of this object. More... | |
std::string | TypeName () const |
Get Paramter's type name, i.e. INT,DOUBLE,STRING or protobuf message's fullname. More... | |
std::string | Descriptor () const |
Get Paramter's descriptor, only work on protobuf types. More... | |
const std::string | Name () const |
Get the Parameter name. More... | |
bool | AsBool () const |
Get Paramter as a bool value. More... | |
int64_t | AsInt64 () const |
Get Paramter as an int64_t value. More... | |
double | AsDouble () const |
et Paramter as a double value More... | |
const std::string | AsString () const |
Get Paramter as a string value. More... | |
std::string | DebugString () const |
show debug string More... | |
template<typename ValueType > | |
std::enable_if< std::is_base_of< google::protobuf::Message, ValueType >::value, ValueType >::type | value () const |
Translate paramter value as a protobuf::Message. More... | |
template<typename ValueType > | |
std::enable_if< std::is_integral< ValueType >::value &&!std::is_same< ValueType, bool >::value, ValueType >::type | value () const |
Translate paramter value to int type. More... | |
template<typename ValueType > | |
std::enable_if< std::is_floating_point< ValueType >::value, ValueType >::type | value () const |
Translate paramter value to bool type. More... | |
template<typename ValueType > | |
std::enable_if< std::is_convertible< ValueType, std::string >::value, const std::string & >::type | value () const |
Translate paramter value to string type. More... | |
template<typename ValueType > | |
std::enable_if< std::is_same< ValueType, bool >::value, bool >::type | value () const |
Translate paramter value to bool type. More... | |
A Parameter
holds an apollo::cyber::proto::Param, It's more human-readable, you can use basic-value type and Protobuf values to construct a paramter. Parameter is identified by their name
, and you can get Parameter content by call value()
apollo::cyber::Parameter::Parameter | ( | ) |
Empty constructor.
|
explicit |
copy constructor
|
explicit |
construct with paramter's name
name | Parameter name |
apollo::cyber::Parameter::Parameter | ( | const std::string & | name, |
const bool | bool_value | ||
) |
construct with paramter's name and bool value type
name | Parameter name |
bool_value | bool value |
apollo::cyber::Parameter::Parameter | ( | const std::string & | name, |
const int | int_value | ||
) |
construct with paramter's name and int value type
name | Parameter name |
int_value | int value |
apollo::cyber::Parameter::Parameter | ( | const std::string & | name, |
const int64_t | int_value | ||
) |
construct with paramter's name and int value type
name | Parameter name |
int_value | int value |
apollo::cyber::Parameter::Parameter | ( | const std::string & | name, |
const float | float_value | ||
) |
construct with paramter's name and float value type
name | Parameter name |
float_value | float value |
apollo::cyber::Parameter::Parameter | ( | const std::string & | name, |
const double | double_value | ||
) |
construct with paramter's name and double value type
name | Parameter name |
double_value | double value |
apollo::cyber::Parameter::Parameter | ( | const std::string & | name, |
const std::string & | string_value | ||
) |
construct with paramter's name and string value type
name | Parameter name |
string_value | string value |
apollo::cyber::Parameter::Parameter | ( | const std::string & | name, |
const char * | string_value | ||
) |
construct with paramter's name and char* value type
name | Parameter name |
string_value | char* value |
apollo::cyber::Parameter::Parameter | ( | const std::string & | name, |
const std::string & | msg_str, | ||
const std::string & | full_name, | ||
const std::string & | proto_desc | ||
) |
use a protobuf type value to construct the parameter
name | Parameter name |
msg_str | protobuf contents |
full_name | the proto full name |
proto_desc | the proto's description |
apollo::cyber::Parameter::Parameter | ( | const std::string & | name, |
const google::protobuf::Message & | msg | ||
) |
use a google::protobuf::Message type value to construct the parameter
name | Parameter name |
msg | protobuf message |
|
inline |
Get Paramter as a bool value.
|
inline |
et Paramter as a double value
|
inline |
Get Paramter as an int64_t value.
|
inline |
Get Paramter as a string value.
std::string apollo::cyber::Parameter::DebugString | ( | ) | const |
show debug string
|
inline |
Get Paramter's descriptor, only work on protobuf types.
void apollo::cyber::Parameter::FromProtoParam | ( | const Param & | param | ) |
Parse a cyber::proto::Param object to cyber::parameter::Parameter object.
param | The cyber::proto::Param object parse from A pointer to the target Parameter object |
|
inline |
Param apollo::cyber::Parameter::ToProtoParam | ( | ) | const |
Parse a cyber::parameter::Parameter object to cyber::proto::Param object.
|
inline |
Get the cyber:parameter::ParamType of this object.
|
inline |
Get Paramter's type name, i.e. INT,DOUBLE,STRING or protobuf message's fullname.
std::enable_if< std::is_same< ValueType, bool >::value, bool >::type apollo::cyber::Parameter::value | ( | ) | const |
Translate paramter value as a protobuf::Message.
ValueType | type of the value |
std::enable_if<std::is_integral<ValueType>::value && !std::is_same<ValueType, bool>::value, ValueType>::type apollo::cyber::Parameter::value | ( | ) | const |
Translate paramter value to int type.
ValueType | type of the value |
std::enable_if<std::is_floating_point<ValueType>::value, ValueType>::type apollo::cyber::Parameter::value | ( | ) | const |
Translate paramter value to bool type.
ValueType | type of the value |
std::enable_if<std::is_convertible<ValueType, std::string>::value, const std::string&>::type apollo::cyber::Parameter::value | ( | ) | const |
Translate paramter value to string type.
ValueType | type of the value |
std::enable_if<std::is_same<ValueType, bool>::value, bool>::type apollo::cyber::Parameter::value | ( | ) | const |
Translate paramter value to bool type.
ValueType | type of the value |