I would like to use the same enumeration in both the client and server parts of my current (C ++) project, but I'm not sure how to do this. I could just write the listing in its own file and include this in both files, but this seems like bad practice. Putting it in a namespace and then including it in both options would this be the correct way?
I know this is a little subjective, if there is a better place for questions of "best practice", please direct me to it.
Change (development): I send data from the client to the server, in which case I would like to inform the client about the state changes. However, I would like to avoid sending all the information that makes up the state every time I would like to change it, instead I just want to send a number that refers to the index in the array. So, I believe that the best way to do this would be with an enumeration, but I need the same enumeration as on the client and on the server so that they both understand the number. Hope this makes sense.
source
share