Note that there are some explanatory texts on larger screens.

plurals
  1. POneed help reading/parsing TCP network code c++
    text
    copied!<p>i have an application which tracks body movement, it can also act like a server to send the body tracking data out via TCP. My Client connects to the server and gets the data.</p> <p>Before the data is send to a client something like this happens :</p> <pre><code>MTBF v10 = bodyPose2MTBF_v10(pose, m_startup, m_stream_position, 1); ss &lt;&lt; v10.get(); m_body_tracking_server-&gt;send(ss); </code></pre> <p>where the pose has all the information like position of the head as a vector, leg, shoulder position etc..SS is a new stringstream, and with v10.get() the stream is filled with the pose as a string. In the send method the stringstream(ss) is sent to the client.</p> <p>In my client i get the stringstream. I also converted it back to mtbf. The problem is, the code is not from me, so i dont understand it all. When the pose is converted to mtbf something like this happens :</p> <pre><code>data.addFlag(0); data &lt;&lt; torso.x() &lt;&lt; torso.y() &lt;&lt; torso.z(); sensorConfig |= MTBFData_0_4::RightArmPosition; data.addFlag(1); . . . </code></pre> <p>I get that it is adding a "flag" so that i can recognize the torso for example, followed by the x y and z coordinates of the torso. but the add flag method looks like this :</p> <pre><code>addFlag(unsigned char n) { m_flag |= (1i64 &lt;&lt; n); m_buf.replace(7+8, 8, reinterpret_cast&lt;char*&gt;(&amp;m_flag), 8); return *this; } </code></pre> <p>What exactly does this method?? shifting some stuff and reinterpret the char...i really need help to understand this! thank you!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload