ORIGINAL
Loading...
Searching...
No Matches
wrapper.h
1#ifndef WRAPPER_H
2#define WRAPPER_H
3#pragma once
4#include <sstream>
5
6#include "string"
7#include "printable.h"
8
9namespace original
10{
11 template <typename TYPE>
12 class wrapper : public printable{
13 public:
14 virtual TYPE& getVal() = 0;
15 virtual const TYPE& getVal() const = 0;
16 virtual void setVal(TYPE data) = 0;
17 virtual wrapper* getPPrev() const = 0;
18 virtual wrapper* getPNext() const = 0;
19 ~wrapper() override = default;
20 [[nodiscard]] std::string className() const override;
21 [[nodiscard]] std::string toString(bool enter) const override;
22 };
23
24}
25
26 template <typename TYPE>
27 auto original::wrapper<TYPE>::className() const -> std::string
28 {
29 return "wrapper";
30 }
31
32 template<typename TYPE>
33 auto original::wrapper<TYPE>::toString(const bool enter) const -> std::string
34 {
35 std::stringstream ss;
36 ss << this->className() << "(" << formatString(this) << ", " << formatString(this->getVal()) << ")";
37 if (enter) ss << "\n";
38 return ss.str();
39 }
40#endif //WRAPPER_H
Definition printable.h:9
Definition wrapper.h:12