| Line |
Branch |
Decision |
Call |
Exec |
Source |
| 1 |
|
|
|
|
#ifndef CHRYSALIS_BASEARGUMENT_H |
| 2 |
|
|
|
|
#define CHRYSALIS_BASEARGUMENT_H |
| 3 |
|
|
|
|
|
| 4 |
|
|
|
|
#include <memory> |
| 5 |
|
|
|
|
#include <expected> |
| 6 |
|
|
|
|
|
| 7 |
|
|
|
|
#include "Error.h" |
| 8 |
|
|
|
|
#include "CompositiveContainer.h" |
| 9 |
|
|
|
|
|
| 10 |
|
|
|
|
/** @defgroup Arguments Arguments |
| 11 |
|
|
|
|
* @{ |
| 12 |
|
|
|
|
*/ |
| 13 |
|
|
|
|
namespace Chrysalis { |
| 14 |
|
|
|
|
template<typename T> |
| 15 |
|
|
|
|
class BaseArgument { |
| 16 |
|
|
|
4144 |
SERIALIZED |
| 17 |
|
|
|
|
protected: |
| 18 |
|
|
2/2
✓ Call 0 invoked.
✓ Call 1 invoked.
|
3163 |
explicit BaseArgument() = default; |
| 19 |
|
|
|
|
public: |
| 20 |
|
|
2/2
✓ Call 0 invoked.
✓ Call 1 invoked.
|
5310 |
virtual ~BaseArgument() = default; |
| 21 |
|
|
|
|
|
| 22 |
|
|
|
|
[[nodiscard]] virtual std::expected<T, Error> get() const = 0; |
| 23 |
|
|
|
|
}; |
| 24 |
|
|
|
|
namespace args { |
| 25 |
|
|
|
|
using number = std::unique_ptr<BaseArgument<double>>; |
| 26 |
|
|
|
|
using condition = BaseArgument<bool>; |
| 27 |
|
|
|
|
template<typename T> |
| 28 |
|
|
|
|
using container = CompositiveContainer<T>; |
| 29 |
|
|
|
|
} |
| 30 |
|
|
|
|
} |
| 31 |
|
|
|
|
/**@}*/ |
| 32 |
|
|
|
|
|
| 33 |
|
|
|
|
#endif //CHRYSALIS_BASEARGUMENT_H |
| 34 |
|
|
|
|
|