24 #include <sys/resource.h>
26 using Diana::QOptions;
27 using Diana::QModuleFactory;
28 using Diana::QFrameWork;
29 using Diana::QMessageHandler;
31 using Diana::QDLLLoader;
34 int main(
int argc,
char *argv[]) {
36 time_t start_time = ::time (0);
39 std::stringstream errstr;
40 std::stringstream trace;
63 errstr <<
"Error: "<<std::endl
64 <<
"Q> Exception: QError" << std::endl
65 <<
"Q> Code : " << (int)
err.GetCode()
66 <<
" (" <<
err.ToString() <<
")";
67 if(
"" !=
err.GetDescription()) {
68 errstr << std::endl<<
"Q> Descr : " <<
err.GetDescription();
73 catch (std::exception& ex) {
74 errstr <<
"Error: "<<std::endl
75 <<
"Q> Exception: " << ex.what();
80 errstr <<
"Error: "<<std::endl
81 <<
"Q> Exception: Unknown type";
90 time_t end_time = ::time (0);
91 struct rusage usage_data;
92 if (!::getrusage (RUSAGE_SELF, &usage_data)) {
94 snprintf (s, 1000,
"Timing statistics: \n\n Real Time: %.0f s\n User Time: %ld s\n System Time: %ld\n",
95 ::difftime (end_time, start_time), usage_data.ru_utime.tv_sec, usage_data.ru_stime.tv_sec);
void diana_stacktrace(std::ostream &o, size_t MaxLines)
static QDLLLoader & GetInstance()
void SetAutoLoad(const bool autoload)
error class with error type and description
Main class of the diana framework.
void Run()
main function, basically the real main program in diana. It runs a list of sequences provided by the ...
static QGSL & GetInstance()
static QMessageHandler * Get()
void Send(MsgLevel l, const std::string &sender, const std::string &msg)
static QModuleFactory * Get()
void Init(int argc, char *const argv[])
static QOptions & GetInstance()
process status and signal handler
static QProcessStatus & GetInstance()
get singleton Instance
void Associate(int signalId, ProcessStatus_t pStatus)
associate a signal to a given process status
void SetState(ProcessStatus_t state)
change current process status bypassing status queue vector
int main(int argc, char *argv[])