Public Member Functions | Public Attributes | List of all members
dune::tde::crate Struct Reference

#include <tde_cmap_utils.h>

Public Member Functions

 crate (int id, int cards)
 
void add_crp_connection (int icrp, int fslot, const std::vector< int > &kel_ids)
 

Public Attributes

int _id
 
int _cards
 
std::vector< std::tuple< int, int, int, int > > _crp_conn
 

Detailed Description

Definition at line 81 of file tde_cmap_utils.h.

Constructor & Destructor Documentation

dune::tde::crate::crate ( int  id,
int  cards 
)
inline

Definition at line 83 of file tde_cmap_utils.h.

83  {
84  _id = id;
85  _cards = cards;
86  }

Member Function Documentation

void dune::tde::crate::add_crp_connection ( int  icrp,
int  fslot,
const std::vector< int > &  kel_ids 
)
inline

Definition at line 89 of file tde_cmap_utils.h.

91  {
92  auto nconn = kel_ids.size();
93  if( nconn % 2 ){
94  std::cout<<"number of connectors is not even\n";
95  return;
96  }
97 
98  if( fslot < (int)_crp_conn.size() && !_crp_conn.empty() ){
99  std::cout<<"cannot overwrite the existing connection\n";
100  return;
101  }
102 
103  int islot = fslot;
104  for( size_t i=0;i<kel_ids.size();i+=2 ){
105  int kel_1 = kel_ids[i];
106  int kel_2 = kel_ids[i+1];
107 
108  if( islot >= _cards ){
109  std::cout<<"slot "<<islot<<" does not exist\n";
110  break;
111  }
112  _crp_conn.emplace_back(islot, icrp, kel_1, kel_2 );
113  islot++;
114  }
115  }
std::vector< std::tuple< int, int, int, int > > _crp_conn

Member Data Documentation

int dune::tde::crate::_cards

Definition at line 119 of file tde_cmap_utils.h.

std::vector< std::tuple< int, int, int, int> > dune::tde::crate::_crp_conn

Definition at line 120 of file tde_cmap_utils.h.

int dune::tde::crate::_id

Definition at line 118 of file tde_cmap_utils.h.


The documentation for this struct was generated from the following file: