diff --git a/datapool/DataPool.h b/datapool/DataPool.h index 6e38dc1b..a9af8af0 100644 --- a/datapool/DataPool.h +++ b/datapool/DataPool.h @@ -29,7 +29,7 @@ * \brief This class represents the OBSW global data-pool. * * \details All variables are registered and space is allocated in an initialization - * function, which is passed do the constructor. + * function, which is passed to the constructor. * Space for the variables is allocated on the heap (with a new call). * The data is found by a data pool id, which uniquely represents a variable. * Data pool variables should be used with a blackboard logic in mind, diff --git a/internalError/InternalErrorReporter.cpp b/internalError/InternalErrorReporter.cpp index 9a8ede00..81c4a0e5 100644 --- a/internalError/InternalErrorReporter.cpp +++ b/internalError/InternalErrorReporter.cpp @@ -8,10 +8,9 @@ InternalErrorReporter::InternalErrorReporter(object_id_t setObjectId, uint32_t queuePoolId, uint32_t tmPoolId, uint32_t storePoolId) : - SystemObject(setObjectId), mutex(NULL), queuePoolId(queuePoolId), tmPoolId( - tmPoolId), storePoolId( - storePoolId), queueHits(0), tmHits(0), storeHits( - 0) { + SystemObject(setObjectId), mutex(NULL), queuePoolId(queuePoolId), + tmPoolId(tmPoolId),storePoolId(storePoolId), queueHits(0), tmHits(0), + storeHits(0) { mutex = MutexFactory::instance()->createMutex(); } diff --git a/serialize/SerialBufferAdapter.cpp b/serialize/SerialBufferAdapter.cpp index c5fcfb57..9a8e6f06 100644 --- a/serialize/SerialBufferAdapter.cpp +++ b/serialize/SerialBufferAdapter.cpp @@ -1,8 +1,6 @@ #include #include - - template SerialBufferAdapter::SerialBufferAdapter(const uint8_t* buffer, T bufferLength, bool serializeLength) : @@ -17,6 +15,13 @@ SerialBufferAdapter::SerialBufferAdapter(uint8_t* buffer, T bufferLength, bufferLength) { } +template +SerialBufferAdapter::SerialBufferAdapter(uint32_t* buffer, + T bufferLength, bool serializeLength) : + serializeLength(serializeLength), constBuffer(NULL), buffer(reinterpret_cast(buffer)), + bufferLength(bufferLength*4) { +} + template SerialBufferAdapter::~SerialBufferAdapter() { } @@ -86,6 +91,10 @@ ReturnValue_t SerialBufferAdapter::deSerialize(const uint8_t** buffer, } } +template +uint8_t * SerialBufferAdapter::getBuffer() { + return buffer; +} //forward Template declaration for linker template class SerialBufferAdapter; diff --git a/serialize/SerialBufferAdapter.h b/serialize/SerialBufferAdapter.h index 7d192bb4..7496c137 100644 --- a/serialize/SerialBufferAdapter.h +++ b/serialize/SerialBufferAdapter.h @@ -11,16 +11,39 @@ * Additionally, the buffer length can be serialized too and will be put in front of the serialized buffer. * * Can be used with SerialLinkedListAdapter by declaring a SerializeElement with - * SerialElement> serialBufferElement + * SerialElement> serialBufferElement * * \ingroup serialize */ template class SerialBufferAdapter: public SerializeIF { public: - SerialBufferAdapter(const uint8_t * buffer, T bufferLength, bool serializeLenght = false); - SerialBufferAdapter(uint8_t* buffer, T bufferLength, - bool serializeLenght = false); + /** + * Constructor for constant uint8_t buffer. Length field can be serialized optionally. + * Type of length can be supplied as template type. + * @param buffer + * @param bufferLength + * @param serializeLength + */ + SerialBufferAdapter(const uint8_t * buffer, T bufferLength, bool serializeLength = false); + + /** + * Constructoor for non-constant uint8_t buffer. Length field can be serialized optionally. + * Type of length can be supplied as template type. + * @param buffer + * @param bufferLength + * @param serializeLength + */ + SerialBufferAdapter(uint8_t* buffer, T bufferLength, bool serializeLength = false); + + /** + * Constructoor for non-constant uint32_t buffer. Length field can be serialized optionally. + * Type of length can be supplied as template type. + * @param buffer + * @param bufferLength + * @param serializeLength + */ + SerialBufferAdapter(uint32_t* buffer,T bufferLength, bool serializeLength = false); virtual ~SerialBufferAdapter(); @@ -31,6 +54,8 @@ public: virtual ReturnValue_t deSerialize(const uint8_t** buffer, int32_t* size, bool bigEndian); + + uint8_t * getBuffer(); private: bool serializeLength; const uint8_t *constBuffer;