KIDS  ver-0.0.1
KIDS : Kernel Integrated Dynamics Simulator
Loading...
Searching...
No Matches
Kernel_Load_DataSet.cpp
Go to the documentation of this file.
2
3#include "kids/hash_fnv1a.h"
4#include "kids/linalg.h"
5#include "kids/macro_utils.h"
6
7namespace PROJECT_NS {
8
9const std::string Kernel_Load_DataSet::getName() { return "Kernel_Load_DataSet"; }
10
12
13void Kernel_Load_DataSet::setInputParam_impl(std::shared_ptr<Param>& PM) { fn = PM->get_string("load", LOC(), "NULL"); }
14
16 if (fn == "" || fn == "NULL" || fn == "null") return stat;
17 try {
18 std::ifstream ifs{fn};
19 _dataset->load(ifs);
20 ifs.close();
21 } catch (std::runtime_error& e) { throw kids_error(fn); }
22 return stat;
23}
24
25}; // namespace PROJECT_NS
virtual int getType() const
Get the type of the kernel.
virtual Status & executeKernel_impl(Status &stat)
Virtual function to execute the kernel implementation.
std::string fn
filename for loading
virtual const std::string getName()
Get the name of the kernel.
virtual void setInputParam_impl(std::shared_ptr< Param > &PM)
Virtual function to set input parameters for the kernel implementation.
std::shared_ptr< DataSet > _dataset
Shared pointer to the DataSet object associated with this kernel.
Definition Kernel.h:278
#define LOC()
show the location information for debug
Definition fmt.h:49
Provide linalg APIs.
#define FUNCTION_NAME
Definition macro_utils.h:9
< http://warp.povusers.org/FunctionParser/fparser.html
Definition Context.h:39
constexpr uint32_t hash(const char *str)
Definition hash_fnv1a.h:12