Skip to content

Commit

Permalink
Checkpoint in initial hardware event building development
Browse files Browse the repository at this point in the history
  • Loading branch information
rrivera747 committed Jan 9, 2025
1 parent 56f86c1 commit 3ca74cc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions artdaq-core-mu2e/Overlays/DTC_Types/DTC_Link_ID.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,29 @@ inline std::ostream& operator<<(std::ostream& o, DTC_Link_ID const& link)
return o << static_cast<unsigned int>(link);
}

// Prefix increment
inline DTC_Link_ID& operator++(DTC_Link_ID& id)
{
if (id == DTC_Link_ALL || id == DTC_Link_Unused)
throw std::runtime_error("Illegal ++ operator on DTC_Link_ID of value " +
std::to_string(id));

id = static_cast<DTC_Link_ID>(static_cast<uint8_t>(id) + 1);
return id;
} //end ++op

// Postfix increment
inline DTC_Link_ID operator++(DTC_Link_ID& id, int)
{
if (id == DTC_Link_ALL || id == DTC_Link_Unused)
throw std::runtime_error("Illegal ++ operator on DTC_Link_ID of value " +
std::to_string(id));

DTC_Link_ID old = id;
id = static_cast<DTC_Link_ID>(static_cast<uint8_t>(id) + 1);
return old;
} //end op++

static const std::vector<DTC_Link_ID> DTC_ROC_Links{DTC_Link_0,
DTC_Link_1,
DTC_Link_2,
Expand Down

0 comments on commit 3ca74cc

Please sign in to comment.