PenetrateBase/PenetrateBasic/main.cpp

70 lines
1.5 KiB
C++
Raw Normal View History

2024-11-11 08:29:59 +00:00
#include <QtCore/QCoreApplication>
#include <qdebug.h>
#include "cmds_basic.h"
#include "dispatch.h"
#include "cmds.h"
2024-11-17 15:36:43 +00:00
#include "validate.h"
2024-11-17 15:03:54 +00:00
#include "validate_impl.h"
2024-11-18 15:33:51 +00:00
#include "validate_depict.h"
2024-11-11 08:29:59 +00:00
2024-11-20 12:03:31 +00:00
int vp(int c);
cmds::T<int(int)>::Cmd<vp> entry("hello");
2024-11-20 10:50:44 +00:00
verify::T<int(int)>::Validate<vp> vp_check;
auto args0 = vp_check.pos<0>() & new impls::Int32Limit<true, true>(u8"Hello World", 0, 3);
namespace xproc {
int xmp(int arg) {
qDebug() << "xmp";
return 3;
}
}
cmds::T<int(int)>::Cmd<xproc::xmp> xvv("sfaf");
2024-11-20 12:03:31 +00:00
template<> void datas::dataSet<int>(IDataObject& object, const QString& key, int value) {
auto argx = object.newObject();
argx->setString(u8"Type", u8"int");
argx->setInt32(u8"Value", value);
object.setChild(key, argx);
}
2024-11-20 10:50:44 +00:00
template<> int datas::dataGet<int>(IDataObject& object, const QString& key) {
2024-11-20 12:03:31 +00:00
return object.getInt32(key);
2024-11-20 10:50:44 +00:00
}
2024-11-20 10:31:31 +00:00
#include "logs_port.h"
2024-11-11 08:29:59 +00:00
using namespace Inlet;
int main(int argc, char* argv[]) {
QCoreApplication a(argc, argv);
2024-11-20 12:03:31 +00:00
auto logs = std::make_shared<logs::LogsOutput>(QDir(u8"./"));
dispatch::Dispatch::unique()->loadOutput(logs);
2024-11-20 10:50:44 +00:00
SignatureImpl<int, int> v(3);
2024-11-11 08:29:59 +00:00
v.execute(vp);
Callable<int, int> vptr = vp;
CmdsImpl<(void*) vp, int, int> exec;
exec.execute(5);
entry(50);
2024-11-17 15:03:54 +00:00
entry(2);
entry(0);
entry(3);
2024-11-17 14:08:08 +00:00
xvv(2);
2024-11-11 08:29:59 +00:00
2024-11-18 15:33:51 +00:00
depict::ValidateDocObject doc;
dispatch::Dispatch::unique()->getValidateDepict(doc);
2024-11-20 10:50:44 +00:00
qDebug().noquote() << doc.toText();
2024-11-18 15:33:51 +00:00
2024-11-20 12:03:31 +00:00
logs->flush(true);
2024-11-11 08:29:59 +00:00
return a.exec();
}
2024-11-20 12:03:31 +00:00
int vp(int c) {
qDebug() << c;
return c;
}