Skip to content
Snippets Groups Projects
Commit 30b53d49 authored by Radovan Červený's avatar Radovan Červený
Browse files

basic api and structures outline

parent afb22efb
No related branches found
No related tags found
1 merge request!15BP_cervera3 - automatic measurements, processing
......@@ -3,15 +3,36 @@
*/
 
#include <tclap/CmdLine.h>
#include "factory/XmlDataFactory.hpp"
#include "provisioner/MeasurementProvisioner.hpp"
 
int main ( int argc, char * * argv ) {
 
try {
TCLAP::CmdLine cmd ( "Measurements provisioner and processor binary", ' ', "0.01" );
TCLAP::CmdLine cmd ( "Measurement provisioner and processor binary", ' ', "0.01" );
TCLAP::UnlabeledValueArg < std::string > input ( "input", "provisioning file", false, "-", "file" );
cmd.add ( input );
 
cmd.parse ( argc, argv );
 
std::deque < sax::Token > tokens;
if ( input.getValue ( ) == "-" )
sax::SaxParseInterface::parseStdin ( tokens );
else
sax::SaxParseInterface::parseFile ( input.getValue ( ), tokens );
auto configuration = provisioner::MeasurementProvisioner::parse_configuration ( tokens );
auto results = provisioner::MeasurementProvisioner::run_configuration ( configuration );
std::cout << results << std::endl;
return 0;
} catch ( const exception::AlibException & exception ) {
alib::XmlDataFactory::toStdout ( exception );
return 1;
} catch ( const TCLAP::ArgException & exception ) {
std::cout << exception.error ( ) << std::endl;
return 2;
......
/*
* Author: Radovan Cerveny
*/
#include "MeasurementProvisioner.hpp"
namespace provisioner {
MeasurementProvisionerConfiguration MeasurementProvisioner::parse_configuration ( std::deque < sax::Token > ) {
MeasurementProvisionerConfiguration configuration;
return configuration;
}
MeasurementProvisionerResults MeasurementProvisioner::run_configuration ( const MeasurementProvisionerConfiguration & ) {
MeasurementProvisionerResults results;
return results;
}
}
/*
* Author: Radovan Cerveny
*/
#ifndef MEASUREMENT_PROVISIONER_HPP_
#define MEASUREMENT_PROVISIONER_HPP_
#include "sax/Token.h"
#include <deque>
#include "MeasurementProvisionerConfiguration.hpp"
#include "MeasurementProvisionerResults.hpp"
namespace provisioner {
class MeasurementProvisioner {
public:
static MeasurementProvisionerConfiguration parse_configuration ( std::deque < sax::Token > );
static MeasurementProvisionerResults run_configuration ( const MeasurementProvisionerConfiguration & );
};
}
#endif /* MEASUREMENT_PROVISIONER_HPP_ */
/*
* Author: Radovan Cerveny
*/
#ifndef MEASUREMENT_PROVISIONER_CONFIGURATION_HPP_
#define MEASUREMENT_PROVISIONER_CONFIGURATION_HPP_
namespace provisioner {
struct MeasurementProvisionerConfiguration {
};
}
#endif /* MEASUREMENT_PROVISIONER_CONFIGURATION_HPP_ */
/*
* Author: Radovan Cerveny
*/
#ifndef MEASUREMENT_PROVISIONER_RESULTS_HPP_
#define MEASUREMENT_PROVISIONER_RESULTS_HPP_
namespace provisioner {
struct MeasurementProvisionerResults {
};
}
#endif /* MEASUREMENT_PROVISIONER_RESULTS_HPP_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment