WIP
This commit is contained in:
parent
45b686a028
commit
2ca9eb4204
@ -480,7 +480,46 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
set(FSFW_WARNING_FLAGS -Wall -Wno-gnu-anonymous-struct)
|
set(FSFW_WARNING_FLAGS
|
||||||
|
-Weverything
|
||||||
|
|
||||||
|
-Wno-gnu-anonymous-struct
|
||||||
|
-Wno-c++98-compat
|
||||||
|
-Wno-c++98-compat-pedantic
|
||||||
|
-Wno-covered-switch-default
|
||||||
|
-Wno-padded
|
||||||
|
-Wno-documentation
|
||||||
|
-Wno-weak-vtables
|
||||||
|
-Wno-c++98-c++11-compat-binary-literal
|
||||||
|
-Wno-documentation-unknown-command
|
||||||
|
-Wno-reserved-macro-identifier
|
||||||
|
-Wno-global-constructors
|
||||||
|
-Wno-reserved-identifier
|
||||||
|
-Wno-switch-enum
|
||||||
|
|
||||||
|
-Werror
|
||||||
|
#WTH?
|
||||||
|
-Wno-ctad-maybe-unsupported
|
||||||
|
#WIP
|
||||||
|
-Wno-undefined-func-template
|
||||||
|
-Wno-suggest-destructor-override
|
||||||
|
-Wno-suggest-override
|
||||||
|
-Wno-inconsistent-missing-destructor-override
|
||||||
|
-Wno-extra-semi
|
||||||
|
#could be useful:
|
||||||
|
-Wno-sign-conversion
|
||||||
|
-Wno-implicit-int-conversion
|
||||||
|
-Wno-shorten-64-to-32
|
||||||
|
-Wno-double-promotion
|
||||||
|
-Wno-float-conversion
|
||||||
|
-Wno-implicit-int-float-conversion
|
||||||
|
-Wno-implicit-float-conversion
|
||||||
|
-Wno-shadow-field-in-constructor
|
||||||
|
-Wno-shadow-field
|
||||||
|
-Wno-shadow
|
||||||
|
-Wno-unused-parameter
|
||||||
|
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Required include paths to compile the FSFW
|
# Required include paths to compile the FSFW
|
||||||
|
@ -68,6 +68,7 @@ class UserBase {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit UserBase(HasFileSystemIF& vfs);
|
explicit UserBase(HasFileSystemIF& vfs);
|
||||||
|
virtual ~UserBase() = default;
|
||||||
|
|
||||||
virtual void transactionIndication(const TransactionId& id) = 0;
|
virtual void transactionIndication(const TransactionId& id) = 0;
|
||||||
virtual void eofSentIndication(const TransactionId& id) = 0;
|
virtual void eofSentIndication(const TransactionId& id) = 0;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "helpers.h"
|
#include "helpers.h"
|
||||||
|
|
||||||
const char* COND_CODE_STRINGS[14] = {"Unknown",
|
static const char* COND_CODE_STRINGS[14] = {"Unknown",
|
||||||
"No Error",
|
"No Error",
|
||||||
"Positive ACK Limit Reached",
|
"Positive ACK Limit Reached",
|
||||||
"Keep Alive Limit Reached",
|
"Keep Alive Limit Reached",
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
template <typename Tp>
|
template <typename Tp>
|
||||||
class BinaryNode {
|
class BinaryNode {
|
||||||
public:
|
public:
|
||||||
BinaryNode(Tp* setValue) : value(setValue), left(NULL), right(NULL), parent(NULL) {}
|
BinaryNode(Tp* setValue) : value(setValue), left(nullptr), right(nullptr), parent(nullptr) {}
|
||||||
Tp* value;
|
Tp* value;
|
||||||
BinaryNode* left;
|
BinaryNode* left;
|
||||||
BinaryNode* right;
|
BinaryNode* right;
|
||||||
@ -23,31 +23,31 @@ class ExplicitNodeIterator {
|
|||||||
typedef Tp value_type;
|
typedef Tp value_type;
|
||||||
typedef Tp* pointer;
|
typedef Tp* pointer;
|
||||||
typedef Tp& reference;
|
typedef Tp& reference;
|
||||||
ExplicitNodeIterator() : element(NULL) {}
|
ExplicitNodeIterator() : element(nullptr) {}
|
||||||
ExplicitNodeIterator(_Node* node) : element(node) {}
|
ExplicitNodeIterator(_Node* node) : element(node) {}
|
||||||
BinaryNode<Tp>* element;
|
BinaryNode<Tp>* element;
|
||||||
_Self up() { return _Self(element->parent); }
|
_Self up() { return _Self(element->parent); }
|
||||||
_Self left() {
|
_Self left() {
|
||||||
if (element != NULL) {
|
if (element != nullptr) {
|
||||||
return _Self(element->left);
|
return _Self(element->left);
|
||||||
} else {
|
} else {
|
||||||
return _Self(NULL);
|
return _Self(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_Self right() {
|
_Self right() {
|
||||||
if (element != NULL) {
|
if (element != nullptr) {
|
||||||
return _Self(element->right);
|
return _Self(element->right);
|
||||||
} else {
|
} else {
|
||||||
return _Self(NULL);
|
return _Self(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool operator==(const _Self& __x) const { return element == __x.element; }
|
bool operator==(const _Self& __x) const { return element == __x.element; }
|
||||||
bool operator!=(const _Self& __x) const { return element != __x.element; }
|
bool operator!=(const _Self& __x) const { return element != __x.element; }
|
||||||
pointer operator->() const {
|
pointer operator->() const {
|
||||||
if (element != NULL) {
|
if (element != nullptr) {
|
||||||
return element->value;
|
return element->value;
|
||||||
} else {
|
} else {
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pointer operator*() const { return this->operator->(); }
|
pointer operator*() const { return this->operator->(); }
|
||||||
@ -62,13 +62,13 @@ class BinaryTree {
|
|||||||
typedef ExplicitNodeIterator<Tp> iterator;
|
typedef ExplicitNodeIterator<Tp> iterator;
|
||||||
typedef BinaryNode<Tp> Node;
|
typedef BinaryNode<Tp> Node;
|
||||||
typedef std::pair<iterator, iterator> children;
|
typedef std::pair<iterator, iterator> children;
|
||||||
BinaryTree() : rootNode(NULL) {}
|
BinaryTree() : rootNode(nullptr) {}
|
||||||
BinaryTree(Node* rootNode) : rootNode(rootNode) {}
|
BinaryTree(Node* rootNode) : rootNode(rootNode) {}
|
||||||
iterator begin() const { return iterator(rootNode); }
|
iterator begin() const { return iterator(rootNode); }
|
||||||
static iterator end() { return iterator(NULL); }
|
static iterator end() { return iterator(nullptr); }
|
||||||
iterator insert(bool insertLeft, iterator parentNode, Node* newNode) {
|
iterator insert(bool insertLeft, iterator parentNode, Node* newNode) {
|
||||||
newNode->parent = parentNode.element;
|
newNode->parent = parentNode.element;
|
||||||
if (parentNode.element != NULL) {
|
if (parentNode.element != nullptr) {
|
||||||
if (insertLeft) {
|
if (insertLeft) {
|
||||||
parentNode.element->left = newNode;
|
parentNode.element->left = newNode;
|
||||||
} else {
|
} else {
|
||||||
@ -84,13 +84,13 @@ class BinaryTree {
|
|||||||
children erase(iterator node) {
|
children erase(iterator node) {
|
||||||
if (node.element == rootNode) {
|
if (node.element == rootNode) {
|
||||||
// We're root node
|
// We're root node
|
||||||
rootNode = NULL;
|
rootNode = nullptr;
|
||||||
} else {
|
} else {
|
||||||
// Delete parent's reference
|
// Delete parent's reference
|
||||||
if (node.up().left() == node) {
|
if (node.up().left() == node) {
|
||||||
node.up().element->left = NULL;
|
node.up().element->left = nullptr;
|
||||||
} else {
|
} else {
|
||||||
node.up().element->right = NULL;
|
node.up().element->right = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return children(node.element->left, node.element->right);
|
return children(node.element->left, node.element->right);
|
||||||
|
@ -61,7 +61,7 @@ class PlacementFactory {
|
|||||||
// Need to call destructor first, in case something was allocated by the object (shouldn't do
|
// Need to call destructor first, in case something was allocated by the object (shouldn't do
|
||||||
// that, however).
|
// that, however).
|
||||||
thisElement->~T();
|
thisElement->~T();
|
||||||
uint8_t* pointer = (uint8_t*)(thisElement);
|
uint8_t* pointer = static_cast<uint8_t*>(thisElement);
|
||||||
return dataBackend->deleteData(pointer, sizeof(T));
|
return dataBackend->deleteData(pointer, sizeof(T));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +286,6 @@ ReturnValue_t LocalDataPoolManager::addUpdateToStore(HousekeepingSnapshot& updat
|
|||||||
result = updatePacket.serialize(&storePtr, &serializedSize, updatePacketSize,
|
result = updatePacket.serialize(&storePtr, &serializedSize, updatePacketSize,
|
||||||
SerializeIF::Endianness::MACHINE);
|
SerializeIF::Endianness::MACHINE);
|
||||||
return result;
|
return result;
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalDataPoolManager::handleChangeResetLogic(DataType type, DataId dataId,
|
void LocalDataPoolManager::handleChangeResetLogic(DataType type, DataId dataId,
|
||||||
|
@ -27,7 +27,7 @@ ReturnValue_t ChildHandlerBase::initialize() {
|
|||||||
|
|
||||||
if (parentId != objects::NO_OBJECT) {
|
if (parentId != objects::NO_OBJECT) {
|
||||||
SubsystemBase* parent = ObjectManager::instance()->get<SubsystemBase>(parentId);
|
SubsystemBase* parent = ObjectManager::instance()->get<SubsystemBase>(parentId);
|
||||||
if (parent == NULL) {
|
if (parent == nullptr) {
|
||||||
return returnvalue::FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
parentQueue = parent->getCommandQueue();
|
parentQueue = parent->getCommandQueue();
|
||||||
|
@ -934,19 +934,14 @@ DeviceHandlerIF::CommunicationAction DeviceHandlerBase::getComAction() {
|
|||||||
switch (pstStep) {
|
switch (pstStep) {
|
||||||
case 0:
|
case 0:
|
||||||
return CommunicationAction::PERFORM_OPERATION;
|
return CommunicationAction::PERFORM_OPERATION;
|
||||||
break;
|
|
||||||
case 1:
|
case 1:
|
||||||
return CommunicationAction::SEND_WRITE;
|
return CommunicationAction::SEND_WRITE;
|
||||||
break;
|
|
||||||
case 2:
|
case 2:
|
||||||
return CommunicationAction::GET_WRITE;
|
return CommunicationAction::GET_WRITE;
|
||||||
break;
|
|
||||||
case 3:
|
case 3:
|
||||||
return CommunicationAction::SEND_READ;
|
return CommunicationAction::SEND_READ;
|
||||||
break;
|
|
||||||
case 4:
|
case 4:
|
||||||
return CommunicationAction::GET_READ;
|
return CommunicationAction::GET_READ;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -962,7 +957,7 @@ void DeviceHandlerBase::buildRawDeviceCommand(CommandMessage* commandMessage) {
|
|||||||
replyReturnvalueToCommand(result, RAW_COMMAND_ID);
|
replyReturnvalueToCommand(result, RAW_COMMAND_ID);
|
||||||
storedRawData.raw = StorageManagerIF::INVALID_ADDRESS;
|
storedRawData.raw = StorageManagerIF::INVALID_ADDRESS;
|
||||||
} else {
|
} else {
|
||||||
cookieInfo.pendingCommand = deviceCommandMap.find((DeviceCommandId_t)RAW_COMMAND_ID);
|
cookieInfo.pendingCommand = deviceCommandMap.find(static_cast<DeviceCommandId_t>(RAW_COMMAND_ID));
|
||||||
cookieInfo.pendingCommand->second.isExecuting = true;
|
cookieInfo.pendingCommand->second.isExecuting = true;
|
||||||
cookieInfo.state = COOKIE_WRITE_READY;
|
cookieInfo.state = COOKIE_WRITE_READY;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +72,7 @@ void DeviceHandlerMessage::clear(CommandMessage* message) {
|
|||||||
ipcStore->deleteData(getStoreAddress(message));
|
ipcStore->deleteData(getStoreAddress(message));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* NO BREAK falls through*/
|
[[fallthrough]];
|
||||||
case CMD_SWITCH_ADDRESS:
|
case CMD_SWITCH_ADDRESS:
|
||||||
case CMD_WIRETAPPING:
|
case CMD_WIRETAPPING:
|
||||||
message->setCommand(CommandMessage::CMD_NONE);
|
message->setCommand(CommandMessage::CMD_NONE);
|
||||||
|
@ -48,7 +48,7 @@ class CommandMessage : public MessageQueueMessage, public CommandMessageIF {
|
|||||||
/**
|
/**
|
||||||
* @brief Default Destructor
|
* @brief Default Destructor
|
||||||
*/
|
*/
|
||||||
virtual ~CommandMessage() {}
|
~CommandMessage() override {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read the DeviceHandlerCommand_t that is stored in the message,
|
* Read the DeviceHandlerCommand_t that is stored in the message,
|
||||||
|
@ -37,7 +37,7 @@ class CommandMessageIF {
|
|||||||
//! par1 should contain the error code
|
//! par1 should contain the error code
|
||||||
static const Command_t REPLY_REJECTED = MAKE_COMMAND_ID(2);
|
static const Command_t REPLY_REJECTED = MAKE_COMMAND_ID(2);
|
||||||
|
|
||||||
virtual ~CommandMessageIF(){};
|
virtual ~CommandMessageIF() = default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A command message shall have a uint16_t command ID field.
|
* A command message shall have a uint16_t command ID field.
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include <fsfw/objectmanager/frameworkObjects.h>
|
#include <fsfw/objectmanager/frameworkObjects.h>
|
||||||
|
|
||||||
struct MqArgs {
|
struct MqArgs {
|
||||||
MqArgs(){};
|
MqArgs(){}
|
||||||
MqArgs(object_id_t objectId, void* args = nullptr) : objectId(objectId), args(args) {}
|
MqArgs(object_id_t objectId, void* args = nullptr) : objectId(objectId), args(args) {}
|
||||||
object_id_t objectId = objects::NO_OBJECT;
|
object_id_t objectId = objects::NO_OBJECT;
|
||||||
void* args = nullptr;
|
void* args = nullptr;
|
||||||
|
@ -40,7 +40,7 @@ class ObjectManagerIF {
|
|||||||
/**
|
/**
|
||||||
* @brief This is the empty virtual destructor as requested by C++ interfaces.
|
* @brief This is the empty virtual destructor as requested by C++ interfaces.
|
||||||
*/
|
*/
|
||||||
virtual ~ObjectManagerIF(void){};
|
virtual ~ObjectManagerIF(void){}
|
||||||
/**
|
/**
|
||||||
* @brief With this call, new objects are inserted to the list.
|
* @brief With this call, new objects are inserted to the list.
|
||||||
* @details The implementation shall return an error code in case the
|
* @details The implementation shall return an error code in case the
|
||||||
|
@ -45,7 +45,7 @@ class SystemObject : public SystemObjectIF {
|
|||||||
/**
|
/**
|
||||||
* @brief On destruction, the object removes itself from the list.
|
* @brief On destruction, the object removes itself from the list.
|
||||||
*/
|
*/
|
||||||
virtual ~SystemObject();
|
~SystemObject() override;
|
||||||
object_id_t getObjectId() const override;
|
object_id_t getObjectId() const override;
|
||||||
virtual ReturnValue_t initialize() override;
|
virtual ReturnValue_t initialize() override;
|
||||||
virtual ReturnValue_t checkObjectConnections() override;
|
virtual ReturnValue_t checkObjectConnections() override;
|
||||||
|
@ -36,7 +36,7 @@ class SystemObjectIF : public EventReportingProxyIF {
|
|||||||
/**
|
/**
|
||||||
* The empty virtual destructor as required for C++ interfaces.
|
* The empty virtual destructor as required for C++ interfaces.
|
||||||
*/
|
*/
|
||||||
virtual ~SystemObjectIF() {}
|
~SystemObjectIF() override {}
|
||||||
/**
|
/**
|
||||||
* @brief Initializes the object.
|
* @brief Initializes the object.
|
||||||
* There are initialization steps which can also be done in the constructor.
|
* There are initialization steps which can also be done in the constructor.
|
||||||
|
@ -20,9 +20,6 @@ SerialBufferAdapter<count_t>::SerialBufferAdapter(uint8_t* buffer, count_t buffe
|
|||||||
buffer(buffer),
|
buffer(buffer),
|
||||||
bufferLength(bufferLength) {}
|
bufferLength(bufferLength) {}
|
||||||
|
|
||||||
template <typename count_t>
|
|
||||||
SerialBufferAdapter<count_t>::~SerialBufferAdapter() = default;
|
|
||||||
|
|
||||||
template <typename count_t>
|
template <typename count_t>
|
||||||
ReturnValue_t SerialBufferAdapter<count_t>::serialize(uint8_t** buffer_, size_t* size,
|
ReturnValue_t SerialBufferAdapter<count_t>::serialize(uint8_t** buffer_, size_t* size,
|
||||||
size_t maxSize,
|
size_t maxSize,
|
||||||
|
@ -41,7 +41,7 @@ class SerialBufferAdapter : public SerializeIF {
|
|||||||
*/
|
*/
|
||||||
SerialBufferAdapter(uint8_t* buffer, count_t bufferLength, bool serializeLength = false);
|
SerialBufferAdapter(uint8_t* buffer, count_t bufferLength, bool serializeLength = false);
|
||||||
|
|
||||||
~SerialBufferAdapter() override;
|
~SerialBufferAdapter() override = default;
|
||||||
|
|
||||||
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
|
ReturnValue_t serialize(uint8_t** buffer, size_t* size, size_t maxSize,
|
||||||
Endianness streamEndianness) const override;
|
Endianness streamEndianness) const override;
|
||||||
@ -74,4 +74,10 @@ class SerialBufferAdapter : public SerializeIF {
|
|||||||
count_t bufferLength = 0;
|
count_t bufferLength = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// declaration of explicit instantiations (which are in the cpp)
|
||||||
|
extern template class SerialBufferAdapter<uint8_t>;
|
||||||
|
extern template class SerialBufferAdapter<uint16_t>;
|
||||||
|
extern template class SerialBufferAdapter<uint32_t>;
|
||||||
|
extern template class SerialBufferAdapter<uint64_t>;
|
||||||
|
|
||||||
#endif /* SERIALBUFFERADAPTER_H_ */
|
#endif /* SERIALBUFFERADAPTER_H_ */
|
||||||
|
@ -35,6 +35,12 @@ class SerializeIF {
|
|||||||
MAKE_RETURN_CODE(3); // !< There are too many elements to be deserialized
|
MAKE_RETURN_CODE(3); // !< There are too many elements to be deserialized
|
||||||
|
|
||||||
virtual ~SerializeIF() = default;
|
virtual ~SerializeIF() = default;
|
||||||
|
// C++11 deprecates automatic generation of copy ctor and assignment operator when
|
||||||
|
// a destructor is defined, so we need to explicitely set them to default
|
||||||
|
SerializeIF(const SerializeIF&) = default;
|
||||||
|
SerializeIF() = default;
|
||||||
|
SerializeIF& operator= ( const SerializeIF & ) = default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
* Function to serialize the object into a buffer with maxSize. Size represents the written
|
* Function to serialize the object into a buffer with maxSize. Size represents the written
|
||||||
|
@ -22,7 +22,7 @@ union store_address_t {
|
|||||||
*/
|
*/
|
||||||
explicit store_address_t(uint32_t rawAddress) : raw(rawAddress) {}
|
explicit store_address_t(uint32_t rawAddress) : raw(rawAddress) {}
|
||||||
|
|
||||||
static store_address_t invalid() { return {}; };
|
static store_address_t invalid() { return {}; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor to create an address object using pool
|
* Constructor to create an address object using pool
|
||||||
|
@ -34,7 +34,7 @@ class ExecutableObjectIF {
|
|||||||
* a reference to the executing task
|
* a reference to the executing task
|
||||||
* @param task_ Pointer to the taskIF of this task
|
* @param task_ Pointer to the taskIF of this task
|
||||||
*/
|
*/
|
||||||
virtual void setTaskIF(PeriodicTaskIF* task_){};
|
virtual void setTaskIF(PeriodicTaskIF* task_){}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function should be called after the object was assigned to a
|
* This function should be called after the object was assigned to a
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
class RawUserDataReaderIF {
|
class RawUserDataReaderIF {
|
||||||
public:
|
public:
|
||||||
~RawUserDataReaderIF() = default;
|
virtual ~RawUserDataReaderIF() = default;
|
||||||
[[nodiscard]] virtual const uint8_t* getUserData() const = 0;
|
[[nodiscard]] virtual const uint8_t* getUserData() const = 0;
|
||||||
[[nodiscard]] virtual size_t getUserDataLen() const = 0;
|
[[nodiscard]] virtual size_t getUserDataLen() const = 0;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user