bmv2
Designing your own switch target with bmv2
Classes
stateful.h File Reference

Go to the source code of this file.

Classes

class  bm::Register
 
class  bm::RegisterArray
 

Detailed Description

Includes both the Register and RegisterArray classes. RegisterArray is exposed in P4 v1.0.2 as the register object. Action primitives can take a RegisterArray reference as a parameter (but not a Register though). Here is a possible implementation of the register_write() P4 primitive:

class register_write
: public ActionPrimitive<RegisterArray &, const Data &, const Data &> {
void operator ()(RegisterArray &dst, const Data &idx, const Data &src) {
dst[idx.get_uint()].set(src);
}
};