Public Member Functions | List of all members
CRT::StripID Struct Reference

#include <CRTID.h>

Inheritance diagram for CRT::StripID:
CRT::detail::Node< LayerID, uint8_t > CRT::detail::Node< BASE, ID >

Public Member Functions

 StripID (const LayerID &layer, const uint8_t local)
 
virtual ~StripID ()=default
 
bool Overlaps (const StripID &other) const
 
- Public Member Functions inherited from CRT::detail::Node< LayerID, uint8_t >
 Node (const LayerID &base, const uint8_t &id)
 
virtual ~Node ()=default
 
bool operator== (const Node< LayerID, uint8_t > &other) const
 
bool operator< (const Node< LayerID, uint8_t > &other) const
 
- Public Member Functions inherited from CRT::detail::Node< BASE, ID >
 Node (const BASE &base, const ID &id)
 
bool operator== (const Node< BASE, ID > &other) const
 
bool operator< (const Node< BASE, ID > &other) const
 

Additional Inherited Members

- Protected Attributes inherited from CRT::detail::Node< LayerID, uint8_t >
const uint8_t fID
 
- Protected Attributes inherited from CRT::detail::Node< BASE, ID >
const ID fID
 

Detailed Description

Definition at line 145 of file CRTID.h.

Constructor & Destructor Documentation

CRT::StripID::StripID ( const LayerID layer,
const uint8_t  local 
)
inline

Definition at line 147 of file CRTID.h.

147 : detail::Node<LayerID, uint8_t>(layer, local) {}
virtual CRT::StripID::~StripID ( )
virtualdefault

Member Function Documentation

bool CRT::StripID::Overlaps ( const StripID other) const
inline

Definition at line 150 of file CRTID.h.

151  {
152  if(!(this->ModuleID::operator==(other))) return false; //Strips from different modules can't overlap
153  if(this->LayerID::operator==(other)) return false; //Strips from the same layer can't overlap
154 
155  const auto diff = fID - other.fID;
156 
157  //diff == 0 overlaps for either the top or the bottom.
158  if(diff == 0) return true;
159 
160  const auto layer = this->LayerID::fID;
161  //If this is the bottom layer
162  if(layer) return diff == 1;
163 
164  //If we survived this far, this is the top layer
165  return diff == -1;
166  }

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