Page MenuHomePhorge

main.cpp
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

main.cpp

#include <QCoreApplication>
#include <QDebug>
//#include <secondclass.h>
//#include <examlpestaticlib.h>
#include "rosa/config/version.h"
#include "rosa/core/System.hpp"
#include "rosa/core/Unit.h"
#include "rosa/support/log.h"
#include "rosa/support/terminal_colors.h"
using namespace rosa;
using namespace rosa::terminal;
/// A dummy wrapper for testing \c rosa::System.
///
/// \note Since we test \c rosa::System directly here, we need to get access to
/// its protected members. That we do by imitating to be a decent subclass of
/// \c rosa::System, while calling protected member functions on an object of a
/// type from which we actually don't inherit.
struct SystemTester : protected System {
static constexpr AtomValue UnitKind = atom("unit");
static Unit &createMyUnit(System *S,
const std::string &Name = std::string()) {
return ((SystemTester *)S)
->createUnit<Unit, System>([&Name](const rosa::id_t Id,
System &S) noexcept {
const std::string N(
Name.empty()
? "Unit_" + std::to_string(S.numberOfConstructedUnits())
: Name);
return new Unit(UnitKind, Id, N, S);
});
}
static void destroyMyUnit(System *S, Unit &U) {
((SystemTester *)S)->destroyUnit(U);
}
};
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Confidence<int> conf(5,200,3);
qDebug() << "Executing lib-test program.";
// SecondClass sc;
// ExamlpeStaticLib ex;
int b = 0;
int lower, upper;
unsigned int change;
conf.getParameters(lower, upper, change);
// sc.Test1(&b);
qDebug() << "Value of b: " << b;
// ex.Test2(&b);
qDebug() << "Value of b: " << b;
return a.exec();
}

File Metadata

Mime Type
text/x-c
Expires
Tue, Oct 27, 8:30 PM (17 m, 1 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
409687
Default Alt Text
main.cpp (1 KB)

Event Timeline