Skip to content
Snippets Groups Projects
Commit f0f4aa97 authored by Martin Killenberg's avatar Martin Killenberg
Browse files

starting to implement the VariableMapper. Compiles, but not implemented and used yet.

parent e1a5979c
No related branches found
No related tags found
No related merge requests found
#ifndef CHIMERATK_DOOCS_ADAPTER_VARIABLE_MAPPER_H
#define CHIMERATK_DOOCS_ADAPTER_VARIABLE_MAPPER_H
#include <string>
#include <map>
#include <set>
namespace ChimeraTK{
class VariableMapper{
public:
static VariableMapper & getInstance();
void prepareOutput(std::string xmlFile, std::set< std::string > inputVariables);
// PropertyAttributes are used in the property description itself, and
// as default values (global and in the locations)
struct PropertyAttributes{
bool hasHistory;
bool isWriteable;
};
// extends the PropertyAttributes by a name
// FIXME: should sort by name to put it into a set?
struct PropertyDescription:
public PropertyAttributes{
std::string location;
std::string name;
};
std::map< std::string, PropertyDescription > getPropertiesInLocation(std::string location);
VariableMapper(VariableMapper &)=delete;
void operator=(VariableMapper const &)=delete;
private:
VariableMapper()=default;
std::map<std::string, PropertyAttributes> locationDefaults;
PropertyAttributes globalDefaults;
// PropertyDescriptions, sorted by input, i.e. the ChimeraTK PV name
std::map<std::string, PropertyDescription> inputSortedDescriptions;
};
} // namespace ChimeraTK
#endif // CHIMERATK_DOOCS_ADAPTER_VARIABLE_MAPPER_H
#include "VariableMapper.h"
namespace ChimeraTK{
VariableMapper & VariableMapper::getInstance(){
static VariableMapper instance;
return instance;
}
} // namespace ChimeraTK
#define BOOST_TEST_MODULE DoocsProcessArrayTest
// Only after defining the name include the unit test header.
#include <boost/test/included/unit_test.hpp>
//#include <boost/test/test_case_template.hpp>
BOOST_AUTO_TEST_CASE( testCreation ){
VariableMapper & vm = VariableMapper::getInstance();
}
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