add a shnitton of loggers
This commit is contained in:
@ -5,18 +5,19 @@
|
||||
// NOTE: Implement this here as we need to include globals for printing
|
||||
|
||||
template<typename T>
|
||||
void ArrayList<T>::print() const {
|
||||
void ArrayList<T>::print(OutStream& out) const {
|
||||
if (this->buffer_pos == 0) {
|
||||
kout << "Print List (0 elements)" << endl;
|
||||
out << "Print List (0 elements)" << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
kout << "Print List (" << dec << this->buffer_pos << " elements): ";
|
||||
out << "Print List (" << dec << this->buffer_pos << " elements): ";
|
||||
for (unsigned int i = 0; i < this->buffer_pos; ++i) {
|
||||
kout << dec << this->get(i) << " ";
|
||||
out << dec << this->get(i) << " ";
|
||||
}
|
||||
kout << endl;
|
||||
out << endl;
|
||||
}
|
||||
|
||||
// List all types that are used with print()
|
||||
template class ArrayList<int>;
|
||||
template class ArrayList<Thread*>;
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
// ArrayList instead, without additional effort.
|
||||
// It's also cool to use the allocator a bit more and introduce realloc because I coded that thing
|
||||
|
||||
#include "lib/OutStream.h"
|
||||
#include <cstddef>
|
||||
|
||||
// I put the whole implementation in the header because the templating makes it cumbersome to split
|
||||
@ -184,7 +185,7 @@ public:
|
||||
return this->buffer_pos;
|
||||
}
|
||||
|
||||
void print() const;
|
||||
void print(OutStream& out) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user