TraveSim Adapters  0.1
Protobuf adapters for TraveSim project
travesim::ReplacerConfigurer Class Reference

ReplacerConfigurer class definition. More...

#include "replacer_configurer.hpp"

Inheritance diagram for travesim::ReplacerConfigurer:
Collaboration diagram for travesim::ReplacerConfigurer:

Public Member Functions

 ReplacerConfigurer (void)
 Construct a new ReplacerConfigurer object. More...
 
std::string get_address (void)
 Get the replacer configured address. More...
 
uint16_t get_port (void)
 Get the replacer configured port. More...
 
bool get_specific_source (void)
 Get the specific_source config. More...
 
- Public Member Functions inherited from travesim::AdapterConfigurer< travesim_adapters::ReplacerConfig >
 AdapterConfigurer (void)
 Construct a new AdapterConfigurer object. More...
 
 AdapterConfigurer (std::string config_namespace)
 Construct a new AdapterConfigurer object. More...
 
bool get_reset (void)
 Get the reset config. More...
 

Friends

std::ostream & operator<< (std::ostream &output, const ReplacerConfigurer &repl_conf)
 Output stream operator overloading. More...
 

Additional Inherited Members

- Protected Attributes inherited from travesim::AdapterConfigurer< travesim_adapters::ReplacerConfig >
bool reconfigured
 
travesim_adapters::ReplacerConfig config
 
boost::recursive_mutex mutex
 

Detailed Description

ReplacerConfigurer class definition.

Definition at line 28 of file replacer_configurer.hpp.

Constructor & Destructor Documentation

◆ ReplacerConfigurer()

travesim::ReplacerConfigurer::ReplacerConfigurer ( void  )

Construct a new ReplacerConfigurer object.

Definition at line 28 of file replacer_configurer.cpp.

30 }
#define REPLACER_CONFIGURER_NAMESPACE
AdapterConfigurer(void)
Construct a new AdapterConfigurer object.

Member Function Documentation

◆ get_address()

std::string travesim::ReplacerConfigurer::get_address ( void  )

Get the replacer configured address.

Returns
std::string address string

Definition at line 32 of file replacer_configurer.cpp.

32  {
33  boost::recursive_mutex::scoped_lock scoped_lock(this->mutex);
34 
35  std::string address = this->config.replacer_address;
36 
38 
39  if (validation == IPValidation::VALID) {
40  return address;
41  } else {
42  ROS_ERROR_STREAM(get_error_msg(validation));
43 
44  return INVALID_ADDRESS;
45  }
46 }
IPValidation
Type used to validate a IP string.
std::string get_error_msg(IPValidation error)
Get the error msg based on the validation type.
IPValidation check_valid_ip(std::string ip, std::string min_ip, std::string max_ip)
Checks if a IP is valid and is in the specified range.
#define MIN_UNICAST_ADDRESS
#define MAX_UNICAST_ADDRESS
#define INVALID_ADDRESS

References travesim::check_valid_ip(), travesim::AdapterConfigurer< travesim_adapters::ReplacerConfig >::config, travesim::get_error_msg(), INVALID_ADDRESS, MAX_UNICAST_ADDRESS, MIN_UNICAST_ADDRESS, travesim::AdapterConfigurer< travesim_adapters::ReplacerConfig >::mutex, and travesim::VALID.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_port()

uint16_t travesim::ReplacerConfigurer::get_port ( void  )

Get the replacer configured port.

Returns
uint16_t port number

Definition at line 48 of file replacer_configurer.cpp.

48  {
49  boost::recursive_mutex::scoped_lock scoped_lock(this->mutex);
50  return this->config.replacer_port;
51 }

References travesim::AdapterConfigurer< travesim_adapters::ReplacerConfig >::config, and travesim::AdapterConfigurer< travesim_adapters::ReplacerConfig >::mutex.

Here is the caller graph for this function:

◆ get_specific_source()

bool travesim::ReplacerConfigurer::get_specific_source ( void  )

Get the specific_source config.

Returns
true if specific source is enabled, false otherwise

Definition at line 53 of file replacer_configurer.cpp.

53  {
54  boost::recursive_mutex::scoped_lock scoped_lock(this->mutex);
55  return this->config.specific_source;
56 }

References travesim::AdapterConfigurer< travesim_adapters::ReplacerConfig >::config, and travesim::AdapterConfigurer< travesim_adapters::ReplacerConfig >::mutex.

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  output,
const ReplacerConfigurer repl_conf 
)
friend

Output stream operator overloading.

Definition at line 58 of file replacer_configurer.cpp.

58  {
59  output << "Replacer Endpoint: " << repl_conf.config.replacer_address;
60  output << ":" << repl_conf.config.replacer_port << std::endl;
61  output << "Specific Source: " << (repl_conf.config.specific_source ? "True" : "False") << std::endl;
62  output << "Reset: " << ((repl_conf.config.reset || repl_conf.reconfigured) ? "True" : "False") << std::endl;
63 
64  return output;
65 }

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