The current approach of putting the const after the hrgls_Message type makes a const pointer, which is ignored by the compiler and is not doing what we want. We want the const to be before the declaration (to make the object constant), but doing this requires explicitly putting const pointers to the base structs because the pointer typedefs do not have their objects made const when they are made const. We must then modify parameters (including the struct keyword for C examples) in the hrgls_api.h functions so that the const-ness doesn't get us into trouble along the way.
This will ripple all the way through the library.
An example:
|
hrgls_Message const RawMessage() const; |
The current approach of putting the const after the hrgls_Message type makes a const pointer, which is ignored by the compiler and is not doing what we want. We want the const to be before the declaration (to make the object constant), but doing this requires explicitly putting const pointers to the base structs because the pointer typedefs do not have their objects made const when they are made const. We must then modify parameters (including the struct keyword for C examples) in the hrgls_api.h functions so that the const-ness doesn't get us into trouble along the way.
This will ripple all the way through the library.
An example:
Hourglass/hrgls_api_defs.hpp
Line 209 in 32c2b25