Formatted package
This commit is contained in:
Dhanya Thattil
2022-08-05 15:39:34 +02:00
committed by GitHub
parent 7173785b29
commit 6bf9dbf6d3
89 changed files with 1366 additions and 1210 deletions

View File

@ -10,9 +10,9 @@
namespace sls {
CtbConfig::CtbConfig(){
for (size_t i=0; i!=num_dacs; ++i){
setDacName(i, "dac"+ToString(i));
CtbConfig::CtbConfig() {
for (size_t i = 0; i != num_dacs; ++i) {
setDacName(i, "dac" + ToString(i));
}
}
@ -25,11 +25,11 @@ void CtbConfig::check_index(size_t i) const {
}
void CtbConfig::check_size(const std::string &name) const {
if (name.empty())
throw RuntimeError("Name needs to be at least one character");
// dacname_length -1 to account for \0 termination
// dacname_length -1 to account for \0 termination
if (!(name.size() < (name_length - 1))) {
std::ostringstream oss;
oss << "Length of name needs to be less than " << name_length - 1
@ -48,8 +48,8 @@ void CtbConfig::setDacName(size_t index, const std::string &name) {
memcpy(dst, &name[0], name.size());
}
void CtbConfig::setDacNames(const std::vector<std::string>& names){
for (size_t i = 0; i!=num_dacs; ++i){
void CtbConfig::setDacNames(const std::vector<std::string> &names) {
for (size_t i = 0; i != num_dacs; ++i) {
setDacName(i, names[i]);
}
}
@ -65,8 +65,6 @@ std::vector<std::string> CtbConfig::getDacNames() const {
return names;
}
const char* CtbConfig::shm_tag(){
return shm_tag_;
}
const char *CtbConfig::shm_tag() { return shm_tag_; }
} // namespace sls