These objects are not really designed to be handled directly by user
programs; instead, there are trace sources available to allow user
programs to be notified of the changes to these values.
Specifically, the CW and Backoff values are exported as traces. MinCw
and MaxCw are attributes, usually a constant in a simulation, and
default values can just be read from the txop.cc source file (they
default to 15 and 1023, respectively).
https://www.nsnam.org/docs/doxygen/classns3_1_1_txop.html#details
For an example program of how they are used, see
src/wifi/examples/wifi-bianchi.cc