mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-10 16:55:58 +00:00
Added printable prinf and template printable
This commit is contained in:
parent
6da6666559
commit
5e04b2cfcb
@ -23,6 +23,4 @@ namespace sta
|
||||
};
|
||||
} // namespace sta
|
||||
|
||||
|
||||
|
||||
#endif // STA_CORE_PRINTABLE_PRINTF_HPP
|
34
include/sta/devices/template/custom_printable.hpp
Normal file
34
include/sta/devices/template/custom_printable.hpp
Normal file
@ -0,0 +1,34 @@
|
||||
#ifndef STA_CORE_YOUR_DEVICE_CUSTOM_PRINTABLE_HPP
|
||||
#define STA_CORE_YOUR_DEVICE_CUSTOM_PRINTABLE_HPP
|
||||
|
||||
#include <sta/config.hpp>
|
||||
|
||||
#if defined(STA_PLATFORM_YOUR_DEVICE) || defined(DOXYGEN)
|
||||
|
||||
#include <sta/debug/printing/printable.hpp>
|
||||
|
||||
namespace sta
|
||||
{
|
||||
class CustomPrintable : public Printable
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor for your custom printable.
|
||||
*
|
||||
* Delete if not needed.
|
||||
*/
|
||||
CustomPrintable(/* YOUR ARGMENTS */);
|
||||
|
||||
/**
|
||||
* @brief Print string.
|
||||
*
|
||||
* @param str String buffer
|
||||
* @param length String length
|
||||
*/
|
||||
void print(const char * str, size_t length) override;
|
||||
};
|
||||
} // namespace sta
|
||||
|
||||
#endif // STA_PLATFORM_YOUR_DEVICE
|
||||
|
||||
#endif // STA_CORE_YOUR_DEVICE_CUSTOM_PRINTABLE_HPP
|
18
src/devices/template/custom_printable.cpp
Normal file
18
src/devices/template/custom_printable.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
#include <sta/devices/template/custom_printable.hpp>
|
||||
|
||||
#ifdef STA_PLATFORM_YOUR_DEVICE
|
||||
|
||||
#include <sta/debug/assert.hpp>
|
||||
|
||||
namespace sta
|
||||
{
|
||||
void CustomPrintable::print(const char * str, size_t length)
|
||||
{
|
||||
STA_ASSERT(str != nullptr);
|
||||
STA_ASSERT(length > 0);
|
||||
|
||||
// YOUR CODE HERE
|
||||
}
|
||||
} // namespace sta
|
||||
|
||||
#endif // STA_PLATFORM_YOUR_DEVICE
|
Loading…
x
Reference in New Issue
Block a user