Addressed issues found by Google code lint.
Fixed: - Removed trailing whitespace. - Removed out of date TODO's. - Added #include<algorithm> to DataManager.cpp - Reordered includes to include C system headers before C++ system headers. - Added username to TODO's - Renamed include guards to use full project name as prefix. - Made methods and parameters const where possible. - Made UDPSocket constructor explicit. Won't Fix: - snprintf is introduced in C++11. - Trailing comments at the end of namespace & header guards - Did not re-inlude headers already included by the matching XPC header. - localtime is fine since X-Plane is not multithreaded at all on the plugin side. - Linter confuses #elif with parens as a function call. - namespace indentation
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
|
||||
//National Aeronautics and Space Administration. All Rights Reserved.
|
||||
#ifndef XPC_MESSAGE_H
|
||||
#define XPC_MESSAGE_H
|
||||
#ifndef XPCPLUGIN_MESSAGE_H_
|
||||
#define XPCPLUGIN_MESSAGE_H_
|
||||
|
||||
#include "UDPSocket.h"
|
||||
|
||||
@@ -24,25 +24,25 @@ namespace XPC
|
||||
/// \returns A message parsed from the data read from sock. If no
|
||||
/// data was read or an error occurs, returns a message
|
||||
/// with the size set to 0.
|
||||
static Message ReadFrom(UDPSocket& sock);
|
||||
static Message ReadFrom(const UDPSocket& sock);
|
||||
|
||||
/// Gets the message header in binary form.
|
||||
unsigned long GetMagicNumber();
|
||||
unsigned long GetMagicNumber() const;
|
||||
|
||||
/// Gets the message header.
|
||||
std::string GetHead();
|
||||
std::string GetHead() const;
|
||||
|
||||
/// Gets the buffer underlying the message.
|
||||
const unsigned char* GetBuffer();
|
||||
const unsigned char* GetBuffer() const;
|
||||
|
||||
/// Gets the size of the message in bytes.
|
||||
std::size_t GetSize();
|
||||
std::size_t GetSize() const;
|
||||
|
||||
/// Gets the address this message was read from.
|
||||
struct sockaddr GetSource();
|
||||
struct sockaddr GetSource() const;
|
||||
|
||||
/// Prints the contents of the message to the XPC log.
|
||||
void PrintToLog();
|
||||
void PrintToLog() const;
|
||||
|
||||
private:
|
||||
Message();
|
||||
|
||||
Reference in New Issue
Block a user