ECSTASY
All in the name
Loading...
Searching...
No Matches
INodeFactory.hpp
Go to the documentation of this file.
1
11
12#ifndef UTIL_SERIALIZATION_INODEFACTORY_HPP_
13#define UTIL_SERIALIZATION_INODEFACTORY_HPP_
14
15#include "INode.hpp"
16
17namespace util::serialization
18{
26 public:
28 virtual ~INodeFactory() = default;
29
43 [[nodiscard]] virtual NodePtr create(INode::Type type) = 0;
44
55 [[nodiscard]] virtual NodePtr create(const INode &node) = 0;
56
67 [[nodiscard]] virtual NodePtr createObject(const IObjectNode &object) = 0;
68
79 [[nodiscard]] virtual NodePtr createArray(const IArrayNode &array) = 0;
80
91 [[nodiscard]] virtual NodePtr create(std::string_view string) = 0;
92
103 [[nodiscard]] virtual NodePtr create(int64_t integer) = 0;
104
115 [[nodiscard]] virtual NodePtr create(double floatingPoint) = 0;
116
127 [[nodiscard]] virtual NodePtr create(bool boolean) = 0;
128
139 [[nodiscard]] virtual NodePtr create(INode::Date date) = 0;
140
151 [[nodiscard]] virtual NodePtr create(INode::Time time) = 0;
152
163 [[nodiscard]] virtual NodePtr create(INode::DateTime dateTime) = 0;
164 };
165} // namespace util::serialization
166
167#endif /* !UTIL_SERIALIZATION_INODEFACTORY_HPP_ */
Serialization node interface.
Node factory to hide underlying format.
virtual NodePtr create(int64_t integer)=0
Construct a INode::Type::Integer node.
virtual NodePtr create(INode::Type type)=0
Construct an empty node from its type.
virtual NodePtr create(const INode &node)=0
Construct a copy of an existing node.
virtual NodePtr createObject(const IObjectNode &object)=0
Construct a INode::Type::Object node.
virtual NodePtr create(INode::DateTime dateTime)=0
Construct a INode::Type::DateTime node.
virtual NodePtr create(INode::Date date)=0
Construct a INode::Type::Date node.
virtual NodePtr createArray(const IArrayNode &array)=0
Construct a INode::Type::Array node.
virtual NodePtr create(bool boolean)=0
Construct a INode::Type::Boolean node.
virtual NodePtr create(INode::Time time)=0
Construct a INode::Type::Time node.
virtual NodePtr create(double floatingPoint)=0
Construct a INode::Type::Float node.
virtual ~INodeFactory()=default
Default destructor.
virtual NodePtr create(std::string_view string)=0
Construct a INode::Type::String node.
Serialization node.
Definition INode.hpp:32
std::chrono::high_resolution_clock::time_point DateTime
Type::DateTime underlying type.
Definition INode.hpp:64
Type
Available node types.
Definition INode.hpp:42