TraveSim Adapters
0.1
Protobuf adapters for TraveSim project
teams_configurer.hpp
Go to the documentation of this file.
1
/**
2
* @file teams_configurer.hpp
3
*
4
* @author Lucas Haug <lucas.haug@thuneratz.org>
5
*
6
* @brief Configurer for the teams
7
*
8
* @date 06/2021
9
*
10
* @copyright MIT License - Copyright (c) 2021 ThundeRatz
11
*
12
*/
13
14
#include <iostream>
15
16
#include <travesim_adapters/TeamsConfig.h>
17
18
#include "
travesim_adapters/configurers/adapter_configurer.hpp
"
19
20
#ifndef __TEAMS_CONFIGURER_H__
21
#define __TEAMS_CONFIGURER_H__
22
23
namespace
travesim
{
24
/**
25
* @brief TeamsConfigurer class definition
26
*/
27
28
class
TeamsConfigurer
:
29
public
AdapterConfigurer
<travesim_adapters::TeamsConfig> {
30
public
:
31
/**
32
* @brief Team color enumeration type
33
*/
34
enum
TeamColor
{
35
YELLOW
,
36
BLUE
37
};
38
39
/**
40
* @brief Construct a new TeamsConfigurer object
41
*/
42
TeamsConfigurer
(
void
);
43
44
/**
45
* @brief Get the configured address of a team
46
*
47
* @param color Color of the team to get the address
48
*
49
* @return std::string address string
50
*/
51
std::string
get_address
(
TeamColor
color);
52
53
/**
54
* @brief Get the configured port of a team
55
*
56
* @param color Color of the team to get the port
57
*
58
* @return uint16_t port number
59
*/
60
uint16_t
get_port
(
TeamColor
color);
61
62
/**
63
* @brief Get the specific_source config
64
*
65
* @return true if specific source is enabled, false otherwise
66
*/
67
bool
get_specific_source
(
void
);
68
69
/**
70
* @brief Output stream operator overloading
71
*/
72
friend
std::ostream&
operator <<
(std::ostream& output,
const
TeamsConfigurer
& teams_conf);
73
};
74
}
// namespace travesim
75
76
#endif // __TEAMS_CONFIGURER_H__
travesim::TeamsConfigurer::get_specific_source
bool get_specific_source(void)
Get the specific_source config.
Definition:
teams_configurer.cpp:64
travesim::TeamsConfigurer::TeamsConfigurer
TeamsConfigurer(void)
Construct a new TeamsConfigurer object.
Definition:
teams_configurer.cpp:28
travesim::TeamsConfigurer::YELLOW
Definition:
teams_configurer.hpp:35
travesim::TeamsConfigurer::BLUE
Definition:
teams_configurer.hpp:36
travesim::TeamsConfigurer::get_port
uint16_t get_port(TeamColor color)
Get the configured port of a team.
Definition:
teams_configurer.cpp:54
travesim::TeamsConfigurer
TeamsConfigurer class definition.
Definition:
teams_configurer.hpp:28
travesim
Definition:
adapter_configurer.hpp:29
travesim::TeamsConfigurer::TeamColor
TeamColor
Team color enumeration type.
Definition:
teams_configurer.hpp:34
travesim::TeamsConfigurer::operator<<
friend std::ostream & operator<<(std::ostream &output, const TeamsConfigurer &teams_conf)
Output stream operator overloading.
Definition:
teams_configurer.cpp:69
adapter_configurer.hpp
Template configurer for an adapter.
travesim::TeamsConfigurer::get_address
std::string get_address(TeamColor color)
Get the configured address of a team.
Definition:
teams_configurer.cpp:32
travesim::AdapterConfigurer
Definition:
adapter_configurer.hpp:35
include
travesim_adapters
configurers
teams_configurer.hpp
Generated on Tue Jul 20 2021 14:16:27 for TraveSim Adapters by
1.8.15