Addition of Oidxs and Oids.

Alexander Gutkin sasha____rhetoricalsystems.com
Wed Jan 22 13:22:26 CET 2003


   Hi,

       Is there any reason why the addition operator is missing from Oid 
and Agentpp::Oidx classes ? Sometimes there is a need (albeit not a 
frequent one) to do things like the following:

	const Oid OID_BASE = "1.3.4";
	const Oid OID_NEW  = OID_BASE + "5";

       It is impossible to achieve the aforementioned with the existing 
API. If you try to do the following:

        const Oid OID_NEW = (OID_BASE += "5")

this won't work since the OID_BASE itself is a const. I suggest the 
following very simple addition of + operator for Oid and Oidx classes:

inline Oid
operator +(const Oid &lhs, const Oid &rhs) {
    Oid tmp = lhs;
    return tmp += rhs;
}

(ditto with Agentpp::Oidx extension).

					Regards,
						Alexander.


	




More information about the AGENTPP mailing list