if (pContract = (*ii).second) // if not null
When I looked at that piece of code it made me go WTF, but essentially it assigns a value to a pointer and if the pointer isn't null it executes the code.
You have to break it down.
- First (*ii) is evaluated. I think that is transforming the iterator (integer?) into a pointer to an object. My C++ is rusty.
- Then the expression (*ii).second returns the "second" member from the object.
- It gets assigned to pContract.
- The if statement will only execute if pContract is not 0 which is also the "null" value in C++
This works because you can do expressions like x = y = z where x and y get the value of z. The value just gets passed to the left.
-- Open Transactions is open-source, written in C++, object-oriented, and includes a high-level API in Java, Ruby, Python, C, D, C++, Obj-C, C#, Lisp, Perl, PHP, and Tcl.
Once you compile it you should be able to use it in the language of your choice. For python you would "import namespace" for C# you will need to add the the DLL you built to the references then use the "using namespace". PHP would add it to the global namespace I think. C/D/C++/Obj-C you would need to copy the headers and library and link against it. That is if you intend to use their implementation of the protocol rather then starting from scratch.