I am going through source-code of a Networking Protocol. Though I understand the rules of the protocol while trying to understand the implementation seemed like not possible. The implementation used boost asio libraries. I tried to go through the docs to understand the working of the library. It helped me to understand the code a bit more, but as I move forward I still face a lot of trouble with lots of new unheard functions or data structures names used in the code. What is the fastest way I can get to know the proper purpose of a particular function or the abstract data structures implementations in C++ libraries? I was suggested to use IDE CLion. It though helped me to quickly find the declaration of the selected function in the code base and in the included header files but still, the definition was not there as it opened up .h files.
For example, I never saw ntohs function before so when I clicked on the option it opened up in.h header file and showed
extern uint16_t ntohs (uint16_t __netshort)
__THROW __attribute__ ((__const__));
Just the declaration. Is there an easier to understand the implementation and purpose of a function other googling its name every time?
I went through the other suggestions in StackOverflow and went through articles on reading other people source code too. I couldn't find anything that's why I am here.