otsdaq  v2_00_00
ViewRegisterInfo.cpp
1 /*
2  * ViewRegisterInfo.cpp
3  *
4  * Created on: Jul 29, 2015
5  * Author: parilla
6  *
7  *
8  *
9  */
10 
11 #include "otsdaq-core/ConfigurationDataFormats/ViewRegisterInfo.h"
12 
13 using namespace ots;
14 
15 
16 //==============================================================================
17 ViewRegisterInfo::ViewRegisterInfo(std::string typeName, std::string registerName, std::string baseAddress, int size, std::string access)
18 {
19  dataTable_.push_back(typeName),
20  dataTable_.push_back(registerName),
21  dataTable_.push_back(baseAddress),
22  dataTable_.push_back(std::to_string(size)),
23  dataTable_.push_back(access);
24 }
25 
26 //==============================================================================
27 ViewRegisterInfo::~ViewRegisterInfo(void)
28 {
29 }
30 
31 //==============================================================================
32 const std::string& ViewRegisterInfo::getTypeName(void) const
33 {
34  return dataTable_.at(typeName_);
35 }
36 
37 //==============================================================================
38 const std::string& ViewRegisterInfo::getRegisterName(void) const
39 {
40  return dataTable_.at(registerName_);
41 }
42 //==============================================================================
43 const std::string& ViewRegisterInfo::getBaseAddress(void) const
44 {
45  return dataTable_.at(baseAddress_);
46 }
47 //==============================================================================
48 const int ViewRegisterInfo::getSize(void) const
49 {
50  return std::stoi(dataTable_.at(size_));
51 }
52 //==============================================================================
53 const std::string& ViewRegisterInfo::getAccess(void) const
54 {
55  return dataTable_.at(access_);
56 }
57 //==============================================================================
58 const int ViewRegisterInfo::getNumberOfColumns(void) const{
59  return dataTable_.size();
60 }
61 
62