@@ -43,7 +43,7 @@ namespace Comms
4343
4444/* * See header for documentation. */
4545CommsModule::CommsModule (
46- const std::string& domain_address
46+ const std::string& domainAddress
4747) {
4848 sockfd = socket (AF_UNIX, SOCK_STREAM, 0 );
4949 if (sockfd < 0 )
@@ -52,17 +52,17 @@ CommsModule::CommsModule(
5252 return ;
5353 }
5454
55- struct sockaddr_un serv_addr {};
56- serv_addr .sun_family = AF_UNIX;
55+ struct sockaddr_un servAddr {};
56+ servAddr .sun_family = AF_UNIX;
5757
5858 // Copy the domain address, inserting leading NUL needed for abstract UDS
59- std::strcpy (serv_addr .sun_path + 1 , domain_address .c_str ());
60- serv_addr .sun_path [0 ] = ' \0 ' ;
59+ std::strcpy (servAddr .sun_path + 1 , domainAddress .c_str ());
60+ servAddr .sun_path [0 ] = ' \0 ' ;
6161
6262 int conn = connect (
6363 sockfd,
64- reinterpret_cast <const struct sockaddr *>(&serv_addr ),
65- sizeof (serv_addr ));
64+ reinterpret_cast <const struct sockaddr *>(&servAddr ),
65+ sizeof (servAddr ));
6666 if (conn != 0 )
6767 {
6868 std::cout << " - ERROR: Client connection failed" << std::endl;
@@ -77,7 +77,7 @@ CommsModule::CommsModule(
7777
7878/* * See header for documentation. */
7979CommsModule::CommsModule (
80- const std::string& host_address ,
80+ const std::string& hostAddress ,
8181 int port
8282) {
8383 sockfd = socket (AF_INET, SOCK_STREAM, 0 );
@@ -87,15 +87,15 @@ CommsModule::CommsModule(
8787 return ;
8888 }
8989
90- struct sockaddr_in serv_addr {};
91- serv_addr .sin_family = AF_INET;
92- serv_addr .sin_port = htons (port);
93- serv_addr .sin_addr .s_addr = inet_addr (host_address .c_str ());
90+ struct sockaddr_in servAddr {};
91+ servAddr .sin_family = AF_INET;
92+ servAddr .sin_port = htons (port);
93+ servAddr .sin_addr .s_addr = inet_addr (hostAddress .c_str ());
9494
9595 int conn = connect (
9696 sockfd,
97- reinterpret_cast <const struct sockaddr *>(&serv_addr ),
98- sizeof (serv_addr ));
97+ reinterpret_cast <const struct sockaddr *>(&servAddr ),
98+ sizeof (servAddr ));
9999 if (conn != 0 )
100100 {
101101 std::cout << " - ERROR: Client connection failed" << std::endl;
@@ -132,21 +132,21 @@ CommsModule::~CommsModule()
132132}
133133
134134/* * See header for documentation. */
135- bool CommsModule::is_connected ()
135+ bool CommsModule::isConnected ()
136136{
137137 return sockfd >= 0 ;
138138}
139139
140140/* * See header for documentation. */
141- EndpointID CommsModule::get_endpoint_id (
141+ EndpointID CommsModule::getEndpointID (
142142 const std::string& name
143143) {
144- std::lock_guard<std::mutex> lock (registry_lock );
144+ std::lock_guard<std::mutex> lock (registryLock );
145145 if (registry.empty ())
146146 {
147147 // Request the registry from the host
148148 auto data = std::make_unique<std::vector<uint8_t >>();
149- auto resp = tx_rx (0 , std::move (data));
149+ auto resp = txRx (0 , std::move (data));
150150
151151 // Process the response
152152 while (resp->size ())
@@ -192,7 +192,7 @@ EndpointID CommsModule::get_endpoint_id(
192192}
193193
194194/* * See header for documentation. */
195- void CommsModule::tx_async (
195+ void CommsModule::txAsync (
196196 EndpointID endpoint,
197197 std::unique_ptr<MessageData> data
198198) {
@@ -202,7 +202,7 @@ void CommsModule::tx_async(
202202 0 ,
203203 std::move (data));
204204
205- enqueue_message (std::move (message));
205+ enqueueMessage (std::move (message));
206206}
207207
208208/* * See header for documentation. */
@@ -216,44 +216,44 @@ void CommsModule::tx(
216216 0 ,
217217 std::move (data));
218218
219- enqueue_message (message);
219+ enqueueMessage (message);
220220 message->wait ();
221221}
222222
223223/* * See header for documentation. */
224- std::unique_ptr<MessageData> CommsModule::tx_rx (
224+ std::unique_ptr<MessageData> CommsModule::txRx (
225225 EndpointID endpoint,
226226 std::unique_ptr<MessageData> data
227227) {
228228 auto message = std::make_shared<Message>(
229229 endpoint,
230230 MessageType::TX_RX,
231- assign_message_id (),
231+ assignMessageID (),
232232 std::move (data));
233233
234- enqueue_message (message);
234+ enqueueMessage (message);
235235 message->wait ();
236236
237- return std::move (message->response_data );
237+ return std::move (message->responseData );
238238}
239239
240240/* * See header for documentation. */
241- MessageID CommsModule::assign_message_id ()
241+ MessageID CommsModule::assignMessageID ()
242242{
243- return next_message_id .fetch_add (1 , std::memory_order_relaxed);
243+ return nextMessageID .fetch_add (1 , std::memory_order_relaxed);
244244}
245245
246246/* * See header for documentation. */
247- void CommsModule::enqueue_message (
247+ void CommsModule::enqueueMessage (
248248 std::shared_ptr<Message> message
249249) {
250- message_queue .put (std::move (message));
250+ messageQueue .put (std::move (message));
251251}
252252
253253/* * See header for documentation. */
254- std::shared_ptr<Message> CommsModule::dequeue_message ()
254+ std::shared_ptr<Message> CommsModule::dequeueMessage ()
255255{
256- return message_queue .get ();
256+ return messageQueue .get ();
257257}
258258
259259}
0 commit comments