implement BMap class for passing map type params between python and c++.