otsdaq  v2_04_01
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 ViewRegisterInfo::ViewRegisterInfo(std::string typeName,
17  std::string registerName,
18  std::string baseAddress,
19  int size,
20  std::string access)
21 {
22  dataTable_.push_back(typeName), dataTable_.push_back(registerName),
23  dataTable_.push_back(baseAddress), dataTable_.push_back(std::to_string(size)),
24  dataTable_.push_back(access);
25 }
26 
27 //==============================================================================
28 ViewRegisterInfo::~ViewRegisterInfo(void) {}
29 
30 //==============================================================================
31 const std::string& ViewRegisterInfo::getTypeName(void) const
32 {
33  return dataTable_.at(typeName_);
34 }
35 
36 //==============================================================================
37 const std::string& ViewRegisterInfo::getRegisterName(void) const
38 {
39  return dataTable_.at(registerName_);
40 }
41 //==============================================================================
42 const std::string& ViewRegisterInfo::getBaseAddress(void) const
43 {
44  return dataTable_.at(baseAddress_);
45 }
46 //==============================================================================
47 const int ViewRegisterInfo::getSize(void) const
48 {
49  return std::stoi(dataTable_.at(size_));
50 }
51 //==============================================================================
52 const std::string& ViewRegisterInfo::getAccess(void) const
53 {
54  return dataTable_.at(access_);
55 }
56 //==============================================================================
57 const int ViewRegisterInfo::getNumberOfColumns(void) const { return dataTable_.size(); }